Solved SQL Movie Database Missing
#1
I'm stumped and looking for suggestions.

Platform: Leia (v18) running on Ubuntu 16.04.5 LTS (server edition)

I'm running a headless Ubuntu server (Linux) as a dedicated Kodi box. My issue is the movie database is missing. I have a separate media server that contains shared Kodi databases. The music database works just fine (MyMusic72). Per the Kodi Wiki, I should have a movie database named MyVideos116, but it does not exist.

I checked the local Kodi box SQL databases, and it's not there either.

I checked the AdavancedSettings XML file. It contains the appropriate XML. Partial excerpt (xxx's are a real IP; removed for posting here):

xml:
<advancedsettings>
  <moviedatabase>
    <type>mysql</type>
    <host>xxx.xxx.xxx.xxx</host>
    <port>3306</port>
    <user>username</user>
    <pass>password</pass>
  </moviedatabase>

  <musicdatabase>
    <type>mysql</type>
    <host>xxx.xxx.xxx.xxx</host>
    <port>3306</port>
    <user>username</user>
    <pass>password</pass>
  </musicdatabase>

The music database works perfectly.

Has the <moviedatabase> XML key changed names in Leia (v18)Huh

How can I have an invisible movie database? Is it possible Kodi is rebuilding my movie database into memory every time it boots? That seems unlikely to me, but I'm stumped. This seems bizarre to me. Hopefully, I am missing a simple explanation.
Headless Linux Kodi box [Ubuntu 16.04.6 LTS Server] | Dedicated Media Server [Ubuntu 16.04.6 LTS Server]
Reply
#2
Bit more info... removed movie source, restarted server, re-added movie content from media server.

Partial log indicating movie database is there:

Code:
2019-03-24 12:13:35.827 T:139835909691136  NOTICE: Running database version MyMusic72
2019-03-24 12:13:35.829 T:139835909691136  NOTICE: Running database version MyVideos116
2019-03-24 12:13:35.829 T:139835909691136  NOTICE: Running database version TV32
2019-03-24 12:13:35.830 T:139835909691136  NOTICE: Running database version Epg12

However, when I check PHPmyadmin and/or login to MySQL from terminal, the only database I see is MyMusic72

The Kodi box shows these databases:

sql:
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)

And the media server:

sql:

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| MyMusic72          |
| mysql              |
| performance_schema |
| phpmyadmin         |
| sys                |
+--------------------+
6 rows in set (0.00 sec)
Headless Linux Kodi box [Ubuntu 16.04.6 LTS Server] | Dedicated Media Server [Ubuntu 16.04.6 LTS Server]
Reply
#3
(2019-03-24, 19:22)HTGeek Wrote: Partial log indicating movie database is there:
Partial logs tend to say squat when it comes to trouble shooting. Always provide the full debug log (wiki), not just the parts that look interesting.
Reply
#4
I don't seem to have an option to edit these posts... so, here's additional data... again in a separate post... not very efficient but seems to be only way I can do it. Sad

Contents of /var/lib/kodi/.kodi/userdata is

Code:
Addons27.db  CDDB  Epg12.db  MyMusic72.db  MyVideos116.db  Textures13.db  TV32.db  ViewModes6.db

So, it appears Kodi is creating local databases, contrary to what I'd expect based on my AdvancedSettings.xml settings.
Headless Linux Kodi box [Ubuntu 16.04.6 LTS Server] | Dedicated Media Server [Ubuntu 16.04.6 LTS Server]
Reply
#5
(2019-03-24, 19:31)Klojum Wrote:
(2019-03-24, 19:22)HTGeek Wrote: Partial log indicating movie database is there:
Partial logs tend to say squat when it comes to trouble shooting. Always provide the full debug log (wiki), not just the parts that look interesting.     
There is a whole lot of irrelevant info in the log, but I understand your point (e.g. I may have missed something important when I scanned it). In general, I prefer to avoid posting entire logs in public forums, but here you go. Only PII has been redacted.

Incidentally, could there be a bug with regards to Kodi masking the MySQL password embedded in the AdvancedSettings.xml file when it is mirrored in the log during load? I noticed in my log (details redacted for obvious reasons), the password for the user is in plain text for the <moviedatabase> tag, yet it was redacted and replaced with ***** under <musicdatabase>.

The log indicates the Advanced Settings file is being loaded, and the version in the log looks correct.
Headless Linux Kodi box [Ubuntu 16.04.6 LTS Server] | Dedicated Media Server [Ubuntu 16.04.6 LTS Server]
Reply
#6
Credentials for both movie and music SQL databases haven been obscured in the kodi.log for a couple of years now, also in other logs on this forum I haven't seen any passwords lately in that section. It would be odd if your log suddenly did show user credentials.

One more try for a proper kodi.log ... This time, please enable debugging and activate the Database component in the debugging section in the Kodi GUI for full info. Then restart Kodi for a clean log (do no disable debugging). Open your movie section and play one of the videos for a few seconds.. Aftwards, link the new kodi.log upload.

Kodi does say it has connected: MYSQL: Connected to version 5.7.25-0ubuntu0.16.04.2, but I see no activity for loading the home screen thumbs for example.

BTW, obscuring a local ip address is a little bit over the top, don't you think? Wink
Reply
#7
(2019-03-24, 20:27)Klojum Wrote: Credentials for both movie and music SQL databases haven been obscured in the kodi.log for a couple of years now, also in other logs on this forum I haven't seen any passwords lately in that section. It would be odd if your log suddenly did show user credentials.
Yes, I was a bit surprised to find that occurrence, albeit inadvertently. I rebooted the server. It still occurs. Only for the first entry. FWIW, when I created the file, I typed the first entry and then copy/pasted to the 2nd entry in the file, so the text is uniform on both lines.

Below is the log excerpt for this particular discussion point.

Code:
2019-03-24 13:43:33.317 T:139658705398080  NOTICE: Contents of special://profile/advancedsettings.xml are...
                                            <advancedsettings>
                                              <moviedatabase>
                                                <type>mysql</type>
                                                <host>192.1.1.1</host>
                                                <port>3306</port>
                                                <user>username</user>
                                                <pass>password</pass>
                                              </moviedatabase>
                                              <musicdatabase>
                                                <type>mysql</type>
                                                <host>192.1.1.1</host>
                                                <port>3306</port>
                                                <user>username</user>
                                                <pass>*****</pass>
                                              </musicdatabase>
                                              <videolibrary>
                                                <importwatchedstate>true</importwatchedstate>
                                                <importresumepoint>true</importresumepoint>
                                              </videolibrary>
                                              <services>
                                                <esallinterfaces>true</esallinterfaces>
                                                <webserver>true</webserver>
                                                <zeroconf>true</zeroconf>
                                              </services>
                                            </advancedsettings>
 
(2019-03-24, 20:27)Klojum Wrote: One more try for a proper kodi.log ... This time, please enable debugging and activate the Database component in the debugging section in the Kodi GUI for full info. Then restart Kodi for a clean log (do no disable debugging). Open your movie section and play one of the videos for a few seconds.. Aftwards, link the new kodi.log upload.

Here's the full debug log with your requested details - before playing a movie.

And then the same session logged after another log after playing a movie for a few seconds.
 
(2019-03-24, 20:27)Klojum Wrote: Kodi does say it has connected: MYSQL: Connected to version 5.7.25-0ubuntu0.16.04.2, but I see no activity for loading the home screen thumbs for example.

BTW, obscuring a local ip address is a little bit over the top, don't you think? Wink

It's a habit. Some die hard, such as those learned working in OpsSec. LoL.
Headless Linux Kodi box [Ubuntu 16.04.6 LTS Server] | Dedicated Media Server [Ubuntu 16.04.6 LTS Server]
Reply
#8
FWIW, I decided to try an experiment. I made a backup image of the htpc. I then stopped the Kodi process and deleted the database files in /var/lib/kodi/.kodi/userdata/Database, and rebooted. I wanted to see what would happen if Kodi was forced to re-create the databases or fail.

The Database dir looked like this beforehand:
Code:

root@htpc:/var/lib/kodi/.kodi/userdata/Database# ls -l
total 13516
-rw-r--r-- 1 kodi kodi 1249280 Mar 24 14:32 Addons27.db
drwxr-xr-x 2 kodi kodi    4096 Mar 10 16:51 CDDB
-rw-r--r-- 1 kodi kodi   28672 Mar 10 16:51 Epg12.db
-rw-r--r-- 1 kodi kodi  217088 Mar 10 16:51 MyMusic72.db
-rw-r--r-- 1 kodi kodi 9052160 Mar 24 13:53 MyVideos116.db
-rw-r--r-- 1 kodi kodi 3219456 Mar 24 13:51 Textures13.db
-rw-r--r-- 1 kodi kodi   40960 Mar 10 16:51 TV32.db
-rw-r--r-- 1 kodi kodi   20480 Mar 10 16:51 ViewModes6.db

I left the CDDB sub-dir intact.

I don't understand why there is a local copy of the MyMusic72.db and a copy on the media server (pointed to by AdvancedSettings.xml file), and none of the other db's exist on the media server. Furthermore, none of them exist to the knowledge of MySQL running on the Kodi box; i.e.,
sql:
show databases
doesn't display any of them.

Results: The MyMusic72.db file was not re-created, but all the others were. My music collection is intact. The movies are missing, as expected. That reinforces the notion the movies database wasn't being saved remotely onto the media server as it should have been.

Code:
root@htpc:/var/lib/kodi/.kodi/userdata/Database# ls -l
total 1716
-rw-r--r-- 1 kodi kodi 1249280 Mar 24 14:45 Addons27.db
drwxr-xr-x 2 kodi kodi    4096 Mar 10 16:51 CDDB
-rw-r--r-- 1 kodi kodi   28672 Mar 24 14:45 Epg12.db
-rw-r--r-- 1 kodi kodi  376832 Mar 24 14:45 MyVideos116.db
-rw-r--r-- 1 kodi kodi   36864 Mar 24 14:45 Textures13.db
-rw-r--r-- 1 kodi kodi   40960 Mar 24 14:45 TV32.db
-rw-r--r-- 1 kodi kodi   20480 Mar 24 14:45 ViewModes6.db
Headless Linux Kodi box [Ubuntu 16.04.6 LTS Server] | Dedicated Media Server [Ubuntu 16.04.6 LTS Server]
Reply
#9
Inappropriate XML, the tag name is "videodatabase". No, this hasn't changed recently.
Reply
#10
(2019-03-24, 22:06)rmrector Wrote: Inappropriate XML, the tag name is "videodatabase". No, this hasn't changed recently.
 THANK YOU! Not sure where I derived the incorrect tag from, but thanks very much for identifying the culprit. Glad to know it was a simple syntax error.

Thanks to @Klojum as well for responding. Smile
Headless Linux Kodi box [Ubuntu 16.04.6 LTS Server] | Dedicated Media Server [Ubuntu 16.04.6 LTS Server]
Reply
#11
Well, I can only hope that you do double-check the correct server with the correct IP address (and not 192.1.1.1), as the kodi.log again confirm a MySQL connection, and no problems with queries.

Normally, the local SQLite versions of the Kodi databases should not be created when the MySQL connection is there. But perhaps that changed with Leia.

(2019-03-24, 21:56)HTGeek Wrote: Furthermore, none of them exist to the knowledge of MySQL running on the Kodi box

Unless you are connecting to the wrong MySQL database, they should both be there. (don't forget the ; at the end of a query)
sql:
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| MyMusic72 |
| MyVideos116 |
| mysql |
| performance_schema |
+--------------------+
5 rows in set (0.00 sec)
mysql>
Reply
#12
(2019-03-24, 22:37)Klojum Wrote: Well, I can only hope that you do double-check the correct server with the correct IP address (and not 192.1.1.1), as the kodi.log again confirm a MySQL connection, and no problems with queries.

Normally, the local SQLite versions of the Kodi databases should not be created when the MySQL connection is there. But perhaps that changed with Leia.
(2019-03-24, 21:56)HTGeek Wrote: Furthermore, none of them exist to the knowledge of MySQL running on the Kodi box

Unless you are connecting to the wrong MySQL database, they should both be there. (don't forget the ; at the end of a query)
sql:
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| MyMusic72 |
| MyVideos116 |
| mysql |
| performance_schema |
+--------------------+
5 rows in set (0.00 sec)
mysql>
 

Yes, of course. Smile  Forgot the ';' in my post and could not edit it. Though now, mysteriously the "edit" button has appeared.... (finally)

I started wondering if the problem could be on the media server end, such as a permissions issue (though Kodi connects just fine to the music db), and I was just investigating the media server's SQL logs when @rmrector posted. Now, after restoring the original image to disk, clearing the db's, rebooting, resetting NFS shares, stop Kodi process, wipe local database files I don't want, reboot, and checking MySQL on the media server.... I can now finally see the video db has been created by Kodi, music db re-populated from media server, and video db looks correct (also now only on the media server).

Now on the Kodi box in /.../.kodi/userdata/Database dir I have what I'd expect, which is:

Code:
total 4472
-rw-r--r-- 1 kodi kodi 1249280 Mar 24 15:52 Addons27.db
drwxr-xr-x 2 kodi kodi    4096 Mar 10 16:51 CDDB
-rw-r--r-- 1 kodi kodi   28672 Mar 10 16:51 Epg12.db
-rw-r--r-- 1 kodi kodi 3231744 Mar 24 16:02 Textures13.db
-rw-r--r-- 1 kodi kodi   40960 Mar 10 16:51 TV32.db
-rw-r--r-- 1 kodi kodi   20480 Mar 10 16:51 ViewModes6.db

Thanks again. Smile
Headless Linux Kodi box [Ubuntu 16.04.6 LTS Server] | Dedicated Media Server [Ubuntu 16.04.6 LTS Server]
Reply
#13
Thread marked solved.
Reply

Logout Mark Read Team Forum Stats Members Help
SQL Movie Database Missing0