Internal error: Dependent row(s) ‘smb_roles.id = 1’ isn’t found for ‘smb_users.roleId = 1’

Symptoms

An error occurs when accessing a subscription in Parallels Plesk Panel (Plesk), going to Subscriptions > domain.com > Open in Control Panel

Internal error: Dependent row(s) 'smb_roles.id = 1' isn't found for 'smb_users.roleId = 1'.
Message     Dependent row(s) 'smb_roles.id = 1' isn't found for 'smb_users.roleId = 1'.
File    Abstract.php
Line    206
Type    Exception

Cause

The problem occurs because the table smb_roles is empty::

# mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa
mysql> select * from smb_roles;
Empty set (0.00 sec)

This database inconsistency could occur during a Plesk upgrade from versions older than 10.

Resolution

Dump the Plesk database and smb_roles table:

# mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` psa > /root/psa.`date +%Y%m%d.%H%M%S`.sql
# mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` psa smb_roles > /root/psa.smb_roles.`date +%Y%m%d.%H%M%S`.sql

Add the default Plesk smb roles:

# mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa
mysql> select * from smb_roles;
Empty set (0.00 sec)
mysql> INSERT INTO `smb_roles` VALUES (1,'Admin',1,1);
Query OK, 1 row affected (0.10 sec)
mysql> INSERT INTO `smb_roles` VALUES (2,'WebMaster',0,1);
Query OK, 1 row affected (0.21 sec)
mysql> INSERT INTO `smb_roles` VALUES (3,'Application User',0,1);
Query OK, 1 row affected (0.06 sec)
mysql> INSERT INTO `smb_roles` VALUES (4,'Accountant',1,1);
Query OK, 1 row affected (0.04 sec)
mysql> INSERT INTO `smb_roles` VALUES (5,'Mail User',0,1);
Query OK, 1 row affected (0.04 sec)

 

Leave a Reply

Your email address will not be published. Required fields are marked *