At startup library is not found - after crash, it is found


I have several 4k+ devices and all experience the same issue. I have a windows machine with KODI and this doesn’t have the issue at all.

I have a QNAP NAS setup with mysql database.
When i startup the 4k+ the library can’t be found and i see none of the movies in the library.

If i click on “Enter Files Section” and navigate to the NAS to play a movie the 4k+ crashes

After the crash, the library is found and the movies appear.

This happens each time i reboot any of my 4K+ devices.

Here is my pastelog :

Any help here would be appreciated


Did you enable “wait for network” under MyOSMC -> Network -> Wired/Wireless?

It was enabled - i just turned it off and the same result.

The boot time is now really long - about 5 mins even with this setting off.

It surely should be on not off if your media is on a network drive.
Suggest to put it on “on” and do he restarts and if issue remains upload logs again.
Is your Windows PC also using the MYSQL database?

Unable to open database: MyNewVideos119 [2002](Can't connect to MySQL server on '' (115))

It was on and is on for all my devices… I just tried turning it off to see if there was any difference.
The logs above are with the wait for network setting on

Yes, the windows PC is connecting to the same mysql database

Well then you need to find out why Kodi can not upgrade the Database.
Maybe permission problem?

2023-01-15 09:03:45.663 T:3118    ERROR <general>: Unable to open database: MyNewVideos119 [2002](Can't connect to MySQL server on '' (115))
2023-01-15 09:03:45.671 T:3118     INFO <general>: MYSQL: Connected to version 5.5.57-MariaDB
2023-01-15 09:03:45.687 T:3118    ERROR <general>: Unable to open database: MyNewVideos118 [1049](Unknown database 'MyNewVideos118')
2023-01-15 09:03:45.702 T:3118    ERROR <general>: Unable to open database: MyNewVideos117 [1049](Unknown database 'MyNewVideos117')
2023-01-15 09:03:45.717 T:3118     INFO <general>: Old database found - updating from version 116 to 119
2023-01-15 09:03:45.905 T:3118    ERROR <general>: SQL: Can't create database for copy: 'MyNewVideos116' (1007)
2023-01-15 09:03:45.908 T:3118    ERROR <general>: Unable to copy old database MyNewVideos116 to new version MyNewVideos119

The strange this is - that i f i play a video navigating to files - the 4k+ crashes.
After the crash, the DB is found and the libnrary woirks again?

OK - ill try looking into this on the QNAP

Seems your database has not been updated when you upgraded Kodi from v18 to v19. Is the Windows PC using v19? Important is to issue the upgrade of database on one device first before you start other clients.

The windows kodi is on 19.1 and 4k+ are on 19.4

Strange, both 19.1 and 19.4 should use version 119.
Maybe want to check the Windows Kodi logs what it says about the database.

On the windows log

2023-01-15 10:05:26.839 T:13632 INFO : MYSQL: Connected to version 5.5.57-MariaDB
2023-01-15 10:05:26.844 T:13632 INFO : Running database version MyNewVideos119

I check the permissions for my two databases MyNewVideos116 and MyNewVideos119 and they are the same

The pastelog only capturees up to the crash when trying to play a video after navigating to the NAS through files.

If i look on linux for the 4k+ then i see the logs after the crash and the 4k+ connects correectly to the database

2023-01-15 10:30:54.189 T:3417 INFO : WaitForNet: Waiting for a network interface to come up (Timeout: 1 s)
2023-01-15 10:30:54.190 T:3417 INFO : WaitForNet: A network interface is up after waiting 0 ms
2023-01-15 10:30:54.192 T:3438 INFO : Running database version Addons33
2023-01-15 10:30:54.193 T:3438 INFO : Running database version ViewModes6
2023-01-15 10:30:54.195 T:3438 INFO : Running database version Textures13
2023-01-15 10:30:54.200 T:3438 INFO : Running database version MyMusic82
2023-01-15 10:30:54.205 T:3438 INFO : MYSQL: Connected to version 5.5.57-MariaDB
2023-01-15 10:30:54.217 T:3438 INFO : Running database version MyNewVideos119
2023-01-15 10:30:54.219 T:3438 INFO : Running database version TV38
2023-01-15 10:30:54.221 T:3438 INFO : Running database version Epg13
2023-01-15 10:30:54.221 T:3417 INFO : start dvd mediatype detection

You might try turning on settings>profiles>show logon screen since Kodi will not try loading the database until after a profile is selected and this may give it a bit more time for the network to come up. Also if you have the option to update your NAS to a newer Mariadb version I would recommend trying that as well.

The NAS is constantly on and up. Works right away in windows machine and works right after the crash in 4k+

It seems the 4k+ wants to create the new 19 database, but it’s already there so fails?

Can I adjust a setting to it doesn’t try to create it?

This is what it looks like to me

Not that I’m aware of. Kodi goes looking for the current versions of the databases and if it doesn’t find them it goes looking for older versions that it can upgrade. I was wondering if Kodi just needed a bit of a delay before it tried connecting to the database since it finds the older one after trying the current version, but we know the current version works outside of the initial boot. By turning on the logon screen this will bring Kodi up but it won’t try to connect to MySQL until after you click on the profile which essentially adds this delay.

Hi - so i tried to enable profile as mentioned above. but i get the same issues.

loads up without the movies library loaded, navigate to files>movie and try to play, it crashes and then load the movie library from database

I have also tried a full reset from usb of the 4K+

are there any other options?

You could try rebooting all your network equipment including any network bridges if your using them. You could try MariaDB 10 instead of the 5.5 your running now. If you look on the Kodi forum for QNAP and MySQL you should find some recommendations on edits to the database configuration file. And lastly (even though this is unlikely to make a difference if the database is working correctly after it actually loads) you could try removing the name tag in your advancedsettings.xml so it makes a clean database and see if the issue persists then.

OK so i have re-built a new MariaDB SQL database from scratch. This is now a new v10 DB.

I have the same issue where at startup i get the error that it can’t open the database, so no movies are shown in my library.
Then oif i go into files and try to play something it crashes.
Then when it comes back from the crash, the database is found and everything works perfectly.

I’m at a loss but if you have not tried it yet you might try adjusting settings>system>power saving>maximum wait time> as I believe that one works a bit different than the option in My OSMC. There is also an option in that same screen for enabling WOL which may be worth a shot as well.