[Akonadi] [Bug 476617] New: postgresql16 fails to run after DB update from postgresql13 - errors from akonadictl start

BingMyBong bugzilla_noreply at kde.org
Mon Nov 6 10:14:07 GMT 2023


https://bugs.kde.org/show_bug.cgi?id=476617

            Bug ID: 476617
           Summary: postgresql16 fails to run after DB update from
                    postgresql13 - errors from akonadictl start
    Classification: Frameworks and Libraries
           Product: Akonadi
           Version: 5.24.2
          Platform: openSUSE
                OS: Linux
            Status: REPORTED
          Severity: critical
          Priority: NOR
         Component: general
          Assignee: kdepim-bugs at kde.org
          Reporter: bingmybong at btinternet.com
                CC: carl at carlschwan.eu
  Target Milestone: ---

Many years ago i migrated to using Postgresql 9.6 . I've since then updated the
DB to postgresql10, 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've been
without mail for a week now trying to get answers from support lists,
unfortunately no-one has a solution

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 to load as it fails to start postgresql16, its failing with
a message saying it needs postgesql9.6 as the DB was originally created using
9.6.  Help from Postgresql-novice mailing list (and Reinhard Max in opensuse
buglist) identified that the postgresql-script is accessing /var/lib/pgsql/data
and referencing the PG_VERSION file in that directory and it contains 9.6.  I
can't see how this wasn't updated as each new version of Postgresql was
installed.
 I can't even install Ver 9.6 to see if that cures the problem as its no longer
in the opensuse repos.

Can anyone see a solution ? i was thinking of uninstalling every version of
Postgresql and deleting 
/var/lib/pgsql/data directory manually if it doesn't disappear during the
postgresql uninstall process.
I can then reinstall postgresql16 and hopefully it'll work again.

-------------- the section below lists: 1. my process to convert DB.  2. cli
errors for ankonadictl start 3. errors in journal ----------

I update the DB manually via scripts with one file per action.
1. Backup
akonadictl stop
# copy for backup
cp -R $HOME/.local/share/akonadi/db_data $HOME/.local/share/akonadi/db_data_13
# rename so no db_data exists
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

-------------- the section list errors from "akonadi start" ----------

~:> 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 shows status using "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.

---------- Errors 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: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

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Kdepim-bugs mailing list