Kodi Community Forum

Full Version: Kodi running on Pi3 & Pi4 do not have the same view on a shared database
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello,
I have recently migrated both of my Kodi instances to Kodi 18.5 (bundled in LibreElec 9.2) and I have trouble syncing them on the same database shared on a NAS.
My Kodi installed on Raspberry 3 accesses the files on the NAS and perfectly reads my database on the NAS.
My Kodi installed on Raspberry 4 accesses the files on the NAS but does not seem to read any database. When I perform a manual library update, nothing happens and nothing shows in the logs (or maybe I don't know where to look at).
I have the exact same advancedsettings.xml file for both configurations, maybe this is the origin of the problem, but I'm not aware of any instructions to do differently.

I am no expert, but I've been running and updating this configuration for 5 years on several hardwares/kodi versions so I'm pretty sure this is not a network issue.
The only new item is the Pi4 that I've just bought to upgrade to Kodi 18.5 (I had a solidrun before that).

Would someone have any clue on how to fix this please ?

Thanks
If both are running the same major version of Kodi then there should be no difference in the database version used.

All I can think to suggest is to check that the Pi4's IP address has permission to access the NAS where the database is stored (and connections from it have access to the database itself), and that there's no firewall or similar getting in the way?

It sounds to me more like a network access permission issue than anything else, at least from what you describe.
(2020-01-05, 19:20)DarrenHill Wrote: [ -> ]If both are running the same major version of Kodi then there should be no difference in the database version used.

All I can think to suggest is to check that the Pi4's IP address has permission to access the NAS where the database is stored (and connections from it have access to the database itself), and that there's no firewall or similar getting in the way?

It sounds to me more like a network access permission issue than anything else, at least from what you describe.

Hi, thanks for your answer.
From what I know, the permissions to access kodi database are given in mysql with a login/pwd defined in advancedsettings.xml.
My kodi user for this database has all permissions with a host name value set to "%" and, since I have the exact same file, I don't know why it would not work, provided there's no requirement difference between Pi3 and Pi4

I understand the idea of the IP permission, do you have any idea how I can check this please ?
Thx
It was the fact your file is the same which makes me think that it's something at the database end, either in its config or the network access. The % I think should work, but I'm not an expert on such things. There are some notes about the set-up on the wiki (MySQL (wiki)) which may be worth referring to depending on your NAS set-up.

It's not something I personally use and haven't had such a set-up in a few years so can't remember from personal experience.

For more general network access, if there's any firewall or suchlike on the NAS then try temporarily disabling it to test.
(2020-01-05, 20:42)Pastix Wrote: [ -> ]From what I know, the permissions to access kodi database are given in mysql with a login/pwd defined in advancedsettings.xml.

Not entirely. A database user with a password is one thing, "granting" the various permissions to a database on the database server is another. Otherwise the database server still won't allow a user to do anything. Have you done the 'grant all' command, and restarted/reboot the NAS, or do a 'flush privileges' command to activate the changes in user permissions for the database user 'kodi' ? (Assuming you used the default name)

Furthermore, a debug log (wiki) of the problematic Kodi device is also welcome.
(2020-01-05, 23:21)Klojum Wrote: [ -> ]
(2020-01-05, 20:42)Pastix Wrote: [ -> ]From what I know, the permissions to access kodi database are given in mysql with a login/pwd defined in advancedsettings.xml.

Not entirely. A database user with a password is one thing, "granting" the various permissions to a database on the database server is another. Otherwise the database server still won't allow a user to do anything. Have you done the 'grant all' command, and restarted/reboot the NAS, or do a 'flush privileges' command to activate the changes in user permissions for the database user 'kodi' ? (Assuming you used the default name)

Furthermore, a debug log (wiki) of the problematic Kodi device is also welcome.      
Hi again,
thanks for looking into this.

I've granted all privileges to my "kodi" user, with no limit and then again to the specific database.
Code:
REVOKE ALL PRIVILEGES ON *.* FROM 'kodi'@'%'; GRANT ALL PRIVILEGES ON *.* TO 'kodi'@'%' REQUIRE NONE WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
It did not work.

Then I've quickly reconfigured my Kodi instance (on Pi3) from scratch and renamed previous version from DB to have a clean start.
I've also reduced the advancedsettings.xml to a minimal format to focus on video library database issue.

I added and configured a new source from my Movies folder and tried to have it added to the library, but litterally nothing happened on my screen.

I have captured all logs with an additional extended logging for databases.
https://paste.ubuntu.com/p/zKzx9PcSbj/

Thx
ERROR: Unable to open database: MyVideos116116 [2002](Can't connect to MySQL server on '192.168.86.24' (115))

Don't include version numbers to database names in the advancedsettings.xml file. Things will get quite confusing that way. Kodi adds them by default.
The complex grant command is probably unnecessary as well. Which SQL server is running on your NAS?
Error 2002 suggests that the mysql server is misconfigured.
Quote:The error means the file /var/run/mysqld/mysqld. sock doesn't exists, if you didn't install mysql-server , then the file would not exist. But if the mysql-server is already installed and is running, then you need to check the config files.
(2020-01-06, 01:50)Klojum Wrote: [ -> ]Don't include version numbers to database names in the advancedsettings.xml file. Things will get quite confusing that way. Kodi adds them by default.
Ok thanks, I'll rename it.

(2020-01-06, 01:50)Klojum Wrote: [ -> ]The complex grant command is probably unnecessary as well.
I've done this through phpmyadmin, so this is probably not the most elegant php ever Wink

(2020-01-06, 01:50)Klojum Wrote: [ -> ]Which SQL server is running on your NAS?
MariaDB10.

(2020-01-06, 01:50)Klojum Wrote: [ -> ]Error 2002 suggests that the mysql server is misconfigured.
I can't ssh my NAS right now but I will check the file location and/or the config file tomorrow and let you know.

Thanks a lot
(2020-01-06, 01:50)Klojum Wrote: [ -> ]Error 2002 suggests that the mysql server is misconfigured.
Quote:The error means the file /var/run/mysqld/mysqld. sock doesn't exists, if you didn't install mysql-server , then the file would not exist. But if the mysql-server is already installed and is running, then you need to check the config files.
Hi again,
I checked on my NAS and the mysqld10.sock file does exist in the expected mysqld folder, along with a mysqld10.pid file.
What should I check in the config files ?
I use mysql and mariaDB10 for this purpose only so I don't mind doing a clean reinstall if needed.
Hi again,
I *may* have fixed the problem by uninstalling/reinstalling MariaDB10.
I was surprised that MariaDB10 asked me to enter a password, so I chose the same pwd (just in case...) as for my kodi user with all priviledges granted and it seems to work.
Thanks for pointing me the DB issue !
Thread marked solved.
(2020-01-06, 22:05)Klojum Wrote: [ -> ]Thread marked solved.
Hi again, unfortunately not really... I am actually back to square 1...

So I made a clean reinstall of MariaDB10 with a new kodi user.
I launched a library update from the Pi3 and it worked, so I thought it was OK. logs here with an interesting mysql 1049 error
And then I tried to connect from the Pi4 and it did not work, always with this mysql 2002 error "can't connect to the database".

OK so I did the same clean reinstall and initiated the library update from the Pi4... but it did not work : logs here
I see no 2002 error, probably because the base is empty.
But I see also no 1049 error, so I don't understand why it would not behave like the Pi3...
"GetResumeItemOffset - Cannot open VideoDatabase" is certainly an interesting error, but I don't know what to do with it...


Just to say, that I had also tried to play on the IP addresses but no luck.
I gave the Pi3 a new IP address and it was able to connect to the library.
And then I gave the Pi4 the previous IP of the Pi3 and the Pi4 was still NOT able to connect.

It really seems like the Pi3 and Pi4 have different behaviors (this is why I posted here in the first place) but it does not make much sense in theory...
Is this possible that the Pi4 hardware needs some kind of key or hardware permission to access the library that the Pi3 does not need ?!
I got it finally working.
I wanted to check from my Pi4 if I had the same issue with a music database, so I went to create a new source. As soon as I clicked on Music in the main menu, the Pi4 rebooted.
And after the restart, I had access to the shared video library. Smoothly synchronizing with the Pi3.
So everything is running just fine now, but I'm not sure that I would be able to reproduce the solution Rofl

Thanks for bearing with me Angel
(2020-01-07, 00:32)Pastix Wrote: [ -> ]As soon as I clicked on Music in the main menu, the Pi4 rebooted.
That is not supposed to happen...

(2020-01-06, 23:54)Pastix Wrote: [ -> ]Is this possible that the Pi4 hardware needs some kind of key or hardware permission to access the library that the Pi3 does not need ?!
Nope. But Kodi stores full paths into its databases, including the IP numbers and host names. Any deviation from that, and files will not be available anymore.
Thread marked solved.
Pages: 1 2