Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django <3.1 requires psycopg2 ~2.8.0, as >=2.9 is incompatible #2274

Closed
alexdutton opened this issue Jun 24, 2021 · 0 comments · Fixed by #2275
Closed

Django <3.1 requires psycopg2 ~2.8.0, as >=2.9 is incompatible #2274

alexdutton opened this issue Jun 24, 2021 · 0 comments · Fixed by #2275
Labels
bug Something's not working

Comments

@alexdutton
Copy link
Contributor

Describe the bug

Django 1.11.x fails to connect to PostgreSQL databases when using psycopg2 2.9 onwards, due to a failing timezone-related assertion.

See upstream for discussion:

Janeway version

This is an issue for both the latest release (1.3.9) and master (d06be70), which don't pin the psycopg2-binary dependency.

To Reproduce

  1. Create a fresh installation
  2. Attempt to perform a database migration

Result:

[…]
  File "/usr/local/lib/python3.8/site-packages/django/db/utils.py", line 101, in inner
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/django/db/backends/postgresql/utils.py", line 6, in utc_tzinfo_factory
    raise AssertionError("database connection isn't set to UTC")
AssertionError: database connection isn't set to UTC

This can be resolved by pinning psycopg2-binary to less than 2.9, until Janeway uses a version of Django from 3.1 onwards.

@alexdutton alexdutton added the bug Something's not working label Jun 24, 2021
alexdutton added a commit to CottageLabs/janeway that referenced this issue Jun 24, 2021
Django 1.11.x fails to connect to PostgreSQL databases when using
psycopg2 2.9 onwards, due to a failing timezone-related assertion.

This also moves from psycopg2 to psycopg2-binary for Lando, which should
have no external effect.

Closes openlibhums#2274.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something's not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant