Open dmsimard opened 3 years ago
There was a fix proposed to django 2.2 LTS and the actual issue is best summarized here: https://github.com/django/django/pull/14530#issuecomment-862961533
The issue doesn't exist in newer versions of django but ara hasn't moved to 3.2 LTS yet (released in april 2021).
The fix will not be merged and Django maintainers adjusted the documentation to suggest that users should pin psycopg2 < 2.9
when using 2.2.x.
Sent a PR to pin psycopg2 in the setup.cfg extras: https://github.com/ansible-community/ara/pull/321
It's not a definitive fix because this will only help users who run pip install ara[server,postgresql]
which, I suspect, is a minority... but hey, it's better than nothing.
pyscopg2 could end up being installed unpinned from PyPi or once psycopg2 2.9 lands in linux distribution repositories where the version of django is 2.2.
Other options to explore:
AssertionError
from where it was triggered: File "/home/zuul/.ara-tests/virtualenv/lib64/python3.6/site-packages/ara/api/fields.py", line 74, in to_internal_value
and return a friendlier message with a warning about the version of psycopg2.This is also an issue in the lastest docker image:
[ara] Using settings file: /opt/ara/settings.yaml
Traceback (most recent call last):
File "/usr/local/bin/ara-manage", line 10, in <module>
sys.exit(main())
File "/usr/local/lib/python3.10/site-packages/ara/server/__main__.py", line 56, in main
raise Psycopg2VersionException(version=psycopg_version)
ara.setup.exceptions.Psycopg2VersionException: The version of psycopg2 (2.9.1) must be <2.9 due to an incompatibility with Django 2.2.
Hi @Nold360, it is a known issue in Fedora because the version of psycopg is too new for the version of django.
I will address it by recovering it from PyPI instead but in the meantime, the centos8-stream-pypi-latest
tag should work.
Hi @dmsimard ,
Running into this trying to get a deployment setup on K8s as a POC for my team. I'm using postgres:11
and ara-api:latest
. Is centos8-stream-pypi-latest
a tag for the ara-api
container image? I'm unable to find it if so.
[ara] Using settings file: /opt/ara/settings.yaml
Traceback (most recent call last):
File "/usr/local/bin/ara-manage", line 10, in <module>
sys.exit(main())
File "/usr/local/lib/python3.10/site-packages/ara/server/__main__.py", line 56, in main
raise Psycopg2VersionException(version=psycopg_version)
ara.setup.exceptions.Psycopg2VersionException: The version of psycopg2 (2.9.1) must be <2.9 due to an incompatibility with Django 2.2.
@jbpratt centos8-stream-pypi-latest
is safe to use -- it's still the ara API server (and built-in reporting interface) but it's built on top of centos-stream8 instead of fedora35. There's otherwise a list of available tags in About tags
in the image repo: https://quay.io/repository/recordsansible/ara-api
The version of psycopg2 in centos-stream8 is older and so doesn't run into the issue.
I'm leaving this issue opened so we can eventually fix the fedora image which probably implies installing psycopg2 pinned from PyPI instead of from distribution packages.
I see that master
has been on django 3 for a few months, is there any plans to release it soon or should I go ahead and apply the provided workarounds?
What is the issue ?
Noticed an exception from a CI job running testing the postgresql database backend: https://dashboard.zuul.ansible.com/t/ansible/build/36783777b9d342e7ad134def9bb67254
This seems to be a recently documented issue between django and psycopg2: https://github.com/psycopg/psycopg2/issues/1293