Shared Library and MySQL does not work on LibreELEC (Krypton) v7.90.008

  • Hi.
    I'm trying to have a "central" video library using MySQL, so all my Kodi devices will have the same and synchronized library.
    I followed this guide: MySQL - Official Kodi Wiki
    It's an easy setup but I was not able to get working.
    When my LibreELEC (Krypton) v7.90.008 ALPHA on Odroid C2 starts is not able to access to MySQL server (or this is the error) and it's not able to create the new Database (or this is the error).
    See here the errors on LibreELEC side:

    This is my advancedsettings.xml on LibreELEC:

    On MySQL Server side I have:

    - Raspberry Pi 2 running MySQL version 5.5.52 (Linux raspberrypi 4.4.32-v7+ #925 SMP Wed Nov 16 21:39:23 GMT 2016 armv7l GNU/Linux)
    - MySQL listening IP "bind-address" setted to 0.0.0.0 (it means all IPs)
    - The port 3306 is opened and working
    - No firewall
    - I use others applications that use (connect, query, insert, etc..) other databases/instances on the same MySQL Server
    - MySQL listen correctly on 0.0.0.0 port 3306, see here:

    Code
    root@raspberrypi:~# netstat -a | grep -i sql
    tcp        0      0 *:mysql                 *:*                     LISTEN
    tcp        0      0 localhost:mysql         localhost:50170         ESTABLISHED
    tcp        0      0 localhost:50170         localhost:mysql         ESTABLISHED
    unix  2      [ ACC ]     STREAM     LISTENING     7159     /var/run/mysqld/mysqld.sock
    unix  3      [ ]         STREAM     CONNECTED     7775     /var/run/mysqld/mysqld.sock

    I was able to connect to MySQL over network:

    MySQL "kodi" user grants are OK:

    Code
    mysql> SHOW GRANTS FOR 'kodi';
    +--------------------------------------------------------------------------------------------------------------+
    | Grants for kodi@%                                                                                            |
    +--------------------------------------------------------------------------------------------------------------+
    | GRANT ALL PRIVILEGES ON *.* TO 'kodi'@'%' IDENTIFIED BY PASSWORD '*2249595D6A53B38A77AA4AB2091D9B1A71F88735' |
    +--------------------------------------------------------------------------------------------------------------+
    1 row in set (0.00 sec)

    Then on MySQL side is all OK.

    The problem seem that LibreELEC does NOT connect to the database, I mean no MySQL ethernet traffic over the LAN from LibreELEC to MySQL Server....
    See there a "tcpdump" executed on MySQL Server (192.168.147.6) when LibreELEC boot:

    As you can see LibreELEC (IP 192.168.147.27) does NOT try to connect to MySQL Server (tcpdump shows only netbios requests), there are NOT any requests/connections to MySQL (port 3306).
    FYI, If I execute a "crude" telnet to MySQL Server on port 3306 from LibreELEC I can access to that port....

    Any ideas?
    Thanks!

    Edited once, last by outcave (December 5, 2016 at 2:17 PM).

  • There's a MySQL client in LE, can you connect to the MySQL server from the LE command line?
    [hr]
    Also, please post a complete debug log (and use a pastebin site, don't post logs to the forum).

    Edited once, last by milhouse (November 18, 2016 at 9:04 AM).


  • There's a MySQL client in LE, can you connect to the MySQL server from the LE command line?

    If you mean "mysql", I can answer NO: "mysql" command is "not found"
    sqlite3 is the only one command available that starts with "sql"

    I wll post via pastebin a full DEBUG log, but trust me, no others info on it about MySQL.

    Edited once, last by outcave (November 18, 2016 at 9:06 AM).

  • Huh? No, Kodi doesn't need the command line client - it uses a library. I only suggested the client to try and narrow down the issue. MySQL access is working fine in LE, it's in use by many other users. The problem here is almost certainly a server configuration error, no network at startup, or some other network issue. As requested, post a link to a full debug log.

  • Here the DEBUG log: NaUn8TWr


    I have the feeling that some Kodi stuff starts, in LibreELEC, before the network goes UP, see for example the row 738 and some next. The "LibreELEC Addon" fails due to a "Temporary failure in name resolution". But from the shell I can correctly resolve releases.libreelec.tv
    Also the MySQL connection is even before at row 481.. so how is it possible that it can connect to MySQL Server at that time (18:52:42) if later (at 18:52:44) cannot resolve an hostname?

    So I think that most of the Kodi staff, in LibreELEC, wrongly starts before the network goes UP (my feeling).


  • Here the DEBUG log: NaUn8TWr


    I have the feeling that some Kodi stuff starts, in LibreELEC, before the network goes UP, see for example the row 738 and some next. The "LibreELEC Addon" fails due to a "Temporary failure in name resolution". But from the shell I can correctly resolve releases.libreelec.tv
    Also the MySQL connection is even before at row 481.. so how is it possible that it can connect to MySQL Server at that time (18:52:42) if later (at 18:52:44) cannot resolve an hostname?

    So I think that most of the Kodi staff, in LibreELEC, wrongly starts before the network goes UP (my feeling).


    That would be easy to check. Just restart kodi (as opposed to rebooting) and if it's down to the network not being ready on boot all the problems will disappear.

    Edited once, last by trogggy (November 18, 2016 at 10:26 AM).

  • outcave can you post the output from "journalctl -a | pastebinit" and the corresponding kodi.log - this would allow us to see when the network is coming up, and what kodi is doing at that time. But it does appear to be a "network wait" type issue, strange it's not working...


  • So, if I understood, do you suggest to:
    1. Reboot LibreELEC
    2. Immediately after, unplug the ethernet cable
    3. See on the screen what happens to Kodi?


    No. Not at all.
    Easiest way to restart (if it's not an option in your power menu) is:
    Boot up libreelec. Make sure the network's up.
    Log in via SSH (putty if you're on windows).
    'systemctl restart kodi'
    That restarts kodi but everything else (ie network) is still running.

    But I suggest you follow millhouse's advice.

    Edited once, last by trogggy (November 18, 2016 at 10:49 AM).

  • Hello,

    Just wanted to add that I have the same issue. No MySql connection on the last libreelec version with an Amilogic box.
    A RPi3 and an intel box are connecting and working correctly to the same DB.