Symptoms
Plesk upgrade fails with the following error:
PLESK_ERROR: Migration failed: 18.0.28/2020-05-15-08-30-04_increase_pd_user_login_length.php
Query failed: ALTER TABLE pd_users
MODIFY COLUMN login
varchar(32) NOT NULL
Duplicate entry ‘50-johndoe’ for key ‘pd_id’
Cause
Product issue:
-
#PPPM-12107 “Update to Plesk Obsidian 18.0.28 no longer fails if Plesk has two protected directory users who have the same names but the letter cases are different.”
Fixed in:- Plesk Obsidian 04 August 2020 (Linux)
Resolution
Workaround
If update is not possible for some reason you may try the following
workaround
As a workaround, delete one of the users:
-
Connect to the server via SSH.
-
Use the number from the duplicate entry reported in the error message to find the entries. In the example symptom, it is
50-johndoe
:MYSQL_LIN: mysql> select * from pd_users WHERE pd_id=50;
+—–+————-+————+——-+
| id | login | account_id | pd_id |
+—–+————-+————+——-+
| 144 | Johndoe | 0 | 50 |
| 145 | johndoe | 0 | 50 | -
Find the ID of the domain the protected directory belonged to and the path to the directory itself, use the
pd_id
asid
to search in the protected_dirs table :MYSQL_LIN: mysql> select * from protected_dirs where id=50;
+—-+———+——-+———+——-+——-+——–+———-+
| id | non_ssl | ssl | cgi_bin | realm | path | dom_id | dom_type |
+—-+———+——-+———+——-+——-+——–+———-+
| 50 | true | false | false | | protected-path| 41 | domain |
+—-+———+——-+———+——-+——-+——–+———-+
1 row in set (0.00 sec) -
Find the domain name using the
dom_id
asid
to search in the domains table:MYSQL_LIN: mysql> select name from domains where id=41;
+——————+
| name |
+——————+
| example.com |
+——————+
1 row in set (0.00 sec) -
Log in to Plesk and navigate to Domains > example.com > Password-Protected Directories > /protected-path.
-
Removed the user
Johndoe
.