Database problem after system upgrade
I've upgraded from Fedora 37 to 38, and the postgresql server will not start:
nov. 14 23:22:18 dalen.lamasti.net postgresql-check-db-dir[1410]: An old version of the database format was found. nov. 14 23:22:18 dalen.lamasti.net postgresql-check-db-dir[1410]: Use 'postgresq l-setup --upgrade' to upgrade to version '15' nov. 14 23:22:18 dalen.lamasti.net postgresql-check-db-dir[1410]: See /usr/share /doc/postgresql/README.rpm-dist for more information.
When I run postgresql-setup --upgrade
I get:
runuser: warning: cannot change directory to /opt/postgresql: no such file or directory
- Upgrading database. /usr/bin/postgresql-setup: line 307: cd: /opt/postgresql: no such file or directory ERROR: pg_upgrade tool failed ERROR: Upgrade failed.
- See /var/lib/pgsql/upgrade_postgresql.log for details.
Why does the upgrade tool look for files in /opt/postgresql and not in /var/lib/pgsql? How to fix it?
Thanks, Lars
On 11/14/23 15:10, Lars Bjørndal wrote:
Why does the upgrade tool look for files in /opt/postgresql and not in /var/lib/pgsql? How to fix it?
This would appear to be a PostgreSQL question, not a Mailman question.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
I managed to upgrade the database. However, Mailman3 won't start:
× mailman3.service - GNU Mailing List Manager Loaded: loaded (/etc/systemd/system/mailman3.service; enabled; preset: disabled) Drop-In: /usr/lib/systemd/system/service.d └─10-timeout-abort.conf Active: failed (Result: exit-code) since Wed 2023-11-15 06:49:38 CET; 44min ago Process: 28224 ExecStart=/opt/mailman3/venv/bin/mailman start (code=exited, status=1/FAILURE) CPU: 948ms
nov. 15 06:49:38 dalen.lamasti.net mailman[28224]: return self.loaded_dbapi.connect(*cargs, **cparams) nov. 15 06:49:38 dalen.lamasti.net mailman[28224]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ nov. 15 06:49:38 dalen.lamasti.net mailman[28224]: File "/opt/mailman3/venv/lib64/python3.11/site-packages/psycopg2/__init__.py", line 122, in connect nov. 15 06:49:38 dalen.lamasti.net mailman[28224]: conn = _connect(dsn, connection_factory=connection_factory, **kwasync) nov. 15 06:49:38 dalen.lamasti.net mailman[28224]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ nov. 15 06:49:38 dalen.lamasti.net mailman[28224]: sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: FATAL: Ident authentication failed for user "mailman" nov. 15 06:49:38 dalen.lamasti.net mailman[28224]: (Background on this error at: https://sqlalche.me/e/20/e3q8) nov. 15 06:49:38 dalen.lamasti.net systemd[1]: mailman3.service: Control process exited, code=exited, status=1/FAILURE nov. 15 06:49:38 dalen.lamasti.net systemd[1]: mailman3.service: Failed with result 'exit-code'. nov. 15 06:49:38 dalen.lamasti.net systemd[1]: Failed to start mailman3.service - GNU Mailing List Manager.
Mailman.log doesn't contain any info.
How do I find the cause of this problem?
Lars
On Wed, Nov 15, 2023 at 9:39 AM Lars Bjørndal <lars@lamasti.net> wrote:
I managed to upgrade the database. However, Mailman3 won't start:
× mailman3.service - GNU Mailing List Manager Loaded: loaded (/etc/systemd/system/mailman3.service; enabled; preset: disabled) Drop-In: /usr/lib/systemd/system/service.d └─10-timeout-abort.conf Active: failed (Result: exit-code) since Wed 2023-11-15 06:49:38 CET; 44min ago Process: 28224 ExecStart=/opt/mailman3/venv/bin/mailman start (code=exited, status=1/FAILURE) CPU: 948ms
nov. 15 06:49:38 dalen.lamasti.net mailman[28224]: return self.loaded_dbapi.connect(*cargs, **cparams) nov. 15 06:49:38 dalen.lamasti.net mailman[28224]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ nov. 15 06:49:38 dalen.lamasti.net mailman[28224]: File "/opt/mailman3/venv/lib64/python3.11/site-packages/psycopg2/__init__.py", line 122, in connect nov. 15 06:49:38 dalen.lamasti.net mailman[28224]: conn = _connect(dsn, connection_factory=connection_factory, **kwasync) nov. 15 06:49:38 dalen.lamasti.net mailman[28224]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ nov. 15 06:49:38 dalen.lamasti.net mailman[28224]: sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: FATAL: Ident authentication failed for user "mailman" nov. 15 06:49:38 dalen.lamasti.net mailman[28224]: (Background on this error at: https://sqlalche.me/e/20/e3q8) nov. 15 06:49:38 dalen.lamasti.net systemd[1]: mailman3.service: Control process exited, code=exited, status=1/FAILURE nov. 15 06:49:38 dalen.lamasti.net systemd[1]: mailman3.service: Failed with result 'exit-code'. nov. 15 06:49:38 dalen.lamasti.net systemd[1]: Failed to start mailman3.service - GNU Mailing List Manager.
Mailman.log doesn't contain any info.
How do I find the cause of this problem?
From the above output, I'd try two things:
- Is the database really running?
$ sudo -u postgres psql
- Can mailman connect to the database:
psql -h localhost -U mailman -d mailman -W
What does those two commands give you?
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-) [How to ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html]
Thanks a lot.
[Odhiambo]
From the above output, I'd try two things:
- Is the database really running?
$ sudo -u postgres psql
- Can mailman connect to the database:
psql -h localhost -U mailman -d mailman -W
What does those two commands give you?
I found that I did need to change the pg_hba.conf to get authentication to work.
When I no start Mailman, I get the following:
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 1055, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/mailman/bin/mailman.py", line 69, in invoke return super().invoke(ctx) ^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py", line 760, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/decorators.py", line 26, in new_func return f(get_current_context(), *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/mailman/commands/cli_control.py", line 91, in start status, lock = master_state() ^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/mailman/bin/master.py", line 104, in master_state os.kill(pid, 0) PermissionError: [Errno 1] Operation not permitted
But which operation are not permitted, how to find the cause?
Thanks Lars
On Wed, Nov 15, 2023 at 11:34 AM Lars Bjørndal <lars@lamasti.net> wrote:
Thanks a lot.
[Odhiambo]
From the above output, I'd try two things:
- Is the database really running?
$ sudo -u postgres psql
- Can mailman connect to the database:
psql -h localhost -U mailman -d mailman -W
What does those two commands give you?
I found that I did need to change the pg_hba.conf to get authentication to work.
When I no start Mailman, I get the following:
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 1055, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/mailman/bin/mailman.py", line 69, in invoke return super().invoke(ctx) ^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py", line 760, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/decorators.py", line 26, in new_func return f(get_current_context(), *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/mailman/commands/cli_control.py", line 91, in start status, lock = master_state() ^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/mailman/bin/master.py", line 104, in master_state os.kill(pid, 0) PermissionError: [Errno 1] Operation not permitted
But which operation are not permitted, how to find the cause?
That message is cryptic to me, but @Mark Sapiro <mark@msapiro.net> might know. Could you please see if there are stale lock files in /opt/mailman3/var/locks/ that could be preventing mailman3 from starting? If there are two files there, delete them and try starting mailman3 again. Beyond that possibility, I now remain clueless :)
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-) [How to ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html]
[Odhiambo]
[...]
That message is cryptic to me, but [2]@Mark Sapiro might know. Could you please see if there are stale lock files in /opt/mailman3/var/locks/ that could be preventing mailman3 from starting? If there are two files there, delete them and try starting mailman3 again. Beyond that possibility, I now remain clueless :)
Deleting the lock files did the trick.
Thanks.
Lars
participants (3)
-
Lars Bjørndal
-
Mark Sapiro
-
Odhiambo Washington