500 - Internal Server Error, /sbin/sysctl: Too many open files in system

Refers to:

  • Plesk 11.0 for Linux
  • Plesk 11.5 for Linux
  • Plesk 12.0 for Windows
  • Plesk 12.0 for Linux
  • MG:57d08d4c5acd3fc9c36854aed11a6428
  • MT:ba0af9fefac9c6c865ab17b187a4c891

Created:

2016-11-16 13:09:40 UTC

Modified:

2017-02-13 06:36:01 UTC

0

Was this article helpful?


Have more questions?

Submit a request

500 - Internal Server Error, /sbin/sysctl: Too many open files in system

Symptoms

  1. The following error appears while trying to access Plesk, or webmail:

    500 - Internal Server Error
  2. The following message is shown in the /var/log/sw-cp-server/error_log log file:

    cat: error while loading shared libraries: libc.so.6: cannot open shared object file: Error 23
    /etc/sw-cp-server/applications.d/plesk.socket.sh: line 96: cannot create temp file for here-document: Too many open files in system

    /etc/sw-cp-server/applications.d/plesk.socket.sh: line 42: /sbin/sysctl: Too many open files in system
    cat: error while loading shared libraries: libc.so.6: cannot open shared object file: Error 23

    PHP Warning: include_once(/usr/local/psa/admin/plib/Zend/Db/Adapter/Pdo/Mysql.php) [<a href='function.include-once'>function.include-once</a>]: failed to open stream: Too many open files in system; File: /usr/local/psa/admin/plib/Loader.php, Line: 78
  3. The following error appears upon attempt to reconfigure domains:

    Syntax error on line 221 of /etc/httpd/conf/httpd.conf: Could not open configuration file /etc/httpd/conf.d/welcome.conf: Too many open files in system.
  4. PHP handlers were removed. The following errors appeared in the ' /var/log/plesk/panel.log ' file:

    [2015-09-06 14:13:20] ERR [util_exec] proc_close() failed
    [06-Sep-2015 14:13:20 America/New_York] PleskUtilException: '/usr/local/psa/admin/bin/php_handlers_control' '--reread' '--no-sdf' failed with code 1.
    stdout:
    stderr:
    [Warning] removing handler `5.3.3' (module) due to errors in getting php version : can not get version from /usr/bin/php-cgi
    [Warning] removing handler `5.3.3' (fastcgi) due to errors in getting php version : can not get version from /usr/bin/php-cgi
    [Warning] removing handler `5.3.3' (cgi) due to errors in getting php version : can not get version from /usr/bin/php-cgi
    [Warning] removing handler `5.4.38' (e88bc001cfd2d49ca3e03df836f91fa0521da3f2) due to errors in getting php version : can not get version from /opt/php54/bin/php-cgi
    [Warning] /opt/php55/lib/php/php.ini for handler `5.5.23' (8e7ddf0e02938a222b96406df81534f9a7eea889) is lost. Trying without php.ini.
    [Warning] removing handler `5.5.23' (8e7ddf0e02938a222b96406df81534f9a7eea889) due to errors in getting php version : can not get version from /opt/php55/bin/php-cgi
    [Warning] /opt/php56/lib/php/php.ini for handler `5.6.7' (0c8e560f91d7467c23409bcadbfd6195d50b4730) is lost. Trying without php.ini.
    [Warning] removing handler `5.6.7' (0c8e560f91d7467c23409bcadbfd6195d50b4730) due to errors in getting php version : can not get version from /opt/php56/bin/php-cgi
    [Warning] removing handler `5.2.17' (plesk-php52-cgi) due to errors in getting php version : can not get version from /opt/plesk/php/5.2/bin/php-cgi
  5. The following errors appeared in the Apache ' error_log ' files:

    # grep -R 'Unable to load dynamic library' /var/log/ | head -n3
    grep: /var/log/httpd/cgisock.5299: No such device or address
    /var/log/httpd/error_log-20150906:PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/curl.so' - libcurl.so.4: cannot open shared object file: Too many open files in system in Unknown on line 0
    /var/log/httpd/error_log-20150906:PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/fileinfo.so' - /usr/lib/php/modules/fileinfo.so: cannot open shared object file: Too many open files in system in Unknown on line 0
    /var/log/httpd/error_log-20150906:PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/gd.so' - /usr/lib/php/modules/gd.so: cannot open shared object file: Too many open files in system in Unknown on line 0
  6. When trying to create a subscription the following error appears in Plesk:

    hosting update is failed: f2bmng failed: ERROR:f2bmng:Command '['/bin/rpm', '-qf', '--queryformat', '%{NAME}\\\

    ', '/etc/fail2ban/jail.conf', '/etc/fail2ban/jail.d/plesk.conf', '/etc/fail2ban/jail.local']' returned non-zero exit status 127

    In /var/log/messages the following can be found:

    Sep 18 10:39:01 s2 fail2ban.filter[735]: ERROR Unable to open /var/log/secure
    Sep 18 10:39:01 s2 fail2ban.filter[735]: ERROR [Errno 23] Too many open files in system: '/var/log/secure'#012Traceback (most recent call last):#012 File "/usr/share/fail2ban/server/filter.py", line 556, in getFailures#012 has_content = container.open()#012 File "/usr/share/fail2ban/server/filter.py", line 637, in open#012 self.__handler = open(self.__filename)#012IOError: [Errno 23] Too many open files in system: '/var/log/secure'

Cause

Resources for the container or physical server have been exceeded.

Diagnostic

  • For Virtuozzo containers:

    Check resources that have failcnt more than 0:

    # awk '$NF' /proc/user_beancounters
    Version: 2.5
    uid resource held maxheld barrier limit failcnt
    numfile 6590 8096 8096 8096 462
  • For physical servers:

    Check resources under ' /proc/ ' directory. For example, to check number of opened files (allocated file handles) and limit (maximum number of file handles):

    # cat /proc/sys/fs/file-nr
    138120 0 262144

    Check memory by means of ' free ' utility:

    # free
    total used free shared buffers cached
    Mem: 1048576 651700 396876 104724 0 352648
    -/+ buffers/cache: 299052 749524
    Swap: 1048576 1260 1047316

Resolution

Increase the resources.

Please refer to the #213398789 knowledge base article regarding Plesk in Virtuozzo containers.

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