Kodi Community Forum

Full Version: Kodi remote db query error since upgrading the database server to Debian stable(11.5)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
After many years of trouble-free mariadb external music db, I ran in to problem which I believe started when the external server that hosts mariadb got upgraded to the latest debian stable (bullseye / 11.5)

Kodi/chorus "recently played albums" went missing in Chorus (the web interface), and every time I go to that screen in Chorus, I see this error in Kodi's log:

Code:

2022-09-25 14:52:28.611 T:1655946 ERROR <general>: SQL: [MyMusic82] Undefined MySQL error: Code (1728)

(((query posted in the following link as posting it here triggers a cloudflare alarm: https://paste.kodi.tv/rudeqohumi)))

2022-09-25 14:52:28.611 T:1655946 ERROR <general>: GetAlbumsByWhereJSON failed

The mariadb version that comes with debian 11.5:
mariadb --version
mariadb  Ver 15.1 Distrib 10.5.15-MariaDB, for debian-linux-gnueabihf (armv7l) using  EditLine wrapper

The previous mariadb version was:
mariadb-server-10.3 (>= 1:10.3.36-0+deb10u1)

The issue is only with "Recently Played albums". Recently Added and Random albums display correctly
reply to self, to help anybody running into this problem.

Looks like the debian upgrade (raspbian in this case) from buster to bullseye upgrades mariadb from 10.3 to 10.5 and this requires updating some internal database structures in all existing databases, debian has an script that does that automatically on first run.

Details are beyond me but this post gave me the right hint: https://mariadb.com/kb/en/installation-i...ments/5352

Basically for the 'mariadb upgrade script' to run, you will need to edit /etc/mysql/debian.cnf, where you will find some config including a line for the msql root password, that you will need to fill-in.

after that,

systemctl restart mariadb

If you then wait a couple of minutes and then look at the mariadb service status, you will find something like this,

Code:

sudo systemctl status mariadb.service
● mariadb.service - MariaDB 10.5.15 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
     Active: active (running) since Sun 2022-09-25 15:44:44 EDT; 37s ago
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 32217 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
    Process: 32218 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 32220 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION=$VAR || ex>
    Process: 32342 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 32351 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS)
   Main PID: 32331 (mariadbd)
     Status: "Taking your SQL requests now..."
      Tasks: 17 (limit: 1597)
     Memory: 50.3M
        CPU: 2.615s
     CGroup: /system.slice/mariadb.service
             └─32331 /usr/sbin/mariadbd

Sep 25 15:44:51 rpi /etc/mysql/debian-start[32368]: MyMusic82.song_artist                              OK
Sep 25 15:44:51 rpi /etc/mysql/debian-start[32368]: MyMusic82.song_genre                               OK
Sep 25 15:44:51 rpi /etc/mysql/debian-start[32368]: MyMusic82.source                                   OK
Sep 25 15:44:51 rpi /etc/mysql/debian-start[32368]: MyMusic82.source_path                              OK
Sep 25 15:44:51 rpi /etc/mysql/debian-start[32368]: MyMusic82.version                                  OK
Sep 25 15:44:51 rpi /etc/mysql/debian-start[32368]: MyMusic82.versiontagscan                           OK
Sep 25 15:44:51 rpi /etc/mysql/debian-start[32368]: information_schema
Sep 25 15:44:51 rpi /etc/mysql/debian-start[32368]: performance_schema
Sep 25 15:44:51 rpi /etc/mysql/debian-start[32368]: Phase 7/7: Running 'FLUSH PRIVILEGES'
Sep 25 15:44:51 rpi /etc/mysql/debian-start[32368]: OK

If you now just refresh the kodi's web interface in your browser, the "Recently Played" music section will show up and the errors in the log are gone.
Thread marked solved.