Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
After upgrade to Matrix SQL DB Upgrade freezes
#1
I use an SQL DB for storing kodi data for multiple clients.
After upgrade from 18.9 to 19.0 kodi starts the DB upgrade:
Code:
2021-02-26 10:57:39.202 T:925092   ERROR <general>: Unable to open database: MyMusic73 [1049](Unknown database 'MyMusic73')
2021-02-26 10:57:39.231 T:925092    INFO <general>: Old database found - updating from version 72 to 82
2021-02-26 11:13:44.868 T:925092    INFO <general>: Attempting to update the database MyMusic82 from version 72 to 82
2021-02-26 11:15:47.594 T:925092    INFO <general>: UpdateTables - updating tables
This runs fine up to this query which takes forever (at least several hours):
Code:
UPDATE album SET iDisctotal = (SELECT COUNT(DISTINCT (iTrack >> 16)) FROM song WHERE song.idAlbum = album.idAlbum GROUP BY idAlbum ) WHERE EXISTS (SELECT 1 FROM song WHERE song.idAlbum = album.idAlbum)
One MariaDB thread on the server sticks at 100% CPU forever.

When I stop the query and restart kodi it continues withe the video DB but can't access the new music DB.
After deleting the new DBs and restarting kodi it gets to the same point. DB upgrade seems impossible.

Any idea?
Reply
#2
kodi client:
Code:
2021-02-26 10:57:38.193 T:925079    INFO <general>: Starting Kodi (19.0 (19.0.0) Git:20210219-f44fdfbf67). Platform: Linux x86 64-bit
2021-02-26 10:57:38.193 T:925079    INFO <general>: Using Release Kodi x64
2021-02-26 10:57:38.193 T:925079    INFO <general>: Kodi compiled 2021-02-19 by GCC 9.3.0 for Linux x86 64-bit version 5.4.78 (328782)
2021-02-26 10:57:38.193 T:925079    INFO <general>: Running on Ubuntu 20.04.2 LTS, kernel: Linux x86 64-bit version 5.4.0-65-generic
2021-02-26 10:57:38.193 T:925079    INFO <general>: FFmpeg version/source: 4.3.1-Kodi
2021-02-26 10:57:38.193 T:925079    INFO <general>: Host CPU: Intel® Core™ i7-4910MQ CPU @ 2.90GHz, 8 cores available
SQL Server (Odroid C2):
Code:
root@nas:~# mysql --version
mysql  Ver 15.1 Distrib 10.1.47-MariaDB, for debian-linux-gnu (aarch64) using readline 5.2
root@nas:~# uname -a
Linux nas 3.16.85-52 #1 SMP PREEMPT Mon Jun 29 13:18:51 -03 2020 aarch64 aarch64 aarch64 GNU/Linux
Reply
#3
(2021-02-26, 13:17)rolandm Wrote: 10.1.47-MariaDB

10.1.x is a little on the older side of things. I know Debian takes things slow with its software, but...
SQL error 1049 is a configuration problem. Insufficient mysql user privileges?
Reply
#4
(2021-02-26, 16:29)Klojum Wrote:
(2021-02-26, 13:17)rolandm Wrote: 10.1.47-MariaDB

10.1.x is a little on the older side of things. I know Debian takes things slow with its software, but...
SQL error 1049 is a configuration problem. Insufficient mysql user privileges?

Where did you get the 1049 error from?
I didn't change the privileges, the user has all rights on the dbs..
Reply
#5
(2021-02-26, 17:36)rolandm Wrote: Where did you get the 1049 error from?

Ah, sorry.
kodi tries to access a nonexistent DB MyMusic73, the existing is MyMusic72.
Reply
#6
(2021-02-26, 17:46)rolandm Wrote: kodi tries to access a nonexistent DB MyMusic73, the existing is MyMusic72.

My bad... Kodi 19 uses MyMusic82 now.
Reply
#7
(2021-02-26, 13:07)rolandm Wrote: This runs fine up to this query which takes forever (at least several hours):
Code:
UPDATE album SET iDisctotal = (SELECT COUNT(DISTINCT (iTrack >> 16)) FROM song WHERE song.idAlbum = album.idAlbum GROUP BY idAlbum ) WHERE EXISTS (SELECT 1 FROM song WHERE song.idAlbum = album.idAlbum)
One MariaDB thread on the server sticks at 100% CPU forever.
Migration of the music database is failing when it tries to set album disc totals (a new column), there is probably something unexpected in the original song data causing this.

There is no easy way for me to see your MySQL/MariaDB data, but you could try the following query on MyMusic72 and see if that shows anything obvious:

Code:

SELECT idAlbum, COUNT(DISTINCT (iTrack >> 16))  as DiscCount
FROM song
GROUP BY idAlbum
ORDER BY DiscCount DESC, idAlbum
Reply
#8
Hello, was this problem solved and if yes, how? I have the same problem, with 18.x not beeing able to upgrade to 19.x because of DB migration gets stuck. Thanks!
Reply
#9
(2023-01-06, 16:09)Bladefs Wrote: with 18.x not beeing able to upgrade to 19.x because of DB migration gets stuck

Using MySQL/MariaDB setups, it's difficult to say if a stuck upgrade is an identical problem to your problem.
Why not start with providing the debug log (wiki) of your Kodi setup, as well as what your DB server setup is.
Reply
#10
Hella Dave thanks for comming back on my question and your detailed questions about it.
Even it can be a different problem I was interested in how the problem of the thread starter was solved. (Because it was exactly my problem and he did a good description of it.)

Anyways I was able to solve my problem:
  • I deleted the newly created DBs for Music and Movie in MySQL and started Kodi again.
  • It then tried to create the DBs again and was successfull first for music
  • and after another deletion of movie it also passed this DB.

For others having this problem... since Kodi gets suck in the initial screen you have to enable debug logging in the advancedsettings.xml https://kodi.wiki/view/Log_file/Advanced
Reply

Logout Mark Read Team Forum Stats Members Help
After upgrade to Matrix SQL DB Upgrade freezes0