MySQL Access Problem

On the command-line of your NAS.

root@terminus:~# journalctl -f
-- Logs begin at Thu 2024-06-13 12:55:30 CEST. --
Oct 08 11:54:46 terminus.solsys.org pdns_server-lan[4111305]: WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.
Oct 08 11:55:01 terminus.solsys.org CRON[668896]: pam_unix(cron:session): session opened for user root by (uid=0)
Oct 08 11:55:01 terminus.solsys.org CRON[668898]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Oct 08 11:55:01 terminus.solsys.org CRON[668897]: pam_unix(cron:session): session opened for user root by (uid=0)
Oct 08 11:55:01 terminus.solsys.org CRON[668900]: (root) CMD (   /usr/local/bin/fail2ban_check.sh)

If you’re not root, prepend a sudo.
PS: My NAS doesn´t count. It is self built :wink:

So i tried two other things.

  1. Changed the PW for Kodi, cause if i checked it i got the error messages that it is not strong enough.
  2. I restart my NAS

But the problem is the same. Now i will try the journalctl -f

I restart the DB migration and entered your command into the command-line of my Synology NAS.
And i got no information.

I think i do something wrong.

protokoll

Looks like your Database server is always stopping when you stop your phpmyadmin session.
How have you configured your database server? Is it running as a docker image?

@fzinken
No it´s directly on my Synology NAS with MariaDB10 and PHP MyAdmin installed on it.

Saw that too. But as @Shawn2018_1 is using wakeonlan, I suspect the NAS goes to sleep, and before doing that, stops the DB service, and when emerging from sleep, starts it again.
Somehow, I have a vague impression it won’t write the data from Ram to Disk - especially the part linked to the last changes/Video stuff.

@Shawn2018_1 Check where the log files are (/var/log) and see which has changed last.
ls -lrt should show you that. Eventually there is more information in there.

I admit it’s the first time I see such “Rebellious” behavior .

@Smurphy
@fzinken

I didnt find anything in the folder that can give me a hint to the problem.
What do you think. Should i delete all the databases “MyVideos121” & “MyVideos131” and start a new clean database?

If the current database is not storing the latest run, I doubt it will with the new one. But you can test.
Stop media-center, Just rename the databases (both, odl and new) so there is no database to migrate. It will create a new one. Then run a Video scan, wait until finished and restart the devices doing the same as the system does at night.

Well if you do a NAS reboot and MyVideos131 is correctly existing then I would not drop it.
For me your issue is still related to the fact that your database server goes to sleep and the wakeonlan not being fast enough and Kodi therefore not finding MyVideos131 and starting from scratch with the migration which is not possible as MyVideos131 already exists

@fzinken
@Smurphy

So I’ll try to explain it again in detail.
I currently have “MyVideos121” and “MyVideos131” in my database. The NAS has not been restarted (the last restart was 2 days ago).
If I now delete the “MyVideos131” DB and restart my Vero4k(OSMC), a DB migration is carried out, followed by a scan for new films and series.
If I then want to watch a film or series, it works without any problems.
If I wait a few minutes and try to play a film or series again, I get a “sad face”.
That would suggest that some kind of sleep mode is starting here and preventing the database (MariaDB/MySQL) from being read.
If I then restart the Vero4K/OSMC, it no longer shows me any images of films or series.
Instead, I get a display like a newly installed system without an existing database.
I have to keep mentioning that I haven’t changed anything.

Yes but your database goes to sleep and wakeonlan is not working. So for the time being I can only recommend to avoid that your database goes to sleep

Yep. I don’t use wakeonlan as my server is up all the time anyway (Mail, DNS, Web etc.) so preobably the reason I didn’t experience that.

Thing is, the vero 4 wakes up first, then send the wakeonlan request to the NAS which then “emerges”. In the meantime, the Vero has started operation and expects the database to be there before the mysqldb is there and does not find it responsive.

One last test you can do. When the vero is asleep, and the NAS is asleep: Wake the NAS and make sure the DB is available. Then, and only then, wake up the vero.

But that’s exactly the point. If the DB goes into hibernation, then it did so at the time when everything was still working.
And I checked and the hard drives and the NAS deactivated hibernation.

I’ll check again if the DB has such a setting

How can I make sure that the DB is active? How can I tell? Is it enough if I log into the DB with phpMyAdmin?

@Smurphy
@fzinken

I just found this in the log:
2024-10-07 17:15:57.147 T:2998 debug : Mysql commit transaction
2024-10-07 17:15:57.316 T:2998 info : Update to version 131 successful

This means that the migration was successful and I can then watch films or series. It only stops working if I wait or restart the Vero or wait a little longer.

But I don’t have a power schedule activated on my Synology and I don’t have the hard drives hibernated.

I have now explicitly activated Wake On LAN for the NAS network interface (although it has never been active before). Let’s see what happens now.

1 Like

So I’ve changed something again. I had a PiHole on the network a while ago and now I suspected that this might be the problem.
So I switched off PiHole. Changed DNS server IP address. Deleted DB “MyVideos131”. Restarted Vero4K and Kodi and was then able to watch all films/series as normal.
I noticed the following:

And in phpMyAdmin I noticed this note…


and this is the log File:

pmadb is only for phpmyadmin and has nothing to do with Kodi. It is where phpmyadmin kepts its metadata and stuff.

new findings. Yesterday, after I deactivated IPCop and changed the DNS server again, I deleted the “MyVideos131” DB, restarted Vero/Kodi and had the DB recreated. Yesterday, after a while, I tried to access the films/series and when I clicked on a film cover or series cover, I got the message “Media server is waking up…”, then came the message “Waking up the media server takes longer…” and then (in this case) I was able to watch series again. In the past, the message at the end was that the media server was not accessible.
This morning, after the “Restart” cron job, the same problem again.
I’m slowly getting desperate.

What is the cronjob doing??? Any details?

Only a restart in the mornign at 5:00 am