Postgres/Akonadi problem
Hi I have posted this problem on kdepim-users list but with no resolution. A little history. I changed from mysql to postgresql a long time ago when ver 9.6 was the latest version of postgres. I've update the DB to 10, 11, 12 until ver 13 which i have been using until now. I did try updating to ver 14 but it failed with locale issues during the update and i couldn't get a resolution. I just recently managed to get the database converted from postgresql13 to postgresql16 and the data was transferred to the new DB with no issues. I can't get akonadi loaded as it fails starting postgresql, its failing with a message saying it needs ver 9.6 as teh DB was created using 9.6. I can't see why it insists on ver 9.6 being there as i've updated to ver 16 and that process means i create an empty DB. Ver 9.6 doesn't seem to be in the repos anymore for me to even reinstall it. Thanks for any help. This is my .config/akonadi/akonadiserverrc file which worked happily before [Debug] Tracer=null [%General] Driver=QPSQL [QPSQL] Host=/run/user/1001/akonadi InitDbPath=/usr/bin/initdb Name=akonadi Options= ServerPath=/usr/bin/pg_ctl StartServer=true [QMYSQL] Host= Name=akonadi Options= ServerPath=/usr/sbin/mysqld StartServer=true ----- Here are the error messages. -------------- ~:> akonadictl start org.kde.pim.akonadictl: Starting Akonadi Server... org.kde.pim.akonadictl: done. ~> Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString) org.kde.pim.akonadiserver: Starting up the Akonadi Server... (QFileInfo(/usr/lib/postgresql/bin), QFileInfo(/usr/lib/postgresql/lib64)) QSqlDatabase: QPSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QMARIADB QMYSQL QMYSQL3 org.kde.pim.akonadiserver: Invalid database object during database server startup QProcess: Destroyed while process ("/usr/bin/pg_ctl") is still running. org.kde.pim.akonadiserver: Shutting down AkonadiServer... org.kde.pim.akonadicontrol: Application '/usr/bin/akonadiserver' exited normally... --------- This is from "systemctl status postgresql.service" × postgresql.service - PostgreSQL database server Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled; preset: disabled) Active: failed (Result: exit-code) since Tue 2023-10-31 16:24:13 GMT; 1min 31s ago Process: 5916 ExecStart=/usr/share/postgresql/postgresql-script start (code=exited, status=1/FAILURE) CPU: 8ms Oct 31 16:24:13 Lian-Li systemd[1]: Starting PostgreSQL database server... Oct 31 16:24:13 Lian-Li postgresql-script[5916]: Your database files were created by PostgreSQL version 9.6. Oct 31 16:24:13 Lian-Li postgresql-script[5916]: Could not find executables for this version. Oct 31 16:24:13 Lian-Li postgresql-script[5916]: Please install the PostgreSQL server package for version 9.6. Oct 31 16:24:13 Lian-Li systemd[1]: postgresql.service: Control process exited, code=exited, status=1/FAILURE Oct 31 16:24:13 Lian-Li systemd[1]: postgresql.service: Failed with result 'exit-code'. Oct 31 16:24:13 Lian-Li systemd[1]: Failed to start PostgreSQL database server. ---------- From the journal using "journalctl -xeu postgresql.service" Oct 31 16:24:13 Lian-Li systemd[1]: Starting PostgreSQL database server... Subject: A start job for unit postgresql.service has begun execution Defined-By: systemd Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel A start job for unit postgresql.service has begun execution. The job identifier is 2241. Oct 31 16:24:13 Lian-Li postgresql-script[5916]: Your database files were created by PostgreSQL version 9.6. Oct 31 16:24:13 Lian-Li postgresql-script[5916]: Could not find executables for this version. Oct 31 16:24:13 Lian-Li postgresql-script[5916]: Please install the PostgreSQL server package for version 9.6. Oct 31 16:24:13 Lian-Li systemd[1]: postgresql.service: Control process exited, code=exited, status=1/FAILURE Subject: Unit process exited Defined-By: systemd Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel An ExecStart= process belonging to unit postgresql.service has exited. The process' exit code is 'exited' and its exit status is 1. Oct 31 16:24:13 Lian-Li systemd[1]: postgresql.service: Failed with result 'exit-code'. Subject: Unit failed Defined-By: systemd Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel The unit postgresql.service has entered the 'failed' state with result 'exit- code'. Oct 31 16:24:13 Lian-Li systemd[1]: Failed to start PostgreSQL database server. Subject: A start job for unit postgresql.service has failed Defined-By: systemd Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel A start job for unit postgresql.service has finished with a failure. opensuse:tumbleweed:20231029 Qt: 5.15.11 KDE Frameworks: 5.111.0 - KDE Plasma: 5.27.9 - kwin 5.27.9 kmail2 5.24.2 (23.08.2) - akonadiserver 5.24.2 (23.08.2) - Kernel: 6.5.9-1- default - kernel-firmware-radeon 20231019
On Wednesday, 1 November 2023 16:56:04 GMT mh@mike.franken.de wrote:
On Mittwoch, 1. November 2023 16:34:07 CET Ianseeks wrote:
ServerPath=/usr/bin/pg_ctl
What version is /usr/bin/pg_ctl? Perhaps you have to change this to something like /usr/lib/postgresql[xx]/bin/pg_ctl?
Bye. Michael.
its pointing to /usr/lib/postgresql16/bin/pg_ctl thanks opensuse:tumbleweed:20231030 Qt: 5.15.11 KDE Frameworks: 5.111.0 - KDE Plasma: 5.27.9 - kwin 5.27.9 kmail2 5.24.2 (23.08.2) - akonadiserver 5.24.2 (23.08.2) - Kernel: 6.5.9-1- default - kernel-firmware-radeon 20231019
On Mittwoch, 1. November 2023 19:07:34 CET Ianseeks wrote:
On Wednesday, 1 November 2023 16:56:04 GMT mh@mike.franken.de wrote:
On Mittwoch, 1. November 2023 16:34:07 CET Ianseeks wrote:
ServerPath=/usr/bin/pg_ctl
What version is /usr/bin/pg_ctl? Perhaps you have to change this to something like /usr/lib/postgresql[xx]/bin/pg_ctl?
its pointing to /usr/lib/postgresql16/bin/pg_ctl
what is correct according to your description. Just to be sure: You followed https://userbase.kde.org/Akonadi/postgres_update ? I wrote a small script doing this job, perhaps it can help you (no warranty though). Call it with "<script> 9 10" for example. ------------------------------------------------------- #!/bin/bash FROMVERSION="$1" case "$FROMVERSION" in [0-9]|[0-9][0-9]) ;; *) echo "usage: $0 <fromversion> <toversion>" exit 1 ;; esac TOVERSION="$2" case "$TOVERSION" in [0-9]|[0-9][0-9]) ;; *) echo "usage: $0 <fromversion> <toversion>" exit 1 ;; esac ACTL=/usr/bin/akonadictl [ -n "$ACTL" -a -x "$ACTL" ] || exit 2 # ToDo: check if running echo "$ACTL fsck" \ && "$ACTL" fsck \ && echo "$ACTL vacuum" \ && "$ACTL" vacuum \ && echo "$ACTL stop" \ && "$ACTL" stop \ && "$ACTL" status [ $? -ne 0 ] && exit 3 sleep 10 AHOME="$HOME/.local/share/akonadi/" cd "$AHOME" \ && echo "rm -rf db_data.psql${FROMVERSION}" \ && rm -rf db_data.psql${FROMVERSION} \ && echo "cp -R db_data db_data.psql${FROMVERSION}" \ && cp -R db_data db_data.psql${FROMVERSION} \ && echo "rm -rf db_data.work" \ && rm -rf db_data.work \ && echo "mv db_data db_data.work" \ && mv db_data db_data.work [ $? -ne 0 ] && exit 4 PSQLBINFROM="/usr/lib/postgresql${FROMVERSION}/bin/" PSQLBINTO="/usr/lib/postgresql${TOVERSION}/bin/" [ -d "$PSQLBINFROM" -a -d "$PSQLBINTO" ] || exit 5 echo "${PSQLBINTO}initdb --pgdata=./db_data --locale=C.UTF8" \ && "${PSQLBINTO}initdb" --pgdata=./db_data --locale=C.UTF8 \ && echo "${PSQLBINTO}pg_upgrade -b $PSQLBINFROM -B $PSQLBINTO -d ./ db_data.work -D ./db_data" \ && "${PSQLBINTO}pg_upgrade" -b "$PSQLBINFROM" -B "$PSQLBINTO" -d ./ db_data.work -D ./db_data \ && echo "${PSQLBINTO}vacuumdb --all --analyze-in-stages" \ && echo "-> not working because server is not running" [ $? -ne 0 ] && exit 6 echo "modify ~/.config/akonadi/akonadiserverrc before continuing ... " read var echo "$ACTL start" \ && "$ACTL" start \ && sleep 10 \ && echo "$ACTL fsck" \ && "$ACTL" fsck \ && echo "$ACTL vacuum" \ && "$ACTL" vacuum \ && "$ACTL" status [ $? -ne 0 ] && exit 7 ------------------------------------------------------------
Bye. Michael.
thanks
On Wednesday, 1 November 2023 18:38:34 GMT mh@mike.franken.de wrote: > On Mittwoch, 1. November 2023 19:07:34 CET Ianseeks wrote: > > On Wednesday, 1 November 2023 16:56:04 GMT mh@mike.franken.de wrote: > > > On Mittwoch, 1. November 2023 16:34:07 CET Ianseeks wrote: > > > > ServerPath=/usr/bin/pg_ctl > > > > > > What version is /usr/bin/pg_ctl? > > > Perhaps you have to change this to something like > > > /usr/lib/postgresql[xx]/bin/pg_ctl? > > > > its pointing to /usr/lib/postgresql16/bin/pg_ctl > > what is correct according to your description. > Just to be sure: You followed > https://userbase.kde.org/Akonadi/postgres_update There are no instructions on that page apart from this message "There is currently no text in this page. You can search for this page title in other pages, or search the related logs, but you do not have permission to create this page." > I wrote a small script doing this job, perhaps it can help you (no warranty > though). Call it with "<script> 9 10" for example. I did mine manually via scripts with one file per action. 1. Backup # stop akonadi akonadictl stop # copy cp -R $HOME/.local/share/akonadi/db_data $HOME/.local/share/akonadi/db_data_13 # rename mv $HOME/.local/share/akonadi/db_data $HOME/.local/share/akonadi/db_data_old 2. Create new DB /usr/lib/postgresql16/bin/initdb --pgdata=$HOME/.local/share/akonadi/db_data --lc-collate=en_US.UTF-8 --locale=en_US.UTF-8 3. Check upgrade /usr/lib/postgresql16/bin/pg_upgrade -b /usr/lib/postgresql13/bin -B /usr/lib/ postgresql16/bin -d $HOME/.local/share/akonadi/db_data_13 -D $HOME/.local/ share/akonadi/db_data --check 4. Do the upgrade if "3" worked okay /usr/lib/postgresql16/bin/pg_upgrade -b /usr/lib/postgresql13/bin -B /usr/lib/ postgresql16/bin -d $HOME/.local/share/akonadi/db_data_13 -D $HOME/.local/ share/akonadi/db_data This all worked fine. I cannot understand where it thinks that the new DB was created by version 9.6 > ------------------------------------------------------- > #!/bin/bash > > FROMVERSION="$1" > case "$FROMVERSION" in > [0-9]|[0-9][0-9]) > ;; > *) > echo "usage: $0 <fromversion> <toversion>" > exit 1 > ;; > esac > TOVERSION="$2" > case "$TOVERSION" in > [0-9]|[0-9][0-9]) > ;; > *) > echo "usage: $0 <fromversion> <toversion>" > exit 1 > ;; > esac > ACTL=/usr/bin/akonadictl > [ -n "$ACTL" -a -x "$ACTL" ] || exit 2 > > # ToDo: check if running > echo "$ACTL fsck" \ > && "$ACTL" fsck \ > && echo "$ACTL vacuum" \ > && "$ACTL" vacuum \ > && echo "$ACTL stop" \ > && "$ACTL" stop \ > && "$ACTL" status > [ $? -ne 0 ] && exit 3 > sleep 10 > > AHOME="$HOME/.local/share/akonadi/" > cd "$AHOME" \ > && echo "rm -rf db_data.psql${FROMVERSION}" \ > && rm -rf db_data.psql${FROMVERSION} \ > && echo "cp -R db_data db_data.psql${FROMVERSION}" \ > && cp -R db_data db_data.psql${FROMVERSION} \ > && echo "rm -rf db_data.work" \ > && rm -rf db_data.work \ > && echo "mv db_data db_data.work" \ > && mv db_data db_data.work > [ $? -ne 0 ] && exit 4 > > PSQLBINFROM="/usr/lib/postgresql${FROMVERSION}/bin/" > PSQLBINTO="/usr/lib/postgresql${TOVERSION}/bin/" > [ -d "$PSQLBINFROM" -a -d "$PSQLBINTO" ] || exit 5 > echo "${PSQLBINTO}initdb --pgdata=./db_data --locale=C.UTF8" \ > && "${PSQLBINTO}initdb" --pgdata=./db_data --locale=C.UTF8 \ > && echo "${PSQLBINTO}pg_upgrade -b $PSQLBINFROM -B $PSQLBINTO -d ./ > db_data.work -D ./db_data" \ > && "${PSQLBINTO}pg_upgrade" -b "$PSQLBINFROM" -B "$PSQLBINTO" -d ./ > db_data.work -D ./db_data \ > && echo "${PSQLBINTO}vacuumdb --all --analyze-in-stages" \ > && echo "-> not working because server is not running" > [ $? -ne 0 ] && exit 6 > > echo "modify ~/.config/akonadi/akonadiserverrc before continuing ... " > read var > > echo "$ACTL start" \ > && "$ACTL" start \ > && sleep 10 \ > && echo "$ACTL fsck" \ > && "$ACTL" fsck \ > && echo "$ACTL vacuum" \ > && "$ACTL" vacuum \ > && "$ACTL" status > [ $? -ne 0 ] && exit 7 > ------------------------------------------------------------ > > > > Bye. > > > Michael. > > > > thanks opensuse:tumbleweed:20231030 Qt: 5.15.11 KDE Frameworks: 5.111.0 - KDE Plasma: 5.27.9 - kwin 5.27.9 kmail2 5.24.2 (23.08.2) - akonadiserver 5.24.2 (23.08.2) - Kernel: 6.5.9-1- default - kernel-firmware-radeon 20231019
On Mittwoch, 1. November 2023 19:59:36 CET Ianseeks wrote:
On Wednesday, 1 November 2023 18:38:34 GMT mh@mike.franken.de wrote:
On Mittwoch, 1. November 2023 19:07:34 CET Ianseeks wrote:
On Wednesday, 1 November 2023 16:56:04 GMT mh@mike.franken.de wrote:
On Mittwoch, 1. November 2023 16:34:07 CET Ianseeks wrote:
ServerPath=/usr/bin/pg_ctl
What version is /usr/bin/pg_ctl? Perhaps you have to change this to something like /usr/lib/postgresql[xx]/bin/pg_ctl?
its pointing to /usr/lib/postgresql16/bin/pg_ctl
what is correct according to your description. Just to be sure: You followed https://userbase.kde.org/Akonadi/postgres_update
There are no instructions on that page apart from this message "There is currently no text in this page. You can search for this page title in other pages, or search the related logs, but you do not have permission to create this page."
uhm, sorry: https://userbase.kde.org/Akonadi/Postgres_update But it describes exactly, what you've done - and what my script does.
I wrote a small script doing this job, perhaps it can help you (no warranty though). Call it with "<script> 9 10" for example.
I did mine manually via scripts with one file per action. 1. Backup # stop akonadi akonadictl stop # copy cp -R $HOME/.local/share/akonadi/db_data $HOME/.local/share/akonadi/db_data_13 # rename mv $HOME/.local/share/akonadi/db_data $HOME/.local/share/akonadi/db_data_old
2. Create new DB /usr/lib/postgresql16/bin/initdb --pgdata=$HOME/.local/share/akonadi/db_data --lc-collate=en_US.UTF-8 --locale=en_US.UTF-8
Not sure, though, if you can skip the versions in between.
3. Check upgrade /usr/lib/postgresql16/bin/pg_upgrade -b /usr/lib/postgresql13/bin -B /usr/lib/ postgresql16/bin -d $HOME/.local/share/akonadi/db_data_13 -D $HOME/.local/ share/akonadi/db_data --check
4. Do the upgrade if "3" worked okay /usr/lib/postgresql16/bin/pg_upgrade -b /usr/lib/postgresql13/bin -B /usr/lib/ postgresql16/bin -d $HOME/.local/share/akonadi/db_data_13 -D $HOME/.local/ share/akonadi/db_data
This all worked fine. I cannot understand where it thinks that the new DB was created by version 9.6
I already read the thread in the other list and I am really clueless now, what might have happened 8-( I did it lots of times and never had a problem. Bye. Michael.
On Wednesday, 1 November 2023 19:12:29 GMT mh@mike.franken.de wrote:
On Mittwoch, 1. November 2023 19:59:36 CET Ianseeks wrote:
On Wednesday, 1 November 2023 18:38:34 GMT mh@mike.franken.de wrote:
On Mittwoch, 1. November 2023 19:07:34 CET Ianseeks wrote:
On Wednesday, 1 November 2023 16:56:04 GMT mh@mike.franken.de wrote:
On Mittwoch, 1. November 2023 16:34:07 CET Ianseeks wrote:
ServerPath=/usr/bin/pg_ctl
What version is /usr/bin/pg_ctl? Perhaps you have to change this to something like /usr/lib/postgresql[xx]/bin/pg_ctl?
its pointing to /usr/lib/postgresql16/bin/pg_ctl
what is correct according to your description. Just to be sure: You followed https://userbase.kde.org/Akonadi/postgres_update
There are no instructions on that page apart from this message "There is currently no text in this page. You can search for this page title in other pages, or search the related logs, but you do not have permission to create this page."
uhm, sorry: https://userbase.kde.org/Akonadi/Postgres_update
But it describes exactly, what you've done - and what my script does.
I wrote a small script doing this job, perhaps it can help you (no warranty though). Call it with "<script> 9 10" for example.
I did mine manually via scripts with one file per action. 1. Backup # stop akonadi akonadictl stop # copy cp -R $HOME/.local/share/akonadi/db_data $HOME/.local/share/akonadi/db_data_13 # rename mv $HOME/.local/share/akonadi/db_data $HOME/.local/share/akonadi/db_data_old
2. Create new DB /usr/lib/postgresql16/bin/initdb --pgdata=$HOME/.local/share/akonadi/db_data --lc-collate=en_US.UTF-8 --locale=en_US.UTF-8
Not sure, though, if you can skip the versions in between.
I thought that too because i came across that problem in my early update of ver 9.6 to ver 11 but it looks like they've fixed that problem
3. Check upgrade /usr/lib/postgresql16/bin/pg_upgrade -b /usr/lib/postgresql13/bin -B /usr/lib/ postgresql16/bin -d $HOME/.local/share/akonadi/db_data_13 -D $HOME/.local/ share/akonadi/db_data --check
4. Do the upgrade if "3" worked okay /usr/lib/postgresql16/bin/pg_upgrade -b /usr/lib/postgresql13/bin -B /usr/lib/ postgresql16/bin -d $HOME/.local/share/akonadi/db_data_13 -D $HOME/.local/ share/akonadi/db_data
This all worked fine. I cannot understand where it thinks that the new DB was created by version 9.6
I already read the thread in the other list and I am really clueless now, what might have happened 8-( I did it lots of times and never had a problem. me too. it seems there is a config somewhere thats not being updated by the update Bye. Michael.
Thanks for taking the time to check it out. opensuse:tumbleweed:20231030 Qt: 5.15.11 KDE Frameworks: 5.111.0 - KDE Plasma: 5.27.9 - kwin 5.27.9 kmail2 5.24.2 (23.08.2) - akonadiserver 5.24.2 (23.08.2) - Kernel: 6.5.9-1- default - kernel-firmware-radeon 20231019
participants (2)
-
Ianseeks
-
mh@mike.franken.de