Problems with MySQL in VM...

Joined
Jun 24, 2017
Messages
338
So, Im only guessing at this being the right place to plop this question/problem (please move if there is a more appropriate area)...

Anyway, Im having issues witha new FreeNAS build. Im running a VM that has Ubuntu 18.04. The VM hosts my Sonarr, SABNZBd, Couchpotato and my SQL database for a few different things (the one im focusing on now is the Kodi SQL database)..

Anyway, it seems to drop the database or SQL crashes or something (im not entirely sure as Ive never tried to troubleshoot such a mix of different parts and platforms... (basic setup is that the FreeNAS itself hosts the mass storage, as well as a jail for nextcloud and the VM for SABNZBs, Sonarr and Couchpotato. There is a Raspberry Pi that runs transmission and runs through a VPN, a raspberry pi 4 that runs Libreelec to be notified when something new is added in sonarr, then updates the SQL database (this all seems to be working correctly, though its all headless so its hard to tell...

Anyway, is there a way to see if Ubuntu 18 is putting itself to sleep somehow, or if SQL is crashing? (its a pretty new issue, and have to give it some time to happen again to test on other kodi boxes on the network... so, all i can go by as of now is the primary one (technically, its a smart TV with the kodi app installed, its not a standalone box)...

Anyway, any help or pointers in the right direction would be greatly appreciated....
 

co0kiemon5t3r

Dabbler
Joined
Sep 14, 2018
Messages
10
Hi!

Some good places to start with Ubuntu would be the log files, perhaps you can find something in
/var/log/messages

the mySQL log is
/var/log/mysql.log
by default, and that may contain info as to why it crashes

How do you know it drops the DB/Crashes? what errors first?
 
Joined
Jun 24, 2017
Messages
338
Sorry for the long delay in adding information (i have to wait for it not to work to try to troubleshoot it...and its pretty inconsistent with when it wants to not work..

SO... It actually seems to be a problem with Ubuntu, not the database or MySQL... Woke up this morning, went to turn on Kodi on our main TV... hangs while loading... try on my laptop, same thing... Log on to FreeNAS, its up and running and humming along perfectly fine. Try to SSH into the VM... no go. VNC into the VM... its sitting with a bunch of stuff im not sure what it means (see attached screenshot... the first 3 sets of lines are what were there when i logged on, i hit return, it dumped out the next set off lines until the login request... At this point, Ive done nothing to the machne but log in via VNC and hit RETURN... and it works perfectly fine without further interaction...

Ive done a little research and it sounds like other people have had sort of similar issues with Ubuntu going into some kind of sleep mode... and ive tried various solutions to disable any sleep functions (there are no sleep/hibernate files in any of the standard folders, ive done:
[sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target]
... my guess is the VM is going into some kind of sleep mode or crashing in some way that causes it to wait for some attempt at entry (im not sure yet).... and Kodi is the only app that runs that is easy to check/verify if the DB/VM is running (everything else just dumps data to the database... like my thermostat just dumps temp, humidity, weather...etc, baby monitor stuff (owlette) just dumps the kids pulsox and heartrate... fancy scales just dump out weights and other biometrics it measures... but none of those things kick back errors if they cant dump data, they just wait until the database is ready then dump what they have, they never try to pull data, so no ability to tell if the database is running with anything (easily) other than kodi...

Im half tempted to wrap a bunch of the applications that the VM runs into a jail and let the jail run everything... ive not had an issue with jails at all unless I screw them up...
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
That sounds to me like a machine where the VNC is set to wait for connection before boot.

Your VM is probably crashing and not restarting since VNC has not connected yet.

First would be to see if you want to change that VNC setting.

Then you may want to look into why it's crashing.
 
Joined
Jun 24, 2017
Messages
338
That sounds to me like a machine where the VNC is set to wait for connection before boot.

Your VM is probably crashing and not restarting since VNC has not connected yet.

First would be to see if you want to change that VNC setting.

Then you may want to look into why it's crashing.

I disabled wait for VNC connection fairly early on... (specifically, "Delay VM Boot until VNC Connects" is unchecked) and logging in via VNC doesnt look like what it would if it were waiting (i think theres a 5 second delay on grub for this to boot, which, iirc, i can see when i log in via VNC)... HOWEVER, I am happy to disable and remove the VNC connection altogether as a troubleshooting step... unfortunately, it means probably waiting several hours or overnight until i encounter the problem again...

I didnt have "messages" in my log folder, however, here is syslog.1... (cropped for somewhere yesterday afternoon until this morning)...

Here is syslog (cropped):

https://pastebin.com/GpztGZF0
 
Joined
Jun 24, 2017
Messages
338
Also, here is a screenshot of the messages when I VNC into the machine...
 

Attachments

  • Capture.PNG
    Capture.PNG
    428.6 KB · Views: 265
Top