SQLSTATE[HY000]: General error: 23 Out of resources

Created:

2016-11-16 13:13:37 UTC

Modified:

2017-08-16 17:05:48 UTC

1

Was this article helpful?


Have more questions?

Submit a request

SQLSTATE[HY000]: General error: 23 Out of resources

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 11.x for Linux
  • Plesk 12.0 for Linux

Symptoms

Plesk is not accessible or migration fails the following error is shown:

PLESK_INFO: ERROR: Zend_Db_Statement_Exception: SQLSTATE[HY000]: General error: 23 Out of resources when opening file '/var/tmp/#sql_d47_0.MAI' (Errcode: 24) (Pdo.php:234)

Backup creation can fail with:

CONFIG_TEXT: mysqldump: Error: 'Out of resources when opening file '/tmp/#sql_8c2_2.MYI' (Errcode: 24 - Too many open files)'

Also, the following error can be found:

CONFIG_TEXT: PHP Fatal error:  Uncaught exception 'PleskUtilException' with message 'glmng failed: Some errors occured. See log for details.' in /opt/psa/admin/plib/Service/Agent.php:219

Cause

Opened files limit is reached.

Resolution

For CentOS 7/RHEL 7/Debian8:

# mkdir -p /etc/systemd/system/mariadb.service.d/

Add the following into /etc/systemd/system/mariadb.service.d/limits.conf :

CONFIG_TEXT: [Service]
LimitNOFILE=20000

Alternatively, add the following parameters to /etc/init.d/mysql right after "#!/bin/sh":

CONFIG_TEXT: ulimit -HSn 1024
ulimit -HSn 32768
ulimit -HSn 1024000

Restart MariaDB service (or MySQL service, if it is used):

# systemctl daemon-reload
# systemctl restart mariadb.service

For CentOS 6 and lower:

# echo -e "mysql soft nofile 10000\n mysql hard nofile 20000" >> /etc/security/limits.conf

Restart MariaDB service (or MySQL service, if it is used):

# service mysqld restart

Have more questions? Submit a request
Please sign in to leave a comment.