Plesk users sometimes receive the error "Can't create transaction directory file" while login to Plesk GUI.
Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to resolve related Plesk errors.
In this context, we shall look into method to fix this Plesk error.
Recently we received a support request from one of our customers that they are unable to log in to Plesk GUI. We were receiving the error as below:
Service_Agent_Exception: Can't create transaction directory
file: /opt/psa/admin/plib/Service/Agent/Transport/LocalTransaction.php
line: 63
code: 0
We also noticed that the Plesk keeps loading and the following error was found in /var/log/plesk/panel.log the file:
PHP Warning: mkdir(): Permission denied; File: /opt/psa/admin/plib/Service/Agent/Transport/LocalTransaction.php, Line: 58
This error mainly happens due to missing or incorrect permissions of the tmp directory. For RHEL-based OSes, this error will be /usr/local/psa/tmp/.For Debian-based OSes, this will be /opt/psa/tmp .
To begin, you need to find out if the /tmp folder is missing or not. We try to list the folder after connecting through SSH with the commands below:
For RHEL-based OSes (CentOS, RHEL, CloudLinux):
# ls -d /usr/local/psa/tmp
ls: cannot access /usr/local/psa/tmp: No such file or directory
For Debian and Ubuntu OSes:
# ls -ld /opt/psa/tmp
ls: cannot access '/opt/psa/tmp': No such file or directory
The "No such file or directory" message indicates that the /tmp folder is missing. If the folder exists already, we also make sure that the folder is having the required permission with the command below:
For RHEL-based OSes (CentOS, RHEL, CloudLinux):
# stat -c "%a %U %G %n" /usr/local/psa/tmp
1777 root root /usr/local/psa/tmp
For Debian and Ubuntu OSes:
# stat -c "%a %U %G %n" /opt/psa/tmp
1777 root root /opt/psa/tmp
If the permission is different from the one below, we need to correct it.
For the case with missing folders , we make sure that the Plesk tmp directory is created by running the following commands:
For RHEL-based OSes (CentOS, RHEL, CloudLinux):
# DIR="/usr/local/psa/tmp"; if [ ! -d "$DIR" ]; then mkdir -p "$DIR"; fi
For Debian and Ubuntu OSes:
# DIR="/opt/psa/tmp"; if [ ! -d "$DIR" ]; then mkdir -p "$DIR"; fi
If the issue is with the permission of the /tmp folder, we correct it with the command below:
For RHEL-based OSes (CentOS, RHEL, CloudLinux):
# DIR="/usr/local/psa/tmp"; chmod 1777 "$DIR" && chown root:root "$DIR"
For Debian and Ubuntu OSes:
# DIR="/opt/psa/tmp"; chmod 1777 "$DIR" && chown root:root "$DIR"
This article covers how to quickly fix Plesk error "Can't create transaction directory file". Basically, this Plesk error happens due to missing or incorrect permission of the /tmp directory.