Loading Library causes reboot (was: MySQL connection problems)

  • Hi,

    So here's a quick history. I have an Odroid C2, and have had LibreElec on it for a while now - I always run my Kodi "clients" with the library stored on a MySQL server (have multiple Kodi installs on various platforms). I'm used to problems with the remote MySQL library and so forth, used to problems with my odd hardware choices but I live for the excitement!

    The other night I launched the 'TV Show Next Aired' add-on however the system froze up. This happens, and when it does I need to yank the power - I know about the issues this could cause - and I don't mind, it doesn't take me long to restore a Kodi endpoint especially with the centralised library sitting elsewhere on the network. So, as usual I yank the power, give it a couple seconds and pop the power back in.

    It had a fit at first - the usual episode of booting all the way up, starting CEC and other add-ons, loading the library and BAM, reboot. It did this a few times, and I reluctantly thought maybe I will need to restore it again. However, by about the fourth boot up it came up and didn't restart. I took this stability to remove some new add-ons I had installed, in case they were causing the reboots. It has booted everytime without fail except for one problem that I can't put my finger on.

    It won't connect to the MySQL database. So, I turned up the "Wait for network" timer to 60 seconds (had this in the past on a RPi), but no luck.

    Checked other Kodi clients and they're connecting to the database fine. Fired up MySQL Workbench and confirmed the database connection to be sure.

    I'm not so sure what's up with it this time. I get the errors, for example;

    Code
    ERROR: Unable to open database: Main_Video107 [2003](Can't connect to MySQL server on '192.168.10.19' (101))

    But I'm not so sure I can see the reason for this in the log.

    Could it be that the network isn't coming up fast enough? The Odroid has a static IP, which is configured on the device itself so no waiting for DHCP.

    Files are there, and sources are still there and I can watch media just fine if I go via that route. FYI - media is served via SMB connection.

    I'm hoping that someone with more expertise than myself can have a peek at my log file and point me in the right direction; IjVL

    Thank you for reading my long winded post, and I appreciate all advice!

  • So, MySQL error number 101 is Network Unreachable.

    I couldn't find in those logs where it brings up the network. The network does come up - not sure if it's before or after it attempts the connection to the MySQL host.

    That might be the pointer that I need.

    Adjusting the wait timer to 60 seconds didn't seem to change the boot time at all - I assume that if the network is up, the system will launch Kodi and not wait the 60 seconds.

  • Does the DB 'Main_Video107' exist?

    Default DB name is (at least on my setup) 'MyVideos107' (defined as 'MyVideos' in 'advancedsettings.xml')

    Does the DB connect info look identical on all "clients" (check contents of 'advancedsettings.xml')?

    Code
    <videodatabase>
            <name>MyVideos</name>
            <host>192.168.xxx.yyy</host>
            <user>kodi</user>
            <pass>kodi</pass>
            <type>mysql</type>
            <port>3306</port>
    </videodatabase>
  • Thanks, vpeter.

    I ended up formatting and loading the new image on it, fresh install. This is when I noticed that the latest version is 8.1.2.

    With 8.1.2 it very rarely connected to the MySQL library and when it did it would restart within a second.

    So, I thought maybe this was a problem with 8.1.2, and somehow my original install perhaps updated without my knowledge or I'd forgotten....

    I went back to 8.0.2, as I have been running this version for some time without issues.

    On 8.0.2 it would load up the MySQL library more times than not - BUT - it would keep restarting within a second. If it booted without connecting to the library then no reboots, and everything would be stable.

    Okay - this is getting annoying - what about some other method for centralised library. This is where I installed Emby Server on FreeNAS and added the Emby for Kodi add-on, did all the library setup on Emby Server ... BUT ...

    Each time it booted, it would connect to the Emby library, go through the "Gathering Information" step. When it went to the next part, it woudl restart again almost instantly.

    So this is where I am at now. For some reason, it seems as soon as it tries to display any type of library Kodi or LibreElec crashes and restarts.

    If I don't setup any library at all, and define my SMB sources for TV etc everything is as normal.

    Not sure where to try from here apart from a new microSD card - as this is the cheapest item and often the least reliable in my experience. There's no other evidence to suggest the microSD card to be at fault, but yeah ...

    Oh yeah, it's currently rebooting too fast for me to be able to upload logs unless I can start LibreElec in some sort of "safe mode", SSH in and grab historical logs of previous reboots...

  • Different install on a different SD card didn't make any difference.

    I found a post in the OSMC forums, with someone who had a similar issue with Raspberry Pi. Turns out there was a problem with his MySQL database that affected only one device, and all other devices worked as normal.

    Going to investigate error checking the MySQL DB and Tables and perform any corrective actions as required.

    If that doesn't work, I can setup a new MySQL host and try migrating the database information (and, hopefully not any problems) over.