Applicable to:
- Plesk for Linux
Symptoms
A domain can't be accessed in Plesk:
Error: Access to the location account/switch is denied
Error: Access to the location web/view is denied
Cause
There's a database inconsistency, which makes the owner of the subscription lack permission to open its own subscription.
Resolution
To fix this, a system administrator should follow these steps to manually resolve the inconsistency in the database.
- Log in to the server over SSH
-
Back up the Plesk database
# plesk db dump psa > /root/psa_dump.sql
-
Access Plesk database
# plesk db
MariaDB [psa]> -
Find the domain's owner ID (replace
example.comwith the affected domain's name)select name, cl_id from domains where name='example.com';
+---------------+-------+
| name | cl_id |
+---------------+-------+
| example.com | 3 |
+---------------+-------+
1 row in set (0.00 sec) -
Find the domain's owner login name using the ID from the previous step
select id,login from clients where id=3;
+----+-----------+
| id | login |
+----+-----------+
| 3 | john.doe |
+----+-----------+
1 row in set (0.00 sec) -
Find the
roleIDfor this user (replacejohn.doewith the user from the previous step)select login, roleID from smb_users where login='john.doe';
+-----------+--------+
| login | roleID |
+-----------+--------+
| john.doe | 9 |
+-----------+--------+
1 row in set (0.00 sec) -
Check the permissions granted to the user (in this example, they are empty)
select * from smb_roleGeneralPermissions where roleID=9;
Empty set (0.00 sec)The description of those permissions can be found in
smb_generalPermissionstable. This shows the expected result from the previous commandselect * from smb_generalPermissions;
+----+------------------------------+
| id | code |
+----+------------------------------+
| 1 | userManagement |
| 2 | webSitesAndDomainsManagement |
| 3 | logRotationManagement |
| 4 | anonymousFtpManagement |
| 5 | scheduledTasksManagement |
| 6 | spamfilterManagement |
| 7 | antivirusManagement |
| 8 | databasesManagement |
| 9 | backupRestoreManagement |
| 10 | browseStats |
| 11 | applicationsManagement |
| 12 | sitebuilderManagement |
| 13 | filesManagement |
| 14 | ftpAccountsManagement |
| 15 | dnsManagement |
| 16 | javaApplicationsManagement |
| 17 | mailManagement |
| 18 | mailListsManagement |
+----+------------------------------+
18 rows in set (0.00 sec) -
Grant all permissions to the user
# for i in {1..18}; do plesk db "insert into smb_roleGeneralPermissions (roleId,generalPermissionId,isAllowed) VALUES (9,$i,1)"; done
After that, the table smb_roleGeneralPermissions for this user should look similar to this one:
select * from smb_roleGeneralPermissions where roleID=9;
+-----+--------+---------------------+-----------+
| id | roleId | generalPermissionId | isAllowed |
+-----+--------+---------------------+-----------+
| 349 | 9 | 1 | 1 |
| 350 | 9 | 2 | 1 |
| 351 | 9 | 3 | 1 |
| 352 | 9 | 4 | 1 |
| 353 | 9 | 5 | 1 |
| 354 | 9 | 6 | 1 |
| 355 | 9 | 7 | 1 |
| 356 | 9 | 8 | 1 |
| 357 | 9 | 9 | 1 |
| 358 | 9 | 10 | 1 |
| 359 | 9 | 11 | 1 |
| 360 | 9 | 12 | 1 |
| 361 | 9 | 13 | 1 |
| 362 | 9 | 14 | 1 |
| 363 | 9 | 15 | 1 |
| 364 | 9 | 16 | 1 |
| 365 | 9 | 17 | 1 |
| 366 | 9 | 18 | 1 |
+-----+--------+---------------------+-----------+
18 rows in set (0.00 sec)
The page in Plesk should be accessible as well.
Comments
Please sign in to leave a comment.