Skip to content

Random database connection errors #556

@amureki

Description

@amureki

Python Version

3.12

Django Version

4.2.9

Package Version

6.6.0

Description

Greetings dear fellows!

We are experiencing a lot of “InterfaceError: connection already closed” and “TransactionManagementError”. They are not necessarily accompany each other, but both are consistently happening.
PG logs are not showing anything unexpected or suspicious, but Django closing the connections.

Affected endpoints are different, and I see no common behaviour in them. For example, it sometimes fails even in the basic non-customized admin interface during GET requests.
It does not happen locally.

We did post more details in the following thread:
https://forum.djangoproject.com/t/interfaceerror-and-transactionmanagementerror-postgresql/16924

Later I noticed other people were sharing the similar issues:

And one recent comment was about suspecting a WhiteNoise upgrade.

We did downgrade WhiteNoise version from 6.6.0 to 5.3.0 (one major version) and it indeed resolved all mentioned issues on our instances.

I am struggling to pin the issue down to the change, but happy to assist and provide any other details.

Best,
Rust

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions