Kodi Community Forum
Solved Database upgrade failing - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228)
+---- Thread: Solved Database upgrade failing (/showthread.php?tid=356405)



Database upgrade failing - Mutino - 2020-08-12

https://paste.kodi.tv/numotixupu.kodi

I use a MariaDB database and I am trying to upgrade Kodi, like many times before. Both Music (72->79) and  Videos (116->118) are failing to complete updating on first start.
Quote:Old database found - updating from version 116 to 118
Attempting to update the database MyVideos118 from version 116 to 118
Mysql Start transaction
SQL: Can't determine list of routines to drop.
Exception updating database MyVideos118 from version 116 to 118
Error updating database MyVideos118 from version 116 to 118
Mysql rollback transaction
Even with debugging enabled I cant see much useful information. It appears a lot of the data has been copied - source 72MB, new db 54MB. Tables seem to be in the new DB but not triggers or views.
I've tried a few times, rebooted DB server etc.

Any ideas on how to get the DB upgrade to progress?

Cheers


RE: Database upgrade failing - Klojum - 2020-08-12

(2020-08-12, 20:00)Mutino Wrote: Both Music (72->79) and  Videos (116->118) are failing to complete updating on first start.

Sorry, but quoting a couple of log entries like that is not enough. We need more details, as in the FULL kodi.log file provided via a pastebin website nearby.

EDIT: I think the weeklong heat is getting to me. I simply didn't see the log URL at the top.

(2020-08-12, 20:00)Mutino Wrote: Any ideas on how to get the DB upgrade to progress?

Providing the kodi.log file should give more details on which server version you are using, and hopefully other stuff.
Should you have to try again to do a database upgrade, then deleting both new databases will be necessary.
Also enabling debugging in Kodi (and restart Kodi) will be helpfull for more logged details.


RE: Database upgrade failing - Klojum - 2020-08-12

2020-08-12 18:19:30.726 T:11546 ERROR <general>: Unable to open database: MyMusic71 [1049](Unknown database 'MyMusic71')
2020-08-12 18:19:42.735 T:11546 ERROR <general>: Unable to open database: MyVideos115 [1049](Unknown database 'MyVideos115')


Error 1049: As per the big wide internet:
"This MySQL error usually happens when the MySQL data directory (datadir) does not belong to the user under which the mysqld process runs. For example the data directory belongs to the user root and the mysqld process runs as user mysql."

I think you need to first double-check all your database setup, connects and user rights, bind-address config and so on.


RE: Database upgrade failing - Mutino - 2020-08-13

(2020-08-12, 22:22)Klojum Wrote: 2020-08-12 18:19:30.726 T:11546 ERROR <general>: Unable to open database: MyMusic71 [1049](Unknown database 'MyMusic71')
2020-08-12 18:19:42.735 T:11546 ERROR <general>: Unable to open database: MyVideos115 [1049](Unknown database 'MyVideos115')


Error 1049: As per the big wide internet:
"This MySQL error usually happens when the MySQL data directory (datadir) does not belong to the user under which the mysqld process runs. For example the data directory belongs to the user root and the mysqld process runs as user mysql."

I think you need to first double-check all your database setup, connects and user rights, bind-address config and so on.
Thanks for replying. Agree easy to miss the link in the heat. The log file linked in the orginal post has debugging enabled

I double checked the DB user permissions and from hostname % it has global all privileges including grant - i've checked in both the source DB and the partially created destination DB and the permissions were inherited correctly too.
The DB not found errors you referenced are expected as those DBs do not exist - its just the upgrade process checking what might exist. I am at 72 and 116 already, and need to get to 79 and 118.


RE: Database upgrade failing - Klojum - 2020-08-13

Okay... One other option: enable the Database component in the debugging section of Kodi, drop both new databases, and restart Kodi in full so that the upgrade process is redone. Perhaps the kodi.log will show something.

Alternatively, you could have a look into MariaDB's own log file and look for clues. If only part of the new DBs are being created, you still might have a user right's issue.
Here's my database server user listing:

Image


RE: Database upgrade failing - Mutino - 2020-08-13

Dropped the upgrade failed databases and re-attempted without success
Here is the kodi log with debug enabled https://paste.kodi.tv/egohijujan.kodi
Here also is the MariaDB log https://paste.kodi.tv/geyakupepi

Image
HeidiSQL


RE: Database upgrade failing - Klojum - 2020-08-13

I'm still a little baffled. If Kodi v18 works, why would v19 be a problem?

I already did a v19 database upgrade myself with a LibreELEC build on my MySQL 5.7 db server, and that went fine. I can't imagine that MariaDB is understanding things differently.
Not finding a database is sometimes also a bind-address thing, but if Kodi 18 works on the same db server, so should Kodi 19.

I do have a MariaDB 10.3 running somewhere. I could test that, but not until the weekend.


RE: Database upgrade failing - black_eagle - 2020-08-13

@Mutino Please log into mariadb as your kodi user and execute the following statement SELECT routine_name FROM information_schema.routines WHERE routine_type = 'FUNCTION' and routine_schema = 'MyMusic72';.  Please post the output from that as it's the query that Kodi is trying to do when it generates the error in your logfile. Thanks.


RE: Database upgrade failing - Karellen - 2020-08-13

Maybe something to do with this recent update?

https://github.com/xbmc/xbmc/pull/18137


RE: Database upgrade failing - Mutino - 2020-08-14

(2020-08-13, 21:51)black_eagle Wrote: @Mutino Please log into mariadb as your kodi user and execute the following statement SELECT routine_name FROM information_schema.routines WHERE routine_type = 'FUNCTION' and routine_schema = 'MyMusic72';.  Please post the output from that as it's the query that Kodi is trying to do when it generates the error in your logfile. Thanks.

Interesting, gave:
/* SQL Error (1728): Cannot load from mysql.proc. The table is probably corrupted */ 

I ran
mysql_upgrade -uroot -p --force on the server everything reported as 'ok '
cleaned up the last set of failed DBs and relaunched... worked!

Thanks everyone for your help


Database upgrade failing - Klojum - 2020-08-14

Thread marked solved.