Hi, Mark!
You wrote:
On 4/27/23 11:42 AM, Lars Bjørndal wrote:
After I've installed the venv and packages again, I get the following error when running the mailman command from within the venv:
SystemError: initialization of _psycopg raised unreported exception
How do I fix that?
The first issue arises because the venv/bin/ directory contains only symlinks to a system python3, and either they broke upon the upgrade or they pointed to what is now Python 3.11 and there was some incompatibility between that python and modules in the venv.
I have some symlinks:
python -> /usr/bin/python python3 -> python python3.11 -> python
Did you install psycopg2-binary as discussed at https://docs.mailman3.org/en/latest/install/virtualenv.html#installing-mailm...
Yes, I did.
Is the error logged in var/logs/mailman.log? If so, what's the traceback?
No. But the traceback is:
Traceback (most recent call last): File "/opt/mailman3/venv/bin/mailman", line 8, in <module> sys.exit(main()) ^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py", line 1130, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py", line 1054, in main with self.make_context(prog_name, args, **extra) as ctx: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py", line 920, in make_context self.parse_args(ctx, args) File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py", line 1613, in parse_args rest = super().parse_args(ctx, args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py", line 1378, in parse_args value, args = param.handle_parse_result(ctx, opts, args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py", line 2360, in handle_parse_result value = self.process_value(ctx, value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py", line 2322, in process_value value = self.callback(ctx, self, value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/mailman/bin/mailman.py", line 95, in initialize_config initialize(value) File "/opt/mailman3/venv/lib64/python3.11/site-packages/mailman/core/initialize.py", line 229, in initialize initialize_2(propagate_logs=propagate_logs) File "/opt/mailman3/venv/lib64/python3.11/site-packages/mailman/core/initialize.py", line 187, in initialize_2 config.db = getUtility(IDatabaseFactory, utility_name).create() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/mailman/database/factory.py", line 57, in create database.initialize() File "/opt/mailman3/venv/lib64/python3.11/site-packages/mailman/database/base.py", line 117, in initialize self.engine = create_engine( ^^^^^^^^^^^^^^ File "<string>", line 2, in create_engine File "/opt/mailman3/venv/lib64/python3.11/site-packages/sqlalchemy/util/deprecations.py", line 283, in warned return fn(*args, **kwargs) # type: ignore[no-any-return] ^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/sqlalchemy/engine/create.py", line 601, in create_engine dbapi = dbapi_meth(**dbapi_args) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py", line 669, in import_dbapi import psycopg2 File "/opt/mailman3/venv/lib64/python3.11/site-packages/psycopg2/__init__.py", line 51, in <module> from psycopg2._psycopg import ( # noqa SystemError: initialization of _psycopg raised unreported exception
Do I need to upgrade the database? If so, how do I do that?
Thanks, Lars