Skip to content

Incompatible versions of psycopg2 and Django #8334

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

Closed
astrojuanlu opened this issue Jul 12, 2021 · 1 comment · Fixed by #8335
Closed

Incompatible versions of psycopg2 and Django #8334

astrojuanlu opened this issue Jul 12, 2021 · 1 comment · Fixed by #8335
Labels
Bug A bug

Comments

@astrojuanlu
Copy link
Contributor

I think, that this might have broken something. I am trying to get the development setup running and after following the instructions from the Development Installation section, I get an

AssertionError at /accounts/login/
database connection isn't set to UTC

when trying to login as admin:admin at community.dev.readthedocs.io/accounts/login. After a little bit of googling, I found

Currently, you seem to have django pinned to 2.2.24 and psycopg2/psycopg2-binary to 2.9.1 which is not a supported combination according to the above issues.


Edit: I tried manually reverting the psycopg2 pins and after rebuilding the docker images, the issue was seemingly fixed

diff --git a/requirements/deploy.txt b/requirements/deploy.txt
index e3809df00..72cc39e89 100644
--- a/requirements/deploy.txt
+++ b/requirements/deploy.txt
@@ -1,7 +1,7 @@
 # Requirements for our production systems
 
 -r pip.txt
-psycopg2==2.9.1
+psycopg2==2.8.6
 gunicorn==20.1.0
 
 # Version 3.0.0 drops support for Django < 3.0
diff --git a/requirements/docker.txt b/requirements/docker.txt
index 15c8d56fd..a90325484 100644
--- a/requirements/docker.txt
+++ b/requirements/docker.txt
@@ -2,7 +2,7 @@
 
 -r pip.txt
 # https://www.psycopg.org/docs/install.html#psycopg-vs-psycopg-binary
-psycopg2-binary==2.9.1
+psycopg2-binary==2.8.6
 
 # Version 3.0.0 drops support for Django < 3.0
 # https://github.com/sebleier/django-redis-cache/#300

Originally posted by @ruro in #8293 (comment)

@astrojuanlu
Copy link
Contributor Author

I confirm I can reproduce this one as well.

@astrojuanlu astrojuanlu added the Bug A bug label Jul 12, 2021
humitos added a commit that referenced this issue Jul 12, 2021
We upgraded to latest psycopg2 in #8293 to a version that's incompatible with
Django 2.2. This commit downgrades it to a compatible version.

Closes #8334
stsewd pushed a commit that referenced this issue Jul 12, 2021
We upgraded to latest psycopg2 in #8293 to a version that's incompatible with
Django 2.2. This commit downgrades it to a compatible version.

Closes #8334
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant