Hope someone can help! I keep getting these files created in /tmp which creates error below when trying to access web or even the plesk panel until I go in via SSH or FTP and manually delete it (#sql_1ed7_0.MYD):
ERROR: Zend_Db_Statement_Exception: SQLSTATE[HY000]: General error: 1 Can't create/write to file '/tmp/#sql_1ed7_0.MYD' (Errcode: 17) (Pdo.php:234)
There is nothing in any of the MySQL logs, changed the mysql tmp directory in my.cnf to home/mysqltmp and still happens so doesnt look that’s the issue. I think its possible to do with httpd.conf, here is the logs around when it happens in the apache error_log:
[Fri Nov 28 16:09:21 2014] [warn-phpd] mmap cache can't open /var/www/vhosts/.com/httpdocs/app/code/core/Mage/Core/Model/Resource/Store/Collection.php - Too many open files in system (pid 15876)
[Fri Nov 28 16:09:21 2014] [warn-phpd] mmap cache can't open /var/www/vhosts/.com/httpdocs/app/code/local/Sns/Quickview/Helper/Data.php - Too many open files in system (pid 15876)
[Fri Nov 28 16:09:22 2014] [error] (12)Cannot allocate memory: fork: Unable to fork new process
[Fri Nov 28 16:09:22 2014] [warn-phpd] mmap cache can't open /var/www/vhosts/.com/httpdocs/app/code/core/Mage/Core/Model/Resource/Website.php - Too many open files in system (pid 15872)
[Fri Nov 28 16:09:22 2014] [warn-phpd] mmap cache can't open /var/www/vhosts/.com/httpdocs/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image.php - Too many open files in system (pid 15869)
[Fri Nov 28 16:09:22 2014] [warn-phpd] mmap cache can't open /var/www/vhosts/.com/httpdocs/app/code/core/Mage/Catalog/Model/Resource/Category/Tree.php - Too many open files in system (pid 15858)
[Fri Nov 28 16:09:22 2014] [warn-phpd] mmap cache can't open /var/www/vhosts/.com/httpdocs/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php - Too many open files in system (pid 15876)
[Fri Nov 28 16:09:22 2014] [warn-phpd] mmap cache can't open /var/www/vhosts/.com/httpdocs/app/code/core/Mage/Core/Helper/Abstract.php - Too many open files in system (pid 15872)
[Fri Nov 28 16:09:22 2014] [warn-phpd] mmap cache can't open /var/www/vhosts/.com/httpdocs/app/code/core/Mage/Catalog/Model/Product.php - Too many open files in system (pid 15856)
[Fri Nov 28 16:09:22 2014] [warn-phpd] mmap cache can't open /var/www/vhosts/.com/httpdocs/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Image.php - Too many open files in system (pid 15872)
[Fri Nov 28 16:09:22 2014] [warn-phpd] mmap cache can't open /var/www/vhosts/.com/httpdocs/app/code/core/Mage/Directory/Block/Currency.php - Too many open files in system (pid 15872)
[Fri Nov 28 16:09:22 2014] [warn-phpd] mmap cache can't open /var/www/vhosts/.com/httpdocs/app/code/core/Mage/GoogleAnalytics/Block/Ga.php - Too many open files in system (pid 15872)
[Fri Nov 28 16:09:22 2014] [warn-phpd] mmap cache can't open /var/www/vhosts/.com/httpdocs/app/design/frontend/default/sns_kalins/template/directory/currency.phtml - Too many open files in system (pid 15856)
[Fri Nov 28 16:09:22 2014] [warn-phpd] mmap cache can't open /var/www/vhosts/.com/httpdocs/app/code/core/Mage/Shipping/Model/Config.php - Too many open files in system (pid 15872)
[Fri Nov 28 16:09:23 2014] [warn-phpd] mmap cache can't open /var/www/vhosts/.com/httpdocs/app/code/local/Sns/Ajaxcart/Helper/Core/Url.php - Too many open files in system (pid 15856)
[Fri Nov 28 16:09:23 2014] [warn-phpd] mmap cache can't open /var/www/vhosts/.com/httpdocs/lib/Varien/Db/Ddl/Table.php - Too many open files in system (pid 15876)
[Fri Nov 28 16:09:23 2014] [warn-phpd] mmap cache can't open /var/www/vhosts/.com/httpdocs/lib/Varien/Event/Observer.php - Too many open files in system (pid 15876)
[Fri Nov 28 16:09:23 2014] [warn-phpd] mmap cache can't open /var/www/vhosts/.com/httpdocs/app/code/core/Mage/Core/Model/Config/Data.php - Too many open files in system (pid 15876)
[Fri Nov 28 16:09:23 2014] [warn-phpd] mmap cache can't open /var/www/vhosts/.com/httpdocs/app/code/core/Mage/Core/Controller/Request/Http.php - Too many open files in system (pid 15869)
[Fri Nov 28 16:09:24 2014] [warn-phpd] mmap cache can't open /var/www/vhosts/.com/httpdocs/app/code/core/Mage/Core/Model/Config/Data.php - Too many open files in system (pid 15876)
[Fri Nov 28 16:09:24 2014] [warn-phpd] mmap cache can't open /var/www/vhosts/.com/httpdocs/app/code/core/Mage/Adminhtml/Helper/Data.php - Too many open files in system (pid 15874)
[Fri Nov 28 16:09:24 2014] [warn-phpd] mmap cache can't open /var/www/vhosts/.com/httpdocs/app/code/core/Mage/Catalog/controllers/CategoryController.php - Too many open files in system (pid 15874)
[Fri Nov 28 16:09:24 2014] [warn-phpd] mmap cache can't open /var/www/vhosts/.com/httpdocs/lib/Zend/Cache/Core.php - Too many open files in system (pid 15876)
[Fri Nov 28 16:09:24 2014] [warn-phpd] mmap cache can't open /var/www/vhosts/.com/httpdocs/app/code/core/Mage/Core/Model/Config/Base.php - Too many open files in system (pid 15856)
[Fri Nov 28 16:09:24 2014] [warn-phpd] mmap cache can't open /var/www/vhosts/.com/httpdocs/app/code/core/Mage/Core/Model/Resource/Store/Group/Collection.php - Too many open files in system (pid 15876)
[Fri Nov 28 16:09:24 2014] [warn-phpd] mmap cache can't open /var/www/vhosts/.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Router/Abstract.php - Too many open files in system (pid 15874)
[Fri Nov 28 16:09:24 2014] [warn-phpd] mmap cache can't open /var/www/vhosts/.com/httpdocs/app/code/core/Mage/Core/Controller/Request/Http.php - Too many open files in system (pid 15869)
[Fri Nov 28 16:09:42 2014] [error] (12)Cannot allocate memory: fork: Unable to fork new process
[Fri Nov 28 16:09:52 2014] [error] (12)Cannot allocate memory: fork: Unable to fork new process
[Fri Nov 28 17:25:51 2014] [notice] caught SIGTERM, shutting down
[Fri Nov 28 17:25:53 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri Nov 28 17:25:54 2014] [warn] RSA server certificate
[Fri Nov 28 17:25:55 2014] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Fri Nov 28 17:25:55 2014] [notice] mod_python: using mutex_directory /tmp
Completely at a loss….getting no where with Google 🙁 Just installed a full page cache module in magento which I think is the source of the cache file errors in the log but that was installed after this issue started.
Don’t want to have to keep babysitting the server to delete this file again and again.
Worth noting there is no problems with the permissions of the /tmp directory (1777), however the file that’s created has permissions of 644 and as soon as I delete it everything’s back up.
3
Answers
Happened again, logs when the file was created (quite a lot)
**
**
It seems what issue not in Magento. Your apache log said: Too many open files in system.
You need to increase the maximum number of allowed open file descriptors. For doing this find Apache init script and add next line in it:
Usually, Apache init script placed in /etc/init.d/apache2 or /etc/init.d/httpd paths.
As result it will looks like:
After that restart Apache:
Result from command cat /proc/user_beancounters