Kodi Community Forum
Solved Library won't show after MariaDB crash and rebuild - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228)
+---- Thread: Solved Library won't show after MariaDB crash and rebuild (/showthread.php?tid=358904)



Library won't show after MariaDB crash and rebuild - koldso - 2020-12-04

Dear kodi / mariadb experts

I browsed for answers to my predicament - no luck.
I need your help.

Prequel:
I am kodi user for two years (my setup: two rpi boxes for tvs, mac os for scanning etc, android phones for the move),
I ran happily with a MariaDB (mysql) on central server.

Breakdown:
Disk on server broke down.
Did not backup library nor DB  Confused

DB reinstallation and scrape
I did a clean reinstall of MariaDB on server.
I updated kodi to 18,.9 on Mac.
I did a one-hour scrape / scan from on Mac-kodi (kodi seemed to progress normally).
After scan I saw this on server (from mariaDB shell):
   MariaDB [(none)]> SHOW DATABASES;
   +--------------------+
   | Database           |
   +--------------------+
   | MyMusic72          |
   | MyVideos116        | 
< This one appeared after kodi scan
   | information_schema |
   | mysql              |
   | performance_schema |
   | test               |
   +--------------------+
   6 rows in set (0.001 sec)

   MariaDB [(none)]> select count(*) from MyVideos116.movie;
   +----------+
   | count(*) |
   +----------+
   |      297 |
   +----------+
   1 row in set (0.000 sec)


Problem
I have next-to-no knowledge of MariaDB, but I figure from above, that kodi scan did populate DB with movie meta data.
However, when I enter kodi library I only see an empty movies (Film in danish) section, cf screendump below:
Image
(I changed the Categories icons).
Normally this screen is filled with movies.
I see the same empty screen, when I enter a category.
I see the same empty screen, if I enter kodi (18.2) on a rpi.

I hope I have made a trivial error somewhere  Rolleyes

Questions
  1. Do I need to supply more info... maybe do a fresh rescan while doing a kodi log file?
  2. Any suggestions for fixing or analysing this problem?
Thanx
-Niels


RE: Library won't show after MariaDB crash and rebuild - Klojum - 2020-12-04

(2020-12-04, 01:37)koldso Wrote: Did not backup library nor DB

Backups, ah yes... That word that everyone is so afraid of. With the proper tool or script, a backup of your MySQL/MariaDB can be done in under a minute. Really.
An alternate type of backup for Kodi is doing a weekly/monthly Video Export Library (separate files recommended), where there will be .nfo files created along your video files with all the metadata, and watched status and resume points optionally. Also fanart can be stored.

Any crashed database cannot be trusted anymore. So you'll need to take the long way home and rescrape your full media collection from the start.

(2020-12-04, 01:37)koldso Wrote: However, when I enter kodi library I only see an empty movies (Film in danish) section

There are videos in the movie table, but that doesn't mean the rest of the data in the relational database is okay.

We will need Kodi's debug log (wiki) for starters, in order to see what is happening under water.
Enable debugging, enable the Database component in debugging, restart Kodi, and run it. Then provide the log file via paste link below.


RE: Library won't show after MariaDB crash and rebuild - koldso - 2020-12-04

Dear @Klojum

Thank you for a very quick reply.

This is requested log.

I did:
  1. Drop database MyVideos116
  2. Enter kodi
    • ​​​​​​​restore movie-source (it was apparently destroyed by step 1)
    • enable logging as per request
    • exit kodi
  3. Notice: MyVideos116 recreated and table MyVideos116.movie contains 0 records.
  4. Enter kodi
    • a movie library rescan (movie folder only contains one movie, namely snemanden)
    • exit kodi
  5. Notice
    • table MyVideos116.movie contains 1 record
    • still, not able to view anything in kodi library

With respect to backup: yes, nød lærer nøgen kvinde at spinde, ie. I will learn to do a backup and restore (any links appreciated).


​​​​​​​Thanx again !!


RE: Library won't show after MariaDB crash and rebuild - Klojum - 2020-12-04

020-12-04 10:54:50.778 T:4862090752 ERROR: SQL: [MyMusic72] The table does not exist
Query: select count(idSong) as NumSongs from songview


Check your database user right for the user 'kodi'. Normal rights may be there, but views (and perhaps triggers) may not have been created.


RE: Library won't show after MariaDB crash and rebuild - koldso - 2020-12-04

Thanx @Klojum!  Impresseive response times  Cool

I am not at all familiar with MariaDB, so I am not sure I did what you asked.

I ran the following:
   MariaDB [(none)]> show grants for kodi;
   +--------------------------------------------------------------------------------------------------------------+
   | Grants for kodi@%                                                                                            |
   +--------------------------------------------------------------------------------------------------------------+
   | GRANT ALL PRIVILEGES ON *.* TO 'kodi'@'%' IDENTIFIED BY PASSWORD '*2249595D6A53B38A77AA4AB2091D9B1A71F88735' |
   +--------------------------------------------------------------------------------------------------------------+

Does it help?

I am not sure
  • what "normal rights" are.
  • how to check for views and triggers.
If you have a link to "some checklist" I can follow in order to check kodi mairaDB, I think I will be able to comply.


RE: Library won't show after MariaDB crash and rebuild - jmgibson1981 - 2020-12-06

https://github.com/jmgibson1981/scripts/blob/main/sources/backups.sh.source

This link to my git contains my current sql backup function. It's for linux. You would need to find a method / script that fits the server os though.


RE: Library won't show after MariaDB crash and rebuild - koldso - 2020-12-06

(2020-12-06, 17:25)jmgibson1981 Wrote: https://github.com/jmgibson1981/scripts/blob/main/sources/backups.sh.source

This link to my git contains my current sql backup function. It's for linux. You would need to find a method / script that fits the server os though.
Thanx @jmgibson1981  Blush
Should fit my un*x-setup Nod ... once I get the DB / kodi working again (it is a struggle).


RE: Library won't show after MariaDB crash and rebuild - koldso - 2020-12-06

Fixed

I did
  • @DB server (linux): drop database MyVideos116; (run from mariadb shell)
  • @ kodi machine (mac):
    • removed Kodi-folder (ie./Users/<my-name>/Library/Application Support/Kodi)
    • opened and exited kodi, this created a virgin Kodi-folder
    • copied old advancedsettings.xml to /Users/<my-name>/Library/Application Support/Kodi/userdata
      • opened kodi
      • sat up new movie source, this created within ...userdata/sources.xml:f 
        • <source>
              <name>movies</name>
              <path pathversion="1">smb://192.168.1.1/monster/flix/movies/</path>
              <allowsharing>true</allowsharing>swere
          </source>

      • I answered "yes" to "Do you want to refresh information for all items within this path?"
      • Scanning ran and voila succes - I see movies in library  Laugh
Fix resume: Start from scratch by deleting DB and Kodi-folder.

Now I have some configuration to do and then a back up routine  Devil
Thanx again to @jmgibson1981 and @Klojum and bye for now.


Library won't show after MariaDB crash and rebuild - Klojum - 2020-12-07

Thread marked solved.