Articles in this section

Plesk repair db utility shows warning: The IP address collection with the ID X is being used by Y different domain services

Plesk for Linux kb: technical

Applicable to:

  • Plesk for Linux

Symptoms

plesk repair db utility shows the warning:

# plesk repair db -n
...
Checking the consistency of the Plesk database
  The IP address collection with the ID 123 is being used by 280
  different domain services, which may lead to Plesk issues ......... [WARNING]
Error messages: 0; Warnings: 1; Errors resolved: 0

Cause

Inconsistency in the Plesk database: records in DomainServices table were not properly updated.

Resolution

  1. Connect to your Plesk server via SSH.
  2. For safety reasons, create a backup of the Plesk database:

    # plesk db dump psa > /root/psa.sql

  3. In the command below, replace 123 with the value from the warning message. Then run the command to collect IDs of all domains which share the same ipCollectionId:

    # plesk db -Ne "SELECT ds.id FROM domains d JOIN DomainServices ds ON ds.dom_id = d.id WHERE ds.ipCollectionId = 123" > ipCollectionId.txt

  4. List all IP addresses registered in Plesk and their IDs:

    # plesk db "select id,ip_address from IP_Addresses"

  5. In the command below, replace X with IP address ID from step 4 and run it. The command will update the records in DomainServices and create the new records in IpCollections and IpAddressesCollections with the proper values:

    # cat ipCollectionId.txt | while read i; do 
    plesk db "INSERT INTO IpCollections VALUES (NULL);
    SET @new_col = LAST_INSERT_ID();
    INSERT INTO IpAddressesCollections (ipCollectionId, ipAddressId) VALUES (@new_col, X);
    UPDATE DomainServices SET ipCollectionId = @new_col WHERE id = $i" ; done

  6. Rerun plesk repair db utility to confirm that the warnings have been resolved:

    # plesk repair db -n

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.