{"id":1864,"date":"2012-04-08T11:19:35","date_gmt":"2012-04-08T15:19:35","guid":{"rendered":"http:\/\/linuxhostingsupport.net\/blog\/?p=1864"},"modified":"2013-03-20T08:38:23","modified_gmt":"2013-03-20T12:38:23","slug":"plesk-error-swkeyexfatalerror-cannot-open-file","status":"publish","type":"post","link":"https:\/\/linuxhostingsupport.net\/blog\/plesk-error-swkeyexfatalerror-cannot-open-file","title":{"rendered":"Plesk error: SWKeyExFatalError Cannot open file"},"content":{"rendered":"<p>&nbsp;<br \/>\nSometimes a Plesk upgrade may result in an &#8220;SWKeyExFatalError: Cannot open file&#8221; error while accessing the Plesk panel. The error message looks like<\/p>\n<blockquote>\n<pre>ERROR: SWKeyExFatalError\r\nerror: Cannot open file\r\n----------------------------\r\n0: common_func.php3:4537\r\nof_get_key_by_product(string \u2018plesk-unix\u2019)\r\n1: common_func.php3:4537\r\ngetPleskKey()\r\n2: common_func.php3:4616\r\ngetKeyProp(string \u2018demo\u2019)\r\n3: auth.php3:48<\/pre>\n<\/blockquote>\n<p>&nbsp;<br \/>\nThe SWKeyExFatalError error occurs when ownership of files\/directories in \/etc\/sw\/keys are incorrect.<br \/>\n<strong>The files and directories in \/etc\/sw\/keys\/ should be owned by psaadm:swkey-data except registry.xml.<\/strong><\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># ls -la \/etc\/sw\/keys<\/span>\r\n drwxrws--- 2 psaadm swkey-data 4096 Mar 25 04:02 backup\r\n -rw-r--r-- 1 psaadm swkey-data 22 May 18 2010 info\r\n drwxrws--- 2 psaadm swkey-data 4096 Sep 15 2011 instances\r\n drwxrws--- 2 psaadm swkey-data 4096 Mar 25 04:02 keys\r\n drwxrws--- 2 psaadm swkey-data 4096 Sep 15 2011 lock\r\n -rw-rw---- 1 root swkey-data 7431 Apr 8 04:02 registry.xml\r\n drwxrws--- 2 psaadm swkey-data 4096 Sep 15 2011 restart<\/pre>\n<\/blockquote>\n<p>&nbsp;<br \/>\nIf the ownership of the files is not what you see above, correct them as follows:<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># chown psaadm:swkey-data \/etc\/sw\/keys -R<\/span>\r\n<span style=\"color: #0000ff;\"># chown root:swkey-data registry.xml<\/span><\/pre>\n<\/blockquote>\n<p>&nbsp;<br \/>\nNext, restart the Plesk service and Plesk control panel should work.<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># service psa restart<\/span><\/pre>\n<\/blockquote>\n<p>&nbsp;<br \/>\nHowever, <strong>if the <strong>user &#8216;psaadm&#8217; is not in the &#8216;swkey-data&#8217; group, <\/strong>it is possible that the ownership of the files get reverted on restarting the Plesk service<\/strong>.<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># id psaadm<\/span>\r\n uid=501(psaadm) gid=501(psaadm) groups=501(psaadm),2522(psaserv)<\/pre>\n<\/blockquote>\n<p>&nbsp;<br \/>\nAs you can see above, the user psaadm is not in the group of swkey-data. You can also verify it as follows:<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># grep swkey-data \/etc\/group<\/span>\r\n swkey-data:x:502:<\/pre>\n<\/blockquote>\n<p>&nbsp;<br \/>\nIn such a case, edit the \/etc\/group file and add the psaadm user in swkey-data group. The line should look like follows:<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\">swkey-data:x:502:psaadm<\/span><\/pre>\n<\/blockquote>\n<p>&nbsp;<br \/>\nSave the file and verify the new settings<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># id psaadm<\/span>\r\nuid=501(psaadm) gid=501(psaadm) groups=501(psaadm),502(swkey-data),\r\n2522(psaserv)<\/pre>\n<\/blockquote>\n<p>&nbsp;<br \/>\nRestart the Plesk service and the Plesk panel will work without problems.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp;<br \/>\nSometimes a Plesk upgrade may result in an &#8220;SWKeyExFatalError: Cannot open file&#8221; error while accessing the Plesk panel. The error message looks like<\/p>\n<p>ERROR: SWKeyExFatalError<br \/>\nerror: Cannot open file<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n0: common_func.php3:4537<br \/>\nof_get_key_by_product(string \u2018plesk-unix\u2019)<br \/>\n1: common_func.php3:4537<br \/>\ngetPleskKey()<br \/>\n2: common_func.php3:4616<br \/>\ngetKeyProp(string \u2018demo\u2019)<br \/>\n3: auth.php3:48<\/p>\n<p>&nbsp;<br \/>\nThe SWKeyExFatalError error occurs when ownership of files\/directories in \/etc\/sw\/keys are incorrect.<br \/>\nThe files and directories in \/etc\/sw\/keys\/ should be owned by psaadm:swkey-data except registry.xml.<\/p>\n<p># ls -la \/etc\/sw\/keys<br \/>\n drwxrws&#8212; 2 psaadm swkey-data 4096 Mar 25 04:02 backup<br \/>\n -rw-r&#8211;r&#8211; 1 psaadm swkey-data 22 May 18 2010 info<br \/>\n drwxrws&#8212; 2 psaadm swkey-data 4096 Sep 15 2011 instances<br \/>\n drwxrws&#8212; 2 [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[1384,1385,1383],"_links":{"self":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/1864"}],"collection":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/comments?post=1864"}],"version-history":[{"count":13,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/1864\/revisions"}],"predecessor-version":[{"id":2080,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/1864\/revisions\/2080"}],"wp:attachment":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/media?parent=1864"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/categories?post=1864"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/tags?post=1864"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}