Shared database issue (SMBs causing sad face) since 2016.2-1 update

Hey there, folks–

Updated both of my OSMC boxes (Pi 2 Model B) tonight and now I can’t access my SMB shares. When I try to navigate them through Files, it thinks for a second and then the machine crashes (sad face).

This is my Kodi log, let me know if you need any of the others.

Very unusual. Dozens of updates before this and no problems.

I’ve tried doing another update via SSH to see if any packages needed updating based on some of the other issues I’d read in the discussion forum with 2016.2-1, but no dice.

Fingers crossed!

20:28:23 721.222290 T:1752953840 ERROR: SQL: [MyVideos99] The table does not exist
Query: select * from movie_view ORDER BY dateAdded desc, idMovie desc LIMIT 10

Crosscheck your MYSQL databases assume that they didn’t cleanly updated to the new version

Yes, I had suspected the database… Thank you.

But shouldn’t I be able to access the share directly through Files, even if the TV Shows and Movies paths aren’t working correctly?

Edit: In fact, the SMB shares that aren’t associated with the actual scanned library are accessible… So it looks like you’re right…

My shared database is not looking great, seems there’s only one database and it’s named information_schema… I thought when I set it up all those moons ago, I had another database in there for XBMC (at the time)… But all was well (synchronized across Pi devices) until this update.

Is there a way to downgrade to the January release until I can get to the bottom of this so that the wifey can carry on using the TV in the interim?

You should actually have the old versions (lower number) and the new versions of the databases in mysql. I suggest you shutdown both mediacenters sudo systemctl stop mediacenter.
Then delete the v16 databases (e.g. MyVideos99) after you ensure you have a correct v15.2 database (e.g. MyVideos93). Details here
Then start the mediacenter on one of the boxes (sudo systemctl start mediacenter) and wait till it has upgraded the database successfully (tail -f .kodi/temp/kodi.log) before starting the second one.

Well actually reading your response again it seems you are not having any database at all so a downgrade would also not help. Only way to temporary get it working is to disable the mysql database in Kodi and it will create local databases.

The weird bit is that I had library synchronization working across both devices though–how would that have been working without the database being setup on the server, I wonder?

FTP’ing into one of the Pi devices, I see that it has a MyVideos93.db (but it hasn’t been updated since November, which might have been when I set this Pi up). Such a weird situation…

Well it’s hard to say how you lost your database. But I would like to crosscheck one point. in the log it shows an IP address of Do you really use a MYSQL server that is accessible via public IP addreess? If yes and using standard user names you should not be surprised that things can go wrong.

No, it’s a local IP.

These types of things are so annoying—potentially losing watched status :sweat:… Grumble.

So you use Public IP addresses in your LAN, not the best setup I would say.

Well if you use a MYSQL database make backups regular and especially before an upgrade. But once again a database normally doesn’t just disappear. Suggest you check your mysql logs also if you have bin-logs enabled you might can get the database back from there.

What can I say? I’m a rebel.

Okay, so with a bit more exploration, I’m seeing some weird jazz. I just navigated to /var/lib/mysql in Terminal and an ls command shows a weird list of files:

So, it looks like MyVideos99 is in there… but when I run mysql> show databases;, I only get information_schema returned. It’s very odd…

Obviously, I’m an SQL newb, so I don’t know what to make of this.

Well being a rebel and making technically illogical setups (like some other big companies have done in the past) is two different pairs of shoes.

Could it be a user permission problem? Because it can not be that you only have information_shema. You at least need a mysql database otherwise you could not login.
Try to login with the root user to validate the user permissions for your xbmc user.

Yeesh, not knowing enough about a topic is the worst. Thank you for your patience. I logged in with xbmc and noted that I did have a MyVideos99 table.

When I check for xbmc’s permissions with show grants for 'xbmc'@'%';, it returns GRANT ALL PRIVILEGES ON *.* TO 'xbmc'@'%' IDENTIFIED BY PASSWORD '*EC4.............'

So, to my newbie eyes, this looks about right.

Yes that looks right. What I would do:

  1. Check that you have the correct user/password in advancedsettings.xml
  2. Try from the OSMC command line to access the mysql database with the same user/password combination

Just odd that it worked before the update and worked enough to create the MyVideos99 database. Is it possible to drop that database and reboot the Pi to have OSMC attempt to recreate it based on the old MyVideos93 again or is that a no-go now?

I’ll go try the console option out…

Yes it is possible if you are sure the MyVideos93 is fully ok. Just you would have to delete all newly created databases not only MyVideos.
Also as I wrote earlier before deleting them shutdown all mediacenters that access them and then first start with one media center and wait for it to finish.

1 Like

check out Common Problems, method 2 here

It worked! I think, ultimately, the issue was that I updated both Pi devices simultaneously. They must have both attempted to create the new databases simultaneously or conflicted in some way and it prevented the new databases from forming correctly (theory).

Dropping MyMusic56 and MyVideos99, then launching only one of the Pi devices, I am now seeing entries in my Movies / TV Shows sections and can access the shares through my Files menu. No loss of watched status (phew)!

Apologies for the stupidity, I can only hope this helps some other schlub down the line who Googles a similar issue. Thank you again for your help, @fzinken.

Thanks for confirming, I will ask Sam to add that comment to the news thread.