Opened 13 months ago

Closed 13 months ago

Last modified 13 months ago

#34454 closed Bug (needsinfo)

Connection failed with error message "FATAL: password authentication failed for user 'user'"

Reported by: nainiu Owned by: nobody
Component: Database layer (models, ORM) Version: 4.2
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Tim Graham)

I am using psycopg3 package with Django to connect to a PostgreSQL database. However, I am experiencing occasional connection failures with the following error message:

"Connection failed with error message: FATAL: password authentication failed for user 'user'"

The error seems to occur randomly, and I am not sure what is causing it. I have double-checked that the username and password specified in the DATABASES setting in my Django project are correct and have the necessary permissions to access the database.

I am using psycopg3 version 3.1.8 and Django version 4.2rc1.

/This error can occur randomly, and sometimes it can be correctly linked to the database

Change History (3)

comment:1 by nainiu, 13 months ago

Description: modified (diff)

comment:2 by Tim Graham, 13 months ago

Description: modified (diff)
Resolution: needsinfo
Status: newclosed

I don't think you've provided enough details to make this ticket actionable. I guess you will need to debug the issue further or at least provide a minimal sample project that reproduces the problem. I guess the issue doesn't occur with pyscopg2?

in reply to:  2 comment:3 by nainiu, 13 months ago

Replying to Tim Graham:

I don't think you've provided enough details to make this ticket actionable. I guess you will need to debug the issue further or at least provide a minimal sample project that reproduces the problem. I guess the issue doesn't occur with pyscopg2?

Yes, this issue does not occur in psycopg2. Currently, I have not found a stable way to reproduce it, and I have also examined the 'conninfo' information in psycopg\connection.py and found that it is the same every time.

After contacting my cloud database provider, they said that the problem may be caused by an error after connecting to the same container. I noticed that there is an additional database connection before each error occurs.

Note: See TracTickets for help on using tickets.
Back to Top