Plesk ERROR: SWKeyExFatalError and Status: 500 SWKeyExFatalErrorplesk registry.xml issue

Most of the time after upgrading the Plesk panel, we are receiving the following error message.

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

To resolve the above error follow the following steps.

1st) Login in to the server as root user.

[root@server]# whoami
root

2nd) Check the ownership and permission for the files and directories present in the directory /etc/sw/keys

[root@server keys]# ll /etc/sw/keys
total 28
drwxrws— 2 psaadm swkey-data 4096 Oct 30 03:28 backup
-rw-r–r– 1 psaadm swkey-data   22 Dec  9  2010 info
drwxrws— 2 root   swkey-data 4096 Jan  8  2011 instances
drwxrws— 2 psaadm swkey-data 4096 Oct 30 03:28 keys
drwxrws— 2 psaadm swkey-data 4096 Jan  8  2011 lock
-rw-rw—- 1 root   swkey-data 3270 Oct 30 03:35 registry.xml
drwxrws— 2 psaadm swkey-data 4096 Jan  8  2011 restart

In above listing the registry.xml file and instances directory having incorrect ownership which is causing the problem.You can set the following ownership for the registry.xml file and instances directory to resolve the issue.

[root@server /]# cd /etc/sw/keys

[root@server keys]# chown psaadm.swkey-data registry.xml instances –verbose
changed ownership of `registry.xml’ to psaadm:swkey-data
changed ownership of `instances’ to psaadm:swkey-data

Now browse the Plesk panel but after restarting the plesk service from the server if still you are facing the same error message then follow the following steps.

 

[root@server /]#chown psaadm.swkey-data /etc/sw/keys -R

 

Now make sure that users “root” and “psaadm” in the swkey-data group.

[root@server /]#id psaadm

uid=501(psaadm) gid=501(psaadm) groups=501(psaadm),0(root),2521(psaserv)

As per above result user psaadm is not in the swkey-data group therefore registry.xml file ownership get reverted after restarting the plesk panel.Open the /etc/group file in your favorite editor and add the user  psaadm in the swkey-data group

[root@server  keys]# nano /etc/group

replace the following line in the above file

From

swkey-data:x:502

To

swkey-data:x:502:psaadm

and save the file and check the psaadm groups

[root@server keys]# id psaadm
uid=501(psaadm) gid=501(psaadm) groups=501(psaadm),0(root),502(swkey-data),2521(psaserv)

Now try to stop and start the Plesk service and check the ownership for the /etc/sw/keys/registry.xml file.

[root@server keys]# ll /etc/sw/keys/registry.xml
-rw-rw—- 1 psaadm swkey-data 3270 Oct 1 04:00 /etc/sw/keys/registry.xml

If you have any problem then send me an E-mail…enjoy

About Anant 386 Articles
Senior technical writer