A fatal error has occurred Cannot write to cache directory /tmp

While accessing WebMail client I was getting an error as below -

A fatal error has occurred
Cannot write to cache directory /home/username/tmp
Details have been logged for the administrator

Solution -

1. Make sure to check the disk usage of your account, it should not be full.
2. Check the inode usage of your account, it should not be exceeded. You can fire below command to check the detailed inode usage of your account -

echo "Detailed Inode usage for: $(pwd)" ; for d in `find -maxdepth 1 -type d |cut -d\/ -f2 |grep -xv . |sort`; do c=$(find $d |wc -l) ; printf "$c\t\t- $d\n" ; done ; printf "Total: \t\t$(find $(pwd) | wc -l)\n"

I was facing the issue because the inode usage for my account was exceeded. You can check it from cPanel >> Inode usage.

You can follow below steps to reduce the inode usage -
==========================================================
1. Remove all files/folders you don’t need.
2. Check the number of cache files you have, applications such as Joomla can generate a lot of cache files; you should regularly check your cache folder and reduce the number of cached files you keep.
3. Make sure you check the mailbox regularly and delete all mails you don't need.
4. Check your cPanel's main email account regularly, the mails for it are kept in:
/home/username/mail/cur
/home/username/mail/new
where username is your cPanel username. You can manually delete the messages in these folders using cPanel's File Manager.
5. You should also check your email accounts regularly and delete any spam messages from them.
6. If you have email accounts you don't need or use, it would be best to remove them.
==========================================================

In my case, it was due to the .trash directory. I've removed the directory. It resolved my issue!
  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

equired PHP version greater than equal to 5.4.0 AND found version is : 5.3.29 - Softaculous Prestashop not picking up correct php version

You may come across an issue while installing Prestashop via Softaculous regarding not picking up...

How to install MALDET Linux Malware Detect on cPanel Server?

Maldet is a malware detector and scanner for Linux based servers a project designed by R-fx...

How to Specify the exact time to run a backup on cPanel server?

How to Specify the exact time (hour) to run a backup on cPanel server? Solution :- By default,...

Domain ****.com has outgoing email disabled.

I was getting below error message while sending emails - This message was created automatically...

SMTP Error (550): Failed to add recipient

While sending email from webmail, I was getting the below error : SMTP Error (550): Failed to...

Powered by WHMCompleteSolution