- Plesk for Windows
- Plesk for Linux
An attempt to delete an IP address from Plesk fails with the following error:
Error: The IP address `<ip_address>` is already used for hosting.
However, in Tools & Settings > IP Addresses, no sites are shown to use this IP address.
This is caused by a Plesk database inconsistency. The
table was not correctly updated when IP addresses were changed for domains.
1. Login to Plesk via SSH
2. Back up Plesk database
3. Login to MySQL server
4. Find out which "
" is assigned to the IP address in question, and find any (sub)domains that have this IP address assigned:
MYSQL_LIN: mysql> select @ip_id := id from IP_Addresses where ip_address='203.0.113.2';
mysql> SELECT d.name, d.webspace_id, ipac.ipCollectionId,ds.type,ip.ip_address FROM DomainServices ds INNER JOIN IpAddressesCollections ipac ON ds.ipCollectionId = ipac.ipCollectionId INNER JOIN domains d ON d.id = ds.dom_id JOIN IP_Addresses ip on ipac.ipaddressid=ip.id WHERE (ds.type = 'web' OR ds.type = 'mail') and ipac.ipAddressId = @ip_id;
Make sure the 203.0.113.2
5. Find records in the
table that correspond to the IP address in question:
MYSQL_LIN: mysql> select * from IpAddressesCollections where [email protected]_id;
6. Find out which
is assigned to the IP address that should be used for the (sub)domains from the previous output, then update the corresponding records of the
table. For example, the 203.0.113.3
MYSQL_LIN: mysql> set @domain_name := 'example.com';
mysql> select @ip_id_new := id from IP_Addresses where ip_address='203.0.113.3';
mysql> update IpAddressesCollections ipac INNER JOIN DomainServices ds ON ds.ipCollectionId = ipac.ipCollectionId INNER JOIN domains d ON d.id = ds.dom_id JOIN IP_Addresses ip on ipac.ipaddressid=ip.id set [email protected]_id_new WHERE (ds.type = 'web' OR ds.type = 'mail') and ipac.ipAddressId = @ip_id and [email protected]_name;