MySQL briefly shutting down randomly
#1
Hey all, hoping someone might be able to help me pinpoint an error in my network here.

Lately I've noticed a video will stop playing randomly and boot me back to the files section in Kodi. I can always start the video back up but the database won't remember where I left off so it's almost as if the MySQL server just shuts down completely and restarts itself within a second, just long enough to halt playback. It's weird because it always seems to resolve itself without user correction but annoyingly stops any video I'm watching. Sometimes I can go days without it happening and when it does happen it's always random. Unsure how needed this info is but this only started happening when I installed Kodi on my Nvidia Shield and has never happened to me on a windows install.

At any rate, I captured a log a few weeks ago but nothing happened since then until last night so I figured I would post here to get some direction.

http://paste.kodi.tv/idoraqujej

It has happened on both Nvidia Sheild's so I can narrow it down to a server issue, specifically because around line 3780 is where it start's to get into the MySQL errors. Line 3838 states "ERROR: Unable to open database: MyVideos116 [2002](Can't connect to MySQL server on '192.168.2.66' (101))" so in theory I'm dealing with a database that isn't running however 5 seconds later it is up and running again. Then I see the following in the MySQL log found in /var/log/mysql/error.log

[Warning] Hostname 'osmc' does not resolve to '192.168.2.66'.
[Note] Hostname 'osmc' has the following IP addresses:
[Note]  - ::1
[Note]  - 127.0.1.1

I've looked at these errors and haven't really gotten a firm answer on the why or the how. It looks like it's a MySQL specific error also, not exactly Kodi related but since it's happening watching my library in Kodi this seems appropriate. Might be helpful to add IP listed above to the hosts file in my server system?

So if anyone can lend me a hand here so I can put a stop to this I would be quite grateful. I can update with any more needed info if I've missed anything important.
Reply
#2
2020-07-22 19:28:15.846 T:31888 NOTICE: MYSQL: Connected to version 10.1.38-MariaDB-0+deb9u1

2020-07-22 20:33:11.134 T:874 ERROR: Unable to open database: MyVideos116 [2002](Can't connect to MySQL server on '192.168.2.66' (101))


Your database server is relatively old, MariaDB 10.1 will be EOL in October this year. MariaDB 10.5.5 is the newest version at the moment.
I never experienced a disconnecting database server when using Kodi, what hardware is running your MariaDB server? Perhaps it's a hair fracture in the server's network cable?
Reply
#3
(2020-08-11, 05:29)Klojum Wrote: 2020-07-22 19:28:15.846 T:31888 NOTICE: MYSQL: Connected to version 10.1.38-MariaDB-0+deb9u1

2020-07-22 20:33:11.134 T:874 ERROR: Unable to open database: MyVideos116 [2002](Can't connect to MySQL server on '192.168.2.66' (101))


Your database server is relatively old, MariaDB 10.1 will be EOL in October this year. MariaDB 10.5.5 is the newest version at the moment.
I never experienced a disconnecting database server when using Kodi, what hardware is running your MariaDB server? Perhaps it's a hair fracture in the server's network cable?
I have it running on a raspberry pi 2. I did update mariadb a few weeks ago but I had to restore a backup for one reason or another, hopefully an update fixes it. I never considered trying a different cable, I suppose it's possible there's a hardware issue. I couldn't see anything in the log right away that would indicate exactly which software was failing.

I'll try out another cable and see what happens.
Reply
#4
Hmm.. It's not impossible, but I wouldn't recommend using an RPi running off a SDcard as a database server. The frequent writes to the Kodi video database can become a problem for a SDcard IMO. SDcards have no TRIM support AFAICT.

You could backup your current database, get another SDcard to install the latest version of Raspberry Pi OS and of MariaDB, and restore your backup. The RPi OS is usually pretty stable, so perhaps something else is cutting connections. A faulty network switch perhaps? Try a different port.
Reply

Logout Mark Read Team Forum Stats Members Help
MySQL briefly shutting down randomly0