Posts: 24
Joined: Feb 2013
Reputation:
1
TyKH
Junior Member
Posts: 24
Setup: Nokia Streaming Box Lan connected
MariaDB container running Synology. Advancedsettings.xml and sources.xml present.
Today Kodi in my Nokia Streaming Box 8010 updated to Omega. Had the database migration screen. After that my library was empty. Went to files section where still all the added folders were visible. Changed the content, however no scan starts. When looking 'set content' nothing changed. Exiting Kodi and starting Kodi same results. Even worse, trying to open a video results in a return to home page of the Nokia box.
Uninstalled Kodi and start again. Was able to build the library. After that, copied the advanced.xml to Kodi. Library gone and unable to build. So v21 is unable to work with my advancedsettings.xml to build the library externally which have worked for me for
years. What has changed in v21 and needs to be done to fix this? Below my xml file.
<advancedsettings>
<videodatabase>
<type>mysql</type>
<host>My Synology IP</host>
<port>3306</port>
<user>kodi</user>
<pass>password for mariadb</pass>
<name>kodi1_Video</name>
</videodatabase>
<musicdatabase>
<type>mysql</type>
<host>My synology IP</host>
<port>3306</port>
<user>kodi</user>
<pass>password for mariadb</pass>
<name>kodi1_Music</name>
</musicdatabase>
<videolibrary>
<importwatchedstate>true</importwatchedstate>
<importresumepoint>true</importresumepoint>
</videolibrary>
</advancedsettings>
Kodi v20.1,Nokia Streaming BOX 8000 & 8010 , Synology DS920+, Polestar 2. Amsterdam, Netherlands
Posts: 24
Joined: Feb 2013
Reputation:
1
TyKH
Junior Member
Posts: 24
Interesting. I'll try this tomorrow. For the time being I installed 20.5. I'll post the results.
Kodi v20.1,Nokia Streaming BOX 8000 & 8010 , Synology DS920+, Polestar 2. Amsterdam, Netherlands
Posts: 25
Joined: Aug 2008
Reputation:
0
Are there any other suggestions to fix this? I have the same problem. I tried the conversion through the windows kodi version as suggested above but that doesn't work. I run my MariaDB version 10.5.8 on the QNAP NAS I have. Problem is that it's integrated with the system and I can't upgrade to a higher version. The update command for mysql doesn't exist on the system. How can I get this database migrated in the right way?
Posts: 25
Joined: Aug 2008
Reputation:
0
Small additional test update: Tried to let my linux Kodi machine migrate the database but the exact same issue occurs with the database: No views created. In the xbmc_video121 I can browse "Tables" and "Views" thorugh phpMyAdmin but with the newly created database there is only a list of things like actor, bookmark, art etc. which normally resides under the Tables view.
Conclusion is that at least in my case it is not only Android build giving problems but also Windows and Linux builds.
Posts: 24
Joined: Feb 2013
Reputation:
1
TyKH
Junior Member
Posts: 24
Good news, the mysql upgrade was the solution!
Synology offers a terminal login for each container. I still had to find the right commands as I'm not a developer by heart. When accessing the logs I found this:
An upgrade is required on your databases. #
2024-04-28T20:14:14.106374589Z # #
2024-04-28T20:14:14.106403797Z # Stop any services that are accessing databases #
2024-04-28T20:14:14.106438946Z # in this container, and then run the command #
2024-04-28T20:14:14.106475085Z # #
2024-04-28T20:14:14.106499773Z # mariadb-upgrade -u root -p<PASSWORD> #
1. Used the mariadb-upgrade -u root -p command and then followed with the root password.
2. Upgrade was succesful, no error messages.
3. Updated Kodi. Looked liked it hanged on the Omega splash screen but after a few minutes the menu shows. I didn't see a database migration progressing message.
4. Database is all and well. Some settings were clearly reset and also all menu items were present (some of which I had hide). Videos are playing fine!
5. Updated Kodi in my bedroom, also a nokia streaming 8010. Kodi booted right up into the menu with all settings preserved, also the hid menu items.
Kodi v20.1,Nokia Streaming BOX 8000 & 8010 , Synology DS920+, Polestar 2. Amsterdam, Netherlands
Posts: 25
Joined: Aug 2008
Reputation:
0
That helped in executing the upgrade. I succeeded running mariadb-upgrade with sudo /share/CACHEDEV1_DATA/.qpkg/MariaDB10/bin/mariadb-upgrade -S /var/run/mariadb10.sock -u root -p[PASSWORD] command. Every thing went ok. I got lines like this:
xbmc_video121.tvshowlinkpath OK
xbmc_video121.uniqueid OK
When I run the command a second time it says: This installation of MariaDB is already upgraded to 10.5.8-MariaDB, use --force if you still need to run mysql_upgrade
So far so good but regretfully when I run Kodi 21 again and I get the Migration database message it still shows empty movies. The music database seems to be migrated ok beacuse I see all my music but for the movies everything is empty. Looking with phpMyAdmin to the newly created xbmc_video131 I see only the tables, no views.
So for me this didn't work. What else can I do?
Posts: 1,433
Joined: Apr 2010
Reputation:
120
CrystalP
Team-Kodi Developer
Posts: 1,433
2024-04-29, 15:01
(This post was last modified: 2024-04-29, 15:03 by CrystalP. Edited 1 time in total.)
That's progress but looks like you have multiple problems. New debug log of upgrade from 121 to 131 please. Double-check that your v20 db works fine first.
If the music db is good leave it alone.
Posts: 25
Joined: Aug 2008
Reputation:
0
2024-04-29, 15:05
(This post was last modified: 2024-04-29, 17:34 by mdvries. Edited 4 times in total.)
Thanks.
The v20.5 Kodi works fine with the xbmc_video121 database. No problem at all. I see all the movies in version 20.5 on all my systems in the house. I tried Kodi v21.0 with Android, MacOS, Windows 11 and linux and all same problem.
I found how to get Kodi debug. Result related to this I found:
---
Start of Migration
---
2024-04-29 17:15:41.593 T:331061 info <general>: Old database found - updating from version 121 to 131
2024-04-29 17:15:43.445 T:331061 debug <general>: connect replacing configured host 192.168.0.100 with resolved host 192.168.0.100
2024-04-29 17:15:43.457 T:331061 info <general>: Attempting to update the database xbmc_video131 from version 121 to 131
2024-04-29 17:15:43.457 T:331061 debug <general>: Mysql Start transaction
2024-04-29 17:15:44.861 T:331061 debug <general>: Mysql commit transaction
2024-04-29 17:15:44.863 T:331061 debug <general>: Mysql Start transaction
2024-04-29 17:15:44.863 T:331061 debug <general>: Mysql execute: CREATE TABLE videoversiontype (id INTEGER PRIMARY KEY auto_increment , name TEXT, owner INTEGER) CHARACTER SET utf8 COLLATE utf8_general_ci
2024-04-29 17:15:44.870 T:331061 debug <general>: Mysql Start transaction
2024-04-29 17:15:44.871 T:331061 debug <general>: Mysql execute: INSERT INTO videoversiontype (id, name, owner) VALUES(40400, 'Standard Edition', 0)
2024-04-29 17:15:44.871 T:331061 debug <general>: Mysql execute: INSERT INTO videoversiontype (id, name, owner) VALUES(40401, 'Extended Edition', 0)
---
Then a lot of lines follow with INSERT INTO command. Here the final few of those INSERT INTO's and the part where a exception is reported:
---
Exception part
---
2024-04-29 17:15:44.999 T:331061 debug <general>: Mysql execute: INSERT INTO videoversiontype (id, name, owner) VALUES(40799, '', 0)
2024-04-29 17:15:44.999 T:331061 debug <general>: Mysql execute: INSERT INTO videoversiontype (id, name, owner) VALUES(40800, '', 0)
2024-04-29 17:15:45.000 T:331061 debug <general>: Mysql commit transaction
2024-04-29 17:15:45.001 T:331061 debug <general>: Mysql execute: CREATE TABLE videoversion (idFile INTEGER PRIMARY KEY auto_increment , idMedia INTEGER, mediaType TEXT, itemType INTEGER, idType INTEGER) CHARACTER SET utf8 COLLATE utf8_general_ci
2024-04-29 17:15:45.009 T:331061 debug <general>: Mysql execute: INSERT INTO videoversion SELECT idFile, idMovie, 'movie', '0', '40400' FROM movie
2024-04-29 17:15:45.011 T:331061 error <general>: SQL: [xbmc_video131] Undefined MySQL error: Code (1062)
Query: INSERT INTO videoversion SELECT idFile, idMovie, 'movie', '0', '40400' FROM movie
2024-04-29 17:15:45.011 T:331061 error <general>: Exception updating database xbmc_video131 from version 121 to 131
2024-04-29 17:15:45.011 T:331061 error <general>: Error updating database xbmc_video131 from version 121 to 131
2024-04-29 17:15:45.012 T:331061 debug <general>: Mysql rollback transaction
2024-04-29 17:15:45.012 T:331061 debug <general>: connect replacing configured host 192.168.0.100 with resolved host 192.168.0.100
2024-04-29 17:15:45.019 T:331061 error <general>: Unable to open database: xbmc_video120 [1049](Unknown database 'xbmc_video120')
---
So the lines in bold indicate something goes wrong but I can't see what exactly.
So next I ran the query that failed in the Kodi log manually through phpMyAdmin and that gives a little bit more info. This is what I get back:
#1062 - Dubbele ingang '104' voor zoeksleutel 'PRIMARY'
It's in Dutch but it means "Duplicate entry '104' for key PRIMARY"
What should I do / try next?
Posts: 1,433
Joined: Apr 2010
Reputation:
120
CrystalP
Team-Kodi Developer
Posts: 1,433
So you have problem #2, multiple movies in the library for the same file in your v20 database. Somehow you ended up with multiple lines in the movie table sharing the same idFile value. That's not valid and the migration fails.
Easiest way to fix is probably a query to identify the duplicates and then with v20 use "remove from library" on one of the copies.
Alternatively, export library / remove all video database versions to start from scratch / import library should take care of it too.