• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue Server Error 500 - Zend_Db_Adapter_Exception

D4NY

Regular Pleskian
I've two Onyx 17.8 server, the first is a phisical machine working fine (except for updates being a Debian 9 but it's another story) and a 2 core 12 gb ram vps that in the last three days suddenly stopped working.
Trying to opening Plesk i got this error (attachment ZendDbError(1).jpg) and running just after the Repair Kit i got this page (attachment ZendDbError(2).jpg) with mysql sometimes running and sometimes not.
I need to reboot the server to come back online, and sometimes just after reboot the Cpu goes on overload status for about 20-30 minutes befor coming back to a normal situation.
This is a hosting server with about 20 websites, so uptime and stability is the priority and this situation is not acceptable.
I found this Plesk shows ERROR: Zend_Db_Adapter_Exception: SQLSTATE[HY000] [2002] No such file or directory but i have no problem with disk space and ram.

Can it depend of a specific website?ZendDBError(1).jpg ZendDBError(2).jpg
Is there a known solution or i have to migrate to another sever?
 
It is actually a problem with mysql server. In the mentioned KB article in "Known issues" you can find other related cases of this issue.
But anyway, I would suggest you investigate mysql log for searching real root cause of this issue.
 
Can you please link me to this article? Where can i find mysql logs on debian 8?
 
Ok.... found mysql logs:

The following lines are the content of error.log.1.gz

181108 6:35:15 [Note] InnoDB: innodb_empty_free_list_algorithm has been changed to legacy because of small buffer pool size. In order to use backoff, increase buffer pool at least up to 20MB.

181108 6:35:15 [Note] InnoDB: Using mutexes to ref count buffer pool pages
181108 6:35:15 [Note] InnoDB: The InnoDB memory heap is disabled
181108 6:35:15 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
181108 6:35:15 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
181108 6:35:15 [Note] InnoDB: Compressed tables use zlib 1.2.8
181108 6:35:15 [Note] InnoDB: Using Linux native AIO
181108 6:35:15 [Note] InnoDB: Using CPU crc32 instructions
181108 6:35:15 [Note] InnoDB: Initializing buffer pool, size = 128.0M
181108 6:35:15 [Note] InnoDB: Completed initialization of buffer pool
181108 6:35:15 [Note] InnoDB: Highest supported file format is Barracuda.
181108 6:35:15 [Note] InnoDB: 128 rollback segment(s) are active.
181108 6:35:15 [Note] InnoDB: Waiting for purge to start
181108 6:35:15 [Note] InnoDB: Percona XtraDB (Experts in Database Performance Management) 5.6.39-84.1 started; log sequence number 117669555
181108 6:35:16 [Note] InnoDB: FTS optimize thread exiting.
181108 6:35:16 [Note] InnoDB: Starting shutdown...
181108 6:35:17 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool
181108 6:35:18 [Note] InnoDB: Shutdown completed; log sequence number 117669565
181108 6:35:18 [Note] InnoDB: innodb_empty_free_list_algorithm has been changed to legacy because of small buffer pool size. In order to use backoff, increase buffer pool at least up to 20MB.

181108 6:35:18 [Note] InnoDB: Using mutexes to ref count buffer pool pages
181108 6:35:18 [Note] InnoDB: The InnoDB memory heap is disabled
181108 6:35:18 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
181108 6:35:18 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
181108 6:35:18 [Note] InnoDB: Compressed tables use zlib 1.2.8
181108 6:35:18 [Note] InnoDB: Using Linux native AIO
181108 6:35:18 [Note] InnoDB: Using CPU crc32 instructions
181108 6:35:18 [Note] InnoDB: Initializing buffer pool, size = 128.0M
181108 6:35:18 [Note] InnoDB: Completed initialization of buffer pool
181108 6:35:18 [Note] InnoDB: Highest supported file format is Barracuda.
181108 6:35:18 [Note] InnoDB: 128 rollback segment(s) are active.
181108 6:35:18 [Note] InnoDB: Waiting for purge to start
181108 6:35:18 [Note] InnoDB: Percona XtraDB (Experts in Database Performance Management) 5.6.39-84.1 started; log sequence number 117669565
181108 6:35:18 [Note] InnoDB: FTS optimize thread exiting.
181108 6:35:18 [Note] InnoDB: Starting shutdown...
181108 6:35:19 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool
181108 6:35:21 [Note] InnoDB: Shutdown completed; log sequence number 117669575
181108 6:35:21 [Note] InnoDB: innodb_empty_free_list_algorithm has been changed to legacy because of small buffer pool size. In order to use backoff, increase buffer pool at least up to 20MB.

181108 6:35:21 [Note] InnoDB: Using mutexes to ref count buffer pool pages
181108 6:35:21 [Note] InnoDB: The InnoDB memory heap is disabled
181108 6:35:21 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
181108 6:35:21 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
181108 6:35:21 [Note] InnoDB: Compressed tables use zlib 1.2.8
181108 6:35:21 [Note] InnoDB: Using Linux native AIO
181108 6:35:21 [Note] InnoDB: Using CPU crc32 instructions
181108 6:35:21 [Note] InnoDB: Initializing buffer pool, size = 128.0M
181108 6:35:21 [Note] InnoDB: Completed initialization of buffer pool
181108 6:35:21 [Note] InnoDB: Highest supported file format is Barracuda.
181108 6:35:22 [Note] InnoDB: 128 rollback segment(s) are active.
181108 6:35:22 [Note] InnoDB: Waiting for purge to start
181108 6:35:22 [Note] InnoDB: Percona XtraDB (Experts in Database Performance Management) 5.6.39-84.1 started; log sequence number 117669575
181108 6:35:22 [Note] Plugin 'FEEDBACK' is disabled.
181108 6:35:22 [Note] InnoDB: FTS optimize thread exiting.
181108 6:35:22 [Note] InnoDB: Starting shutdown...
181108 6:35:23 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool
181108 6:35:24 [Note] InnoDB: Shutdown completed; log sequence number 117669585
181108 6:35:24 [Note] InnoDB: innodb_empty_free_list_algorithm has been changed to legacy because of small buffer pool size. In order to use backoff, increase buffer pool at least up to 20MB.

181108 6:35:24 [Note] InnoDB: Using mutexes to ref count buffer pool pages
181108 6:35:24 [Note] InnoDB: The InnoDB memory heap is disabled
181108 6:35:24 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
181108 6:35:24 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
181108 6:35:24 [Note] InnoDB: Compressed tables use zlib 1.2.8
181108 6:35:24 [Note] InnoDB: Using Linux native AIO
181108 6:35:24 [Note] InnoDB: Using CPU crc32 instructions
181108 6:35:24 [Note] InnoDB: Initializing buffer pool, size = 128.0M
181108 6:35:24 [Note] InnoDB: Completed initialization of buffer pool
181108 6:35:24 [Note] InnoDB: Highest supported file format is Barracuda.
181108 6:35:25 [Note] InnoDB: 128 rollback segment(s) are active.
181108 6:35:25 [Note] InnoDB: Waiting for purge to start
181108 6:35:25 [Note] InnoDB: Percona XtraDB (Experts in Database Performance Management) 5.6.39-84.1 started; log sequence number 117669585
181108 6:35:25 [Note] Plugin 'FEEDBACK' is disabled.
181108 6:35:25 [Note] InnoDB: FTS optimize thread exiting.
181108 6:35:25 [Note] InnoDB: Starting shutdown...
181108 6:35:26 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool
181108 6:35:27 [Note] InnoDB: Shutdown completed; log sequence number 117669595
181108 6:35:27 [Note] InnoDB: innodb_empty_free_list_algorithm has been changed to legacy because of small buffer pool size. In order to use backoff, increase buffer pool at least up to 20MB.

181108 6:35:27 [Note] InnoDB: Using mutexes to ref count buffer pool pages
181108 6:35:27 [Note] InnoDB: The InnoDB memory heap is disabled
181108 6:35:27 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
181108 6:35:27 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
181108 6:35:27 [Note] InnoDB: Compressed tables use zlib 1.2.8
181108 6:35:27 [Note] InnoDB: Using Linux native AIO
181108 6:35:27 [Note] InnoDB: Using CPU crc32 instructions
181108 6:35:27 [Note] InnoDB: Initializing buffer pool, size = 128.0M
181108 6:35:27 [Note] InnoDB: Completed initialization of buffer pool
181108 6:35:27 [Note] InnoDB: Highest supported file format is Barracuda.
181108 6:35:27 [Note] InnoDB: 128 rollback segment(s) are active.
181108 6:35:27 [Note] InnoDB: Waiting for purge to start
181108 6:35:28 [Note] InnoDB: Percona XtraDB (Experts in Database Performance Management) 5.6.39-84.1 started; log sequence number 117669595
181108 6:35:28 [Note] Plugin 'FEEDBACK' is disabled.
181108 6:35:28 [Note] InnoDB: FTS optimize thread exiting.
181108 6:35:28 [Note] InnoDB: Starting shutdown...
181108 6:35:29 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool
181108 6:35:30 [Note] InnoDB: Shutdown completed; log sequence number 117669605

Then my server alert told me that at 6.56 this morning the server was down.

It is actually a problem with mysql server. In the mentioned KB article in "Known issues" you can find other related cases of this issue.
None of the links in "Known issues" is working....
 

Attachments

  • MySqlLogs.jpg
    MySqlLogs.jpg
    110 KB · Views: 5
If mysql is running,
Code:
service mysql status

make sure that your /etc/mysql/my.cnf file contains:
Code:
[mysqld]
bind-address = 127.0.0.1
and if that is not the case, run the commands: service mysql stop and service mysql start

Just let us know what happens.

Code:
# plesk repair db -y
should fix all issues with the database - if the database is online.
 
Run 'mysqlcheck' command to check and fix Plesk database table reported in error message:
Code:
MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqlcheck <database name> <table name> --repair -u admin

You should also have a look here:
Plesk inaccessible: ERROR: Zend_Db_Adapter_Exception: SQLSTATE[HY000] [2002] Connection refused
and here:
Plesk and websites are not accessible: ERROR: Zend_Db_Adapter_Exception: SQLSTATE[HY000] [2002] No such file or directory

I don't have a database table reported in the error message. The problem is that i cannot find which is the the website with the corrupted db.
I also don't have this path /var/log/mariadb/mariadb.log so i can't find more info.
I found this link related to this issue: Cannot access Plesk: SQLSTATE[HY000] [2002] Connection refused
 
SERVICE MYSQL STATUS

root@kabobo:/# service mysql status
● mysql.service - LSB: Start and stop the mysql database server daemon
Loaded: loaded (/etc/init.d/mysql)
Active: active (running) since Thu 2018-11-08 07:55:17 CET; 2h 28min ago
Process: 515 ExecStart=/etc/init.d/mysql start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/mysql.service
├─ 760 /bin/bash /usr/bin/mysqld_safe
├─1290 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --skip-log-error --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306
└─1291 logger -t mysqld -p daemon.error

Nov 08 07:55:15 kabobo.XXX.com mysqld[1291]: 181108 7:55:15 [Note] InnoDB: 128 rollback segment(s) are active.
Nov 08 07:55:15 kabobo.XXX.com mysqld[1291]: 181108 7:55:15 [Note] InnoDB: Waiting for purge to start
Nov 08 07:55:15 kabobo.XXX.com mysqld[1291]: 181108 7:55:15 [Note] InnoDB: Percona XtraDB (Experts in Database Performance Management) 5.6.39-84.1 started; log sequence number 117669635
Nov 08 07:55:15 kabobo.XXX.com mysqld[1291]: 181108 7:55:15 [Note] Plugin 'FEEDBACK' is disabled.
Nov 08 07:55:15 kabobo.XXX.com mysqld[1291]: 181108 7:55:15 [Note] Server socket created on IP: '127.0.0.1'.
Nov 08 07:55:16 kabobo.XXX.com mysqld[1291]: 181108 7:55:16 [Note] /usr/sbin/mysqld: ready for connections.
Nov 08 07:55:16 kabobo.XXX.com mysqld[1291]: Version: '10.0.37-MariaDB-0+deb8u1' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Debian)
Nov 08 07:55:17 kabobo.XXX.com mysql[515]: Starting MariaDB database server: mysqld . . . . . . . . . . . . . . . . ..
Nov 08 07:55:17 kabobo.XXX.com systemd[1]: Started LSB: Start and stop the mysql database server daemon.
Nov 08 07:55:21 kabobo.XXX.com /etc/mysql/debian-start[1980]: Checking for insecure root accounts.

bind-address = 127.0.0.1

Yes, my /etc/mysql/my.cnf has that line
 
Code:
# plesk repair db -y
should fix all issues with the database - if the database is online.[/QUOTE]

This is a production server, running. Is it safe? I can't risk to make damages
 
Some information about the plesk repair utility:
Plesk Repair Utility

The repair tools have been developed in recent years.
So far, I have not noticed any negative experiences with the tools.

As with all the tips you get here, you are executing these commands at your own risk.


A small note on the edge, it is never wrong to have a backup :)
 
Thank you very much for your help.

I think to have an idea about the event started the problem, i could be useful to find a solution. About 3 days ago on this VPS i noticed that usage statistics were not updated (disk space, traffic...). So recommended by someone here in the forum i ran this command from ssh: /usr/local/psa/admin/sbin/statistics --calculate-all
After 15-20 minutes i got the SQLSTATE[HY000] [2002] for the first time. Now that i'm trying to solve this puzzle i noticed that the problem is early in the morning, at about 6.50-7.00 that is exactly 15-20 minutes after the script that should update statistics of the domains (executed at about 6.35 according to the Plesk logs).

Is it possible that "statistics --calculate-all" command can damage a database?
 
NEWS!
Just bought on OVH a new VPS, same size, same os, same plesk.... just logged in the first time and ran upgrades.
This is what i got (see image). I think is not normal, and i'm thinking that buying a new vps and migrate all domain will not solve the problem....

Help!!
 

Attachments

  • nillsson.png
    nillsson.png
    377 KB · Views: 12
here is the result

Reconfiguring the Plesk installation
Reconfiguring the Plesk installation ............................ [OK]

Checking the Plesk database using the native database server tools .. [OK]

Checking the structure of the Plesk database ........................ [OK]

Checking the consistency of the Plesk database

Inconsistency in the table 'MailOutgoingMessagesStats' for the
column mailId: No rows in the table 'mail' with = 1 .............. [WARNING]
To see more details, run the command in the verbose mode: plesk repair db -verbose
Creating a database dump ........................................ [OK]
A dump of the database was created before an attempt to repair the database: /var/lib/psa/dumps/mysql.preresolve.20181108-172643.dump.gz
Removing unnecessary rows ....................................... [FIXED]

Checking system users ............................................... [OK]

Checking Linux system files ......................................... [OK]

Checking virtual hosts' file system

There is incorrect ownership on some items in the WWW root directory
of the domain 'XXXXXXXXXXXXXXXX.com' ...................... [ERROR]
To see more details, run the command in the verbose mode: plesk repair fs -verbose
Repairing incorrect ownership ................................... [FIXED]

There is incorrect ownership on some items in the WWW root directory
of the domain 'XXXXXXXXXXXXXXXX.it' .............................. [ERROR]
To see more details, run the command in the verbose mode: plesk repair fs -verbose
Repairing incorrect ownership ................................... [FIXED]

There are incorrect permissions on some items in the system
directory for the domain 'XXXXXXXXXXXXXXXX.it' ................... [ERROR]
To see more details, run the command in the verbose mode: plesk repair fs -verbose
Repairing incorrect permissions ................................. [FIXED]

There are files or directories with suspicious permissions in the
root directory of the domain 'XXXXXXXXXXXXXXXX.it' ............... [WARNING]
To see more details, run the command in the verbose mode: plesk repair fs -verbose

There are incorrect permissions on some items in the system
directory for the domain 'XXXXXXXXXXXXXXXX.it' ............ [ERROR]
To see more details, run the command in the verbose mode: plesk repair fs -verbose
Repairing incorrect permissions ................................. [FIXED]

There are incorrect permissions on some items in the system
directory for the domain 'XXXXXXXXXXXXXXXX.it' ......................... [ERROR]
To see more details, run the command in the verbose mode: plesk repair fs -verbose
Repairing incorrect permissions ................................. [FIXED]

There is incorrect ownership on some items in the WWW root directory
of the domain 'XXXXXXXXXXXXXXXX.it' .................................... [ERROR]
To see more details, run the command in the verbose mode: plesk repair fs -verbose
Repairing incorrect ownership ................................... [FIXED]

There are incorrect permissions on some items in the system
directory for the domain 'XXXXXXXXXXXXXXXX.it' ......................... [ERROR]
To see more details, run the command in the verbose mode: plesk repair fs -verbose
Repairing incorrect permissions ................................. [FIXED]

There are files or directories with suspicious permissions in the
root directory of the domain 'XXXXXXXXXXXXXXXX.it' ..................... [WARNING]
To see more details, run the command in the verbose mode: plesk repair fs -verbose

There are files or directories with suspicious permissions in the
root directory of the domain 'XXXXXXXXXXXXXXXX.it' ........................ [WARNING]
To see more details, run the command in the verbose mode: plesk repair fs -verbose

There are files or directories with suspicious permissions in the
root directory of the domain 'XXXXXXXXXXXXXXXX.com' ................. [WARNING]
To see more details, run the command in the verbose mode: plesk repair fs -verbose

There is incorrect ownership on some items in the WWW root directory
of the domain 'XXXXXXXXXXXXXXXX.net' ....................................... [ERROR]
To see more details, run the command in the verbose mode: plesk repair fs -verbose
Repairing incorrect ownership ................................... [FIXED]

There are incorrect permissions on some items in the system
directory for the domain 'XXXXXXXXXXXXXXXX.net' ............................ [ERROR]
To see more details, run the command in the verbose mode: plesk repair fs -verbose
Repairing incorrect permissions ................................. [FIXED]

There are files or directories with suspicious permissions in the
root directory of the domain 'XXXXXXXXXXXXXXXX.net' ........................ [WARNING]
To see more details, run the command in the verbose mode: plesk repair fs -verbose

There is incorrect ownership on some items in the WWW root directory
of the domain 'forum.XXXXXXXXXXXXXXXX.net' ................................. [ERROR]
To see more details, run the command in the verbose mode: plesk repair fs -verbose
Repairing incorrect ownership ................................... [FIXED]

There are incorrect permissions on some items in the system
directory for the domain 'forum.XXXXXXXXXXXXXXXX.net' ...................... [ERROR]
To see more details, run the command in the verbose mode: plesk repair fs -verbose
Repairing incorrect permissions ................................. [FIXED]

There are incorrect permissions on some items in the system
directory for the domain 'XXXXXXXXXXXXXXXX.it' .................... [ERROR]
To see more details, run the command in the verbose mode: plesk repair fs -verbose
Repairing incorrect permissions ................................. [FIXED]

There are files or directories with suspicious permissions in the
root directory of the domain 'XXXXXXXXXXXXXXXX.it' ................ [WARNING]
To see more details, run the command in the verbose mode: plesk repair fs -verbose

There is incorrect ownership on some items in the WWW root directory
of the domain 'XXXXXXXXXXXXXXXX.it' .......................... [ERROR]
To see more details, run the command in the verbose mode: plesk repair fs -verbose
Repairing incorrect ownership ................................... [FIXED]

There are files or directories with suspicious permissions in the
root directory of the domain 'XXXXXXXXXXXXXXXX.it' ........... [WARNING]
To see more details, run the command in the verbose mode: plesk repair fs -verbose

There is incorrect ownership on some items in the WWW root directory
of the domain 'XXXXXXXXXXXXXXXX.it' ............................................ [ERROR]
To see more details, run the command in the verbose mode: plesk repair fs -verbose
Repairing incorrect ownership ................................... [FIXED]

There are incorrect permissions on some items in the system
directory for the domain 'XXXXXXXXXXXXXXXX.it' ................................. [ERROR]
To see more details, run the command in the verbose mode: plesk repair fs -verbose
Repairing incorrect permissions ................................. [FIXED]


Checking Plesk version .............................................. [OK]

Checking for custom configuration templates ......................... [OK]

Checking the JkWorkersFile directive in the Apache configuration .... [OK]

Checking associations between domains and IP addresses .............. [OK]

Checking for corrupted reference between IP collections and
IPaddresses ......................................................... [OK]

Checking for links between APS applications and subscriptions ....... [OK]

Checking for the Zend extension declaraion in php.ini ............... [OK]

Check symbolic links for latest virtual host config files ........... [OK]

Checking for system users home directories consistency .............. [OK]

Checking for records with empty name field in the Configurations table
................................................................... [OK]

Checking for nginx ULIMIT value ..................................... [OK]

Checking for extra configurations in database not owned by any object
................................................................... [OK]

Checking the configuration of Apache modules ........................ [OK]

Repairing web server configuration
Reinstalling SSL/TLS certificates ............................... [OK]
Applying the default SSL/TLS certificate to all IP addresses .... [OK]
Repairing server-wide configuration parameters for web servers .. [OK]
Updating the file of sharing passwords and permissions of users
according to actual information ................................. [OK]
Repairing web server configuration for all domains. This aspect
can be used with individual domains ("plesk repair web
example.com"), and on the server level ("plesk repair web") ..... [OK]

Checking the usage of PHP handlers .................................. [OK]

Repairing the mail server configuration
Reconfiguring all domains and mailboxes ......................... [OK]

Checking the DNS configuration file ................................. [OK]

Restoring DNS server configuration
Synchronizing DNS zones with the DNS server ..................... [OK]

Checking MySQL database servers ..................................... [OK]

Repair databases on available servers ............................... [OK]

Repair database users on available servers .......................... [OK]

Error messages: 22; Warnings: 15; Errors resolved: 23

PS. i cut some of the warnings to stay in 10000 char post limit

What do you think about that?
 
Most probably that this issue is related to lack of default OVH VPS resources. I'd suggest you check it. If this is freshly installed VPS with freshly installed Plesk and this doesn't work correctly - I assume that there is something wrong on OVH VPS side.
 
@IgorG i think you are right.... now i'm desperate. Look at the following lines...

In the last two days i setup a new VPS with the same OVH PLESK ONYX image on Debian 8. Totally new. Than i've migrated about 10 websites today (very light, no overload).
I hoped to have a fully functional server but suddenly half an hour ago i got the error you can see in the image.

You can image how much i'm disappointed now. Can't believe.
 

Attachments

  • NewOvhPleskError.png
    NewOvhPleskError.png
    354.2 KB · Views: 6
At the moment the following lines seem to be a patch...

cp /etc/mysql/my.cnf /etc/mysql/my.cnf.old
and in my.cnf under the line [mysqld]
add :
Code:
open_files_limit = 4096

and under the line [mysqld_safe] add :
Code:
open_files_limit = 4096

And after reboot the server

Also my advice is to avoid to put too many scheduled ftp backup at the same time. We have 20 domains on that server and we planned all backups within 4 hours. Now we scheduled all backup during 24 hours. The vps at the moment has 3 days uptime without problems... hope to give more good news next days.
 
Back
Top