Virtualmin scheduled backups fail intermittently (sql error)

5 posts / 0 new
Last post
#1 Tue, 12/19/2017 - 10:36
adam9001

Virtualmin scheduled backups fail intermittently (sql error)

Hi,

I have a server with numerous virtual hosts. I run two daily scheduled Virtualmin backups, one for local, and one for Amazon S3, scheduled about 1 hour apart. Frequently one or the other backups fails with this message:

mysql::execute_sql failed : DBI connect failed : Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) at /usr/share/webmin/web-lib-funcs.pl line 1433.

This tends to happen part way through the backup on the "SQL dump" part of a virtualhost backup.

As mentioned this doesn't happen all the time, but it does happen multiple times per week.

Can anyone offer any insights into how I might fix this?

Thank you.

Tue, 12/19/2017 - 12:33
tpnsolutions
tpnsolutions's picture

Hi,

Are you using a "dedicated server" or "vps"?

What are the specs of the machine or vps?

As a general rule, it's possible that when the backups fail, it is simply a matter of the database resources not being available. You might want to monitor the server/vps the next time the backup is being completed to see if it is running low on RAM and/or CPU resources while attempting to run the backup.

Best Regards,
Peter Knowles | TPN Solutions
Email: pknowles@tpnsolutions.com | Skype: tpnassist
Tue, 12/19/2017 - 13:08 (Reply to #2)
adam9001

Hi,

I'm running on a Linode VPS: 2 cores, 4 GB. Ubuntu 16.04

Generally, CPU and "Real Memory" has plenty free. Very low load on the CPU and less than 40% memory being used. My virtual memory tends to be mostly near-full, but I understand this isn't a problem if real memory isn't full.

I will try to monitor the resources during a backup.

Thu, 12/21/2017 - 08:30
adam9001

So I haven't noticed any extreme resource consumption, but I did enable status notifications for the MySQL service. During the most recent backup failure I got a "Mysql service is down" notification.

Incidentally, last night's backups worked flawlessly. I wonder if there is something unstable about my MySql process. Are there useful logs I can check?

Thu, 12/21/2017 - 08:54
tpnsolutions
tpnsolutions's picture

Hi,

If you are using CentOS 7, you'll find the "MariaDB" (which replaced "MySQL") log at:

/var/log/mariadb/mariadb.log

Best Regards,
Peter Knowles | TPN Solutions
Email: pknowles@tpnsolutions.com | Skype: tpnassist
Topic locked