Sometimes a Plesk upgrade may result in an “SWKeyExFatalError: Cannot open file” error while accessing the Plesk panel. The error message looks like
ERROR: SWKeyExFatalError error: Cannot open file ---------------------------- 0: common_func.php3:4537 of_get_key_by_product(string ‘plesk-unix’) 1: common_func.php3:4537 getPleskKey() 2: common_func.php3:4616 getKeyProp(string ‘demo’) 3: auth.php3:48
The SWKeyExFatalError error occurs when ownership of files/directories in /etc/sw/keys are incorrect.
The files and directories in /etc/sw/keys/ should be owned by psaadm:swkey-data except registry.xml.
# ls -la /etc/sw/keys
drwxrws--- 2 psaadm swkey-data 4096 Mar 25 04:02 backup
-rw-r--r-- 1 psaadm swkey-data 22 May 18 2010 info
drwxrws--- 2 psaadm swkey-data 4096 Sep 15 2011 instances
drwxrws--- 2 psaadm swkey-data 4096 Mar 25 04:02 keys
drwxrws--- 2 psaadm swkey-data 4096 Sep 15 2011 lock
-rw-rw---- 1 root swkey-data 7431 Apr 8 04:02 registry.xml
drwxrws--- 2 psaadm swkey-data 4096 Sep 15 2011 restart
If the ownership of the files is not what you see above, correct them as follows:
# chown psaadm:swkey-data /etc/sw/keys -R # chown root:swkey-data registry.xml
Next, restart the Plesk service and Plesk control panel should work.
# service psa restart
However, if the user ‘psaadm’ is not in the ‘swkey-data’ group, it is possible that the ownership of the files get reverted on restarting the Plesk service.
# id psaadm
uid=501(psaadm) gid=501(psaadm) groups=501(psaadm),2522(psaserv)
As you can see above, the user psaadm is not in the group of swkey-data. You can also verify it as follows:
# grep swkey-data /etc/group
swkey-data:x:502:
In such a case, edit the /etc/group file and add the psaadm user in swkey-data group. The line should look like follows:
swkey-data:x:502:psaadm
Save the file and verify the new settings
# id psaadm
uid=501(psaadm) gid=501(psaadm) groups=501(psaadm),502(swkey-data),
2522(psaserv)
Restart the Plesk service and the Plesk panel will work without problems.
Comments are closed.