【Plesk经验分享】如何解决Plesk中的错误: SWKeyExFatalError error: Cannot open file

适用版本:
Plesk for Linux

问题
当登录Plesk或浏览Plesk中的页面时,出现下面的错误:
Internal error:
error: Cannot open file: /etc/sw/keys/info
Message    error: Cannot open file: /etc/sw/keys/info
File    functions.php
Line    3374
Type    SWKeyExFatalError


ERROR: SWKeyExFatalError
error: Cannot open file

0: common_func.php3:4480
of_get_key_by_product(string 'plesk-unix')
1: common_func.php3:4480
getPleskKey()
2: common_func.php3:4559
getKeyProp(string 'demo')
3: auth.php3:48


ERROR: SWKeyExFatalError
error: /etc/sw/keys/lock/repository: cannot create: Permission denied


ERR [1] Exception: Token validation failed: The license key 'PLSK.XXXXXXX' was not verified. Plesk will try to verify license key. Please wait for few minutes and try again. To manually run verification of license key click "Retrieve Keys" button in "License Management".; ; The license key 'PLSK.XXXXXXX' was not verified. Plesk will try to verify license key. Please wait for few minutes and try again. To manually run verification of license key click "Retrieve Keys" button in "License Management"


Internal error:
Repository is not opened
Message Repository is not opened
File functions.php
Line 3374
Type SWKeyExFatalError

在 /var/log/plesk/panel.log 日志文件中会找到以下错误信息:
ERR [panel] Unable to get key: Repository is not opened

ERR [1] Token validation failed: ; ;

原因
用户 psaadm 不在 swkey-data 群组中。
/etc/sw/keys 目录上的权限已破坏。
/etc/sw/keys/lock/repository 目录上的权限已破坏。

解决方案
1. 通过SSH连接Plesk服务器。

2. 使用下面的命令设置正确的权限:
# /usr/sbin/usermod -a -G swkey-data psaadm
# chown -R root:swkey-data /etc/sw/keys/
# chmod u+s /etc/sw/keys/restart/apskeyhandler /etc/sw/keys/restart/plesk-key-handler
# chmod 2770 /etc/sw/keys
# chmod 2770 /etc/sw/keys/instances
# chmod 2770 /etc/sw/keys/lock
# chmod 2770 /etc/sw/keys/restart
# chmod 660 /etc/sw/keys/lock/repository
# chown -R psaadm:swkey-data /etc/sw/keys/tokens
# chown -R psaadm:swkey-data /etc/sw/keys/instances

3. 下面是各目录和文件与其权限的默认设置:
# ls -l /etc/sw/keys
total 36
drwxrws--- 2 root swkey-data 4096 Feb 18 22:13 backup
-rw-r--r-- 1 root swkey-data 22 Mar 17 2017 info
drwxrws--- 2 psaadm swkey-data 4096 May 29 2017 instances
drwxrws--- 2 root swkey-data 4096 Feb 18 22:13 keys
drwxrws--- 2 root swkey-data 4096 May 29 2017 lock
-rw-rw---- 1 psaadm swkey-data 5255 Feb 19 10:01 registry.xml
drwxrws--- 2 root swkey-data 4096 May 29 2017 restart
drwxrws--- 2 psaadm swkey-data 4096 Feb 19 10:01 tokens

4. 重启Plesk服务:
# service psa restart

5. 如果在Plesk中出现 "该许可证密钥无效" 的错误,而许可证确实是有效的,请点击 检索密钥 按钮。

提交
还没有评论,快来抢沙发吧!
售前
支持
代理
合作
售后
支持