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

Created:

2016-11-16 13:13:37 UTC

Modified:

2017-04-24 11:20:05 UTC

0

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.5 for Linux
  • Plesk 12.0 for Linux

Symptoms

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

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:

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:

=|2017-03-06_17:08:17,880|D|ST1|core.runners.base|example.com||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 :

[Service]
LimitNOFILE=20000


Alternatively, add the following parameters to my.cnf right after "#!/bin/sh":

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\

mysql hard nofile 20000" >> /etc/security/limits.conf # service mysqld restart

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