Error message:

Unable to create SysUser object: SysUser: unable to select: no such row in the table

0: /usr/local/psa/admin/plib/class.DomainControlForm.php:168
DomainControlForm->assign(object of type BsDomain)
1: /usr/local/psa/admin/htdocs/domains/dom_ctrl.php3:149

Solutions:

You will see following error message only when you have configured physical hosting for domain, however appropriate user in missing.

mysql> select * from (select A.id, A.name as domain, A.htype as ‘hosting type’, sys_users.login as ‘system user’ from (select id, concat(‘/var/www/vhosts/’, name) as home, htype, name from domains) A left join sys_users on (A.home=sys_users.home)) B where `hosting type` = ‘vrt_hst’ and `system user` is NULL;
+—–+————+————–+————-+
| id | domain | hosting type | system user |
+—–+————+————–+————-+
| 15 | domain.tld | vrt_hst | NULL |
+—–+————+————–+————-+
1 row in set (0.00 sec)
mysql>

Where domain.tld is your domain that experiences the problem.

Now, to resolve such issue follow up given below instructions.

1. Backup Plesk database before any reconfiguration.
~# mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` psa > psa.dump.`date +%F.%s`.sql
2. Check if system user is exists:
~#grep domain.tld /etc/passwd
domain_ftp_user:x:10001:2524::/var/www/vhosts/domain.tld:/bin/false
Where /var/www/vhosts is PRODUCT_ROOT_D. domain_ftp_user is old domain’s system user.
3. To resolve this issue add missing record into database of Parallels Plesk Panel manually.
4. Get ID of domain’s system user:
mysql> select sys_user_id from hosting where dom_id=15;
+————-+
| sys_user_id |
+————-+
| 4 |
+————-+
1 row in set (0.00 sec)
mysql>
Where 15 is domain’s ID, for details see query in part CAUSE.
5. Insert account record:
mysql> insert into accounts(type,password) values (‘plain’,’‘);
Query OK, 1 row affected (0.09 sec)
mysql>
Where <NEW PASSWORD> is new password for new system user for the domain. This is password for domain’s FTP user also.
6. Find ID of created record:
mysql> select * from accounts order by id desc limit 1;
+—–+——-+——————+
| id | type | password |
+—–+——-+——————+
| 186 | plain | |
+—–+——-+——————+
1 row in set (0.00 sec)
mysql>
7. Insert record into table sys_users:
mysql> insert into sys_users values (4,’sb4′,186,’/var/www/vhosts/domain.tld’,'/bin/false’,0);
Query OK, 1 row affected (0.08 sec)
mysql>
Where <NEW USER> is login of new system user for domain domain.tld, it is also domain’s FTP user. And 4 is domain’s sys_user_id, 186 is ID of new password.
8. System user does not exist.
~# grep domain.tld /etc/passwd
~#
9. It is recommended to re-enable physical hosting for the domain anew. However note that whole virtual hosting directory is overwritten and domain content is lost.
10. Disable hosting for domain:
mysql> update domains set htype=’none’ where name=’domain.tld’;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> delete from hosting where dom_id=15;
Query OK, 1 row affected (0.00 sec)
mysql>
Where 15 is domain’s ID, for details see query in part CAUSE.
11. Login to Parallels Plesk Panel and configure physical hosting for the domain anew through Domains -> domain.tld -> Setup. Choose Physical hosting, insert new user login and password. Click OK to finish configuration.
 
آیا این پاسخ به شما کمک کرد؟ 2 کاربر این را مفید یافتند (72 نظرات)