PHP 7.4 and PHP 8.0 are inaccessible on CloudLinux OS: 504 Gateway Time-out
[Symptom]
-
When opening Plesk or exporting/importing a database from Plesk, the following error message occurs and the operation fails:
ERROR: Plesk\Exception\Database
DB query failed: SQLSTATE[HY000]: General error: 1021 Disk full (/var/tmp/#sql_3b95_1); waiting for someone to free some space ..., <...>
Server Error
500 Plesk\Exception\Database
DB query failed: SQLSTATE[HY000]: General error: 1 Can't create/write to file '/var/tmp/#sql_9d1_0.MAI' (Errcode: 28), <...>
Server Error
500
Zend_Db_Adapter_Exception
SQLSTATE[HY000][2002] No such file or directory
This page isn't working
203.0.113.2 is currently unable to handle this request.
HTTP ERROR 500
- Your web browser cannot access a website that contains a MySQL database with the following error message:
Error establishing a database connection
- MySQL service does not start with the error "No space left on device".
# systemctl status mariadb.service
...
systemd[1]: Starting MariaDB database server...
systemd[1]: mariadb.service failed to run 'start-pre' task: No space left on device
systemd[1]: Failed to start MariaDB database server.
systemd[1]: mariadb.service failed.
- Or, the following error message appears in the /var/log/mariadb/mariadb.log path.
[ERROR] InnoDB: Could not set the file size of './ibtmp1'. Probably out of disk space
[cause]
- If there is no free disk space on the root partition (or tmp partition if separated), the MySQL service cannot create temporary files.
# df -h /var/lib/mysql /tmp
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 50G 50G 20K 100% /
- If there is enough free disk space but not enough inodes available,
# df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
tmpfs 483902 1 483901 1% /dev/shm
/dev/sda3 3276800 3276800 0 100% /
[Resolution]
- First, you need to free up some space to resume service.
1. Connect to the Plesk server as root via SSH.
2. Delete temporary files older than 14 days
# find /tmp -type f -mtime + 14 -exec rm {} \;
# find /var/tmp -type f -mtime + 14 -exec rm {} \;
Plesk temporary files:
# rm -rf /usr/local/psa/PMM/tmp/* /usr/local/psa/tmp/*
3. Check the size and clean the package cache (cache of previously downloaded packages) using the following commands:
# du -sh /var/cache/apt/
# sudo apt-get clean
For Cent OS:
# yum clean all
4. If shows disk space still 100% remove the oldest Plesk backup file. You can. First, copy/paste the command below to get a list of backup files.
# /usr/local/psa/admin/bin/pmm-ras --get-dump-list --type=server | grep 'message' | grep -v [0-9]_[0-9]
backup_info_2010230005.xm l:
backup_info_2010300005.xml :
Here, if you only have one backup, it is better not to remove it. If there are multiple, the first one in the output is the oldest. Remove it using its name.
# /usr/local/psa/admin/bin/pmm-ras --verbose --debug --delete-dump --dump-specification= backup_info_2010230005.xm l --session-path=/ var/log/plesk/PMM
5. If steps 2 and 3 do not help you find files larger than 200MB,
# find / -type f -size +200M -exec du -h {} + 2 > /dev/null | sort -r -h
248M /var/log/plesk-php74-fpm/error.log
218M /var/lib/mysql/ibdata1
If you have log files, such as error.log in the example above, you can also clean them up.
# echo > /var/log/plesk-php74-fpm/error.log
# service plesk-php74-fpm restart
6. Restart the service:
# service psa restart
7. Once MySQL and Plesk are running again, the best way to find out about space usage is This is to use Diskpace Usage Viewer .