[Django] #34454: Connection failed with error message "FATAL: password authentication failed for user 'user'"

17 views
Skip to first unread message

Django

unread,
Apr 3, 2023, 9:26:11 AM4/3/23
to django-...@googlegroups.com
#34454: Connection failed with error message "FATAL: password authentication failed
for user 'user'"
-------------------------------------+-------------------------------------
Reporter: lajxw | Owner: nobody
Type: Bug | Status: new
Component: Database | Version: 4.2
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
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 PostgreSQL version 4.2rc1.

--
Ticket URL: <https://code.djangoproject.com/ticket/34454>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 3, 2023, 9:28:30 AM4/3/23
to django-...@googlegroups.com
#34454: Connection failed with error message "FATAL: password authentication failed
for user 'user'"
-------------------------------------+-------------------------------------
Reporter: lajxw | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 4.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by lajxw:

Old description:

> 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 PostgreSQL version 4.2rc1.

New description:

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 PostgreSQL version 4.2rc1.

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

--

--
Ticket URL: <https://code.djangoproject.com/ticket/34454#comment:1>

Django

unread,
Apr 3, 2023, 10:02:10 AM4/3/23
to django-...@googlegroups.com
#34454: Connection failed with error message "FATAL: password authentication failed
for user 'user'"
-------------------------------------+-------------------------------------
Reporter: lajxw | Owner: nobody
Type: Bug | Status: closed

Component: Database layer | Version: 4.2
(models, ORM) |
Severity: Normal | Resolution: needsinfo

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* status: new => closed
* resolution: => needsinfo


Old description:

> 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 PostgreSQL version 4.2rc1.
>

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

New description:

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

--

Comment:

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?

--
Ticket URL: <https://code.djangoproject.com/ticket/34454#comment:2>

Django

unread,
Apr 3, 2023, 11:15:52 AM4/3/23
to django-...@googlegroups.com
#34454: Connection failed with error message "FATAL: password authentication failed
for user 'user'"
-------------------------------------+-------------------------------------
Reporter: nainiu | Owner: nobody

Type: Bug | Status: closed
Component: Database layer | Version: 4.2
(models, ORM) |
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by nainiu):

Replying to [comment:2 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.

--
Ticket URL: <https://code.djangoproject.com/ticket/34454#comment:3>

Reply all
Reply to author
Forward
0 new messages