Symptoms
-
Unable to change the Hosting Settings or PHP Settings via Subscriptions > example.com or install Let’s Encrypt certificate due to the following error:
PLESK_ERROR: Failed to updated ip. Can’t set to addon domain ip different from webspace ip
-
There are subdomains and/or additional domains under the affected subscription.
-
The following error is displayed while accessing the WordPress Admin Panel or saving settings via WordPress Admin Panel:
PHP has encountered an Access Violation at XXXXX
Cause
psa
database inconsistency. There are different IP addresses set on additional domains and subdomains under the affected subscription.
Resolution
For Linux
-
Connect to the server via SSH.
-
Create a backup of the
psa
database:# plesk db dump psa > /root/psa_backup.sql
-
Download the attached script:
# wget https://plesk.zendesk.com/hc/article_attachments/115001860533/script_kb213376309
-
Make the script executable:
# chmod +x script_kb213376309
-
Launch the script for the affected subscription:
Note: change the “example.com” website in the command below to the correct one.
# ./script_kb213376309 example.com
-
If an error like below appears:
ERROR 1062 (23000) at line 5: Duplicate entry '123-789' for key 'PRIMARY' exit status 1
find the duplicate record in the database:
Note: change the “123” ipCollectionId in the command below to the correct one based on the error message regarding the duplicate entry.
# plesk db “select * from IpAddressesCollections where ipCollectionId=123;”
+—————-+————-+
| ipCollectionId | ipAddressId |
+—————-+————-+
| 123 | 789 |
| 123 | 456 |
+—————-+————-+ -
Remove the duplicate record from the database:
Note: change the “123” ipCollectionId in the command below to the correct one based on the error message regarding the duplicate entry
Change the “456” ipAddressId in the command below to the correct one based on the output from the previous step.
# plesk db “delete from IpAddressesCollections where ipCollectionId=123 and ipAddressId=456;”
For Windows
-
Connect to the server via RDP.
-
Run the Command Prompt as administrator.
-
Create a backup of the
psa
database:C:> plesk db dump psa > C:psa_backup.sql
-
Connect to Plesk database:
C:> plesk db
-
Declare a variable with the affected website:
Note: change the “example.com” website in the command below to the correct one.
MYSQL_WIN: set @name:=’example.com’;
-
Run the following SQL queries one by one:
MYSQL_WIN: SELECT IP_Addresses.id FROM IP_Addresses LEFT JOIN dom_param ON dom_param.val=IP_Addresses.id AND dom_param.param=’ip_addr_id’ LEFT JOIN domains d ON d.id=dom_param.dom_id WHERE [email protected] into @ip_id;
UPDATE dom_param SET [email protected]_id WHERE param=’ip_addr_id’ AND dom_id IN (SELECT id FROM domains WHERE [email protected] OR webspace_id = (SELECT id FROM domains WHERE [email protected]));
UPDATE IpAddressesCollections set [email protected]_id where ipCollectionId in (select ipCollectionId from DomainServices where type=’web’ AND dom_id in (select id from domains where [email protected] OR webspace_id = (select id from domains where [email protected])));
-
If an error like below appears:
ERROR 1062 (23000) at line 5: Duplicate entry '123-789' for key 'PRIMARY' exit status 1
find the duplicate record in the…