Mysql crash when the user exceeds the allowed quota.
A BIG issue!
Feb 3 00:02:34 host7 systemd[1]: Started MariaDB 10.3.27 database server.
Feb 3 00:02:34 host7 /etc/mysql/debian-start[7553]: Upgrading MySQL tables if necessary.
Feb 3 00:02:34 host7 /etc/mysql/debian-start[7556]: /usr/bin/mysql_upgrade: the ‘–basedir’ option is always ignored
Feb 3 00:02:34 host7 /etc/mysql/debian-start[7556]: Looking for ‘mysql’ as: /usr/bin/mysql
Feb 3 00:02:34 host7 /etc/mysql/debian-start[7556]: Looking for ‘mysqlcheck’ as: /usr/bin/mysqlcheck
Feb 3 00:02:34 host7 /etc/mysql/debian-start[7556]: Version check failed. Got the following error when calling the ‘mysql’ command line client
Feb 3 00:02:34 host7 /etc/mysql/debian-start[7556]: ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: NO)
Feb 3 00:02:34 host7 /etc/mysql/debian-start[7556]: FATAL ERROR: Upgrade failed
Feb 3 00:02:34 host7 /etc/mysql/debian-start[7566]: Checking for insecure root accounts.
Feb 3 00:02:34 host7 debian-start[7551]: ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: NO)
Feb 3 00:02:40 host7 systemd[1]: mariadb.service: Main process exited, code=killed, status=6/ABRT
Feb 3 00:02:40 host7 systemd[1]: mariadb.service: Failed with result ‘signal’.
Feb 3 00:02:45 host7 systemd[1]: mariadb.service: Service RestartSec=5s expired, scheduling restart.
Feb 3 00:02:45 host7 systemd[1]: mariadb.service: Scheduled restart job, restart counter is at 23.
Feb 3 00:02:45 host7 systemd[1]: Stopped MariaDB 10.3.27 database server.
Feb 3 00:02:45 host7 systemd[1]: Starting MariaDB 10.3.27 database server…
Feb 3 00:02:46 host7 mysqld[7675]: 2021-02-03 0:02:46 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 7675 …
Feb 3 00:02:46 host7 systemd[1]: Started MariaDB 10.3.27 database server.
Feb 3 00:02:46 host7 /etc/mysql/debian-start[7713]: Upgrading MySQL tables if necessary.
Feb 3 00:02:46 host7 /etc/mysql/debian-start[7716]: /usr/bin/mysql_upgrade: the ‘–basedir’ option is always ignored
Feb 3 00:02:46 host7 /etc/mysql/debian-start[7716]: Looking for ‘mysql’ as: /usr/bin/mysql
Feb 3 00:02:46 host7 /etc/mysql/debian-start[7716]: Looking for ‘mysqlcheck’ as: /usr/bin/mysqlcheck
Feb 3 00:02:46 host7 /etc/mysql/debian-start[7716]: Version check failed. Got the following error when calling the ‘mysql’ command line client
Feb 3 00:02:46 host7 /etc/mysql/debian-start[7716]: ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: NO)
Feb 3 00:02:46 host7 /etc/mysql/debian-start[7716]: FATAL ERROR: Upgrade failed
Feb 3 00:02:46 host7 /etc/mysql/debian-start[7726]: Checking for insecure root accounts.
Feb 3 00:02:46 host7 debian-start[7711]: ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: NO)
I have set up a new virtualmin server. During testing, I installed Drupal 9 CMS. Everything was fine. I did a few more minor things. Suddenly the mysql crashed. I was wondering what could be causing this. I noticed that the server exceeded the allowed quote of 1GB. This is default. I raised it to 2GB. Suddenly mysql started working fine.
Who will tell me what happened?
I have many years of experience with virtualmin and this is the first time I see something like this. It is also my first server on debian 10.
I’m not sure if I’m understanding your problem correctly, but when I read this:
According to this the problem is simple: when you install files MORE than 1 GB and then you limit your site to 1 GB then Virtualmin will automatically shut the site down for being over quota. Any webhost will do the same thing. You have no room for virtual memory or anything else when you do that so executing anything becomes impossible.
Why you would do that is simply beyond me to begin with.
Imagine a Windows Computer with a 1 GB hard drive. Try installing 1.3 GB of files on it (which you’ll never be able to do) and then still using it.
That is literally what you are doing and why it stops working.
If your original problem is because you’re going over your allowed limit then that is your issue. You’ll need to reduce the size of the site or increase the limit.
If you are being hosted by someone else though and you’re hitting MySQL limits even when you’re below your disc quota, then that’s something else entirely.
A lot of hosts limit MySQL queries based on the hosting program you buy. What happens is if you get too many queries in an hour, they shut down your MySQL for the rest of that hour until it resets and then it’ll start working again.
Again, I’m probably not understanding your actual problem correctly. Crashing your own Virtual Server by limiting its resources has me curious though.
If “hard quotas” are enabled, and it is really shutting down MySQL which is still hard to believe since shutting down the daemon means every virtual server would be affected by a single virtual server over quota…
Then you could set “soft quotas” which essentially just complains you’re over limit, but doesn’t actually stop you from using more space.
*** I’d still be interested in seeing this issue in action for curiosity sake. ***
Just did it on my server (limited on of my virtual servers below it’s usage). As predicted, it messes up that particular virtual server (it couldn’t even write the Webinizer report to disc on closing because there was no room.) but it didn’t effect any other virtual server on my server.
It still displayed properly on the internet though with the exception of any scripted material. (The likes and follow buttons were disabled as they use scripting.)
Well that’s good to know, in the sense that it only affected the virtual server which was over quota. This, if you are using “hard quotas” is the intended result.
“Hard Quotas” is the default setting, so if you haven’t changed the “Default Settings” Server Template, then this will apply.
You can adjust the “Disk Quota Type”, visit:
System Settings > Server Templates > Default Settings
Navigate to the “template section” called “Administration User”, and you’ll see option “Disk Quota Type”.
Now, typically like most things, when you adjust this setting, it does NOT take effect on existing Virtual Servers, however I read somewhere (as I’ve never had a reason to try thus far) that if after adjusting the setting, you simply make even a “slight” change to the Virtual Server’s quota, the new settings should take effect for that Virtual Server.
I’m probably wrong here, but it looks like after you changed the virtual server limit to 1 GB, and the virtual server shuts down and restarts, you’re not able to start MySQL again because no password is entered on the bootup.
It tries to start MySQL, then denies access for the root user using no password. That seems odd to me.
Feb 4 14:48:50 host7 systemd[1]: Starting MariaDB 10.3.27 database server…
Feb 4 14:48:50 host7 mysqld[16132]: 2021-02-04 14:48:50 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 16132 …
Feb 4 14:48:51 host7 systemd[1]: Started MariaDB 10.3.27 database server.
Feb 4 14:48:51 host7 /etc/mysql/debian-start[16170]: Upgrading MySQL tables if necessary.
Feb 4 14:48:51 host7 /etc/mysql/debian-start[16173]: /usr/bin/mysql_upgrade: the ‘–basedir’ option is always ignored
Feb 4 14:48:51 host7 /etc/mysql/debian-start[16173]: Looking for ‘mysql’ as: /usr/bin/mysql
Feb 4 14:48:51 host7 /etc/mysql/debian-start[16173]: Looking for ‘mysqlcheck’ as: /usr/bin/mysqlcheck
Feb 4 14:48:51 host7 /etc/mysql/debian-start[16173]: Version check failed. Got the following error when calling the ‘mysql’ command line client
Feb 4 14:48:51 host7 /etc/mysql/debian-start[16173]: ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: NO)
Feb 4 14:48:51 host7 /etc/mysql/debian-start[16173]: FATAL ERROR: Upgrade failed
Feb 4 14:48:51 host7 /etc/mysql/debian-start[16184]: Checking for insecure root accounts.
Feb 4 14:48:51 host7 debian-start[16167]: ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: NO)
And mysql works stably.
But when one of the virtual servers is over quota, mysql crashes and restarts.
When I raise the quota for virtual server mysql is stable again.
My post is a warning to you all that something like this may happen.
Besides, I wonder what causes this behavior.
On the screen I have marked the moment when mysql crashes and restarts