Symptoms
Activating or updating ModSecurity rule set in Plesk in Tools & Settings > Web Application Firewall (ModSecurity) fails:
PLESK_ERROR: Failed to install the Mod-security rule set: Unable to find row with id 221 in domains table.
PLESK_ERROR: Db_Table_Exception: Unable to find row with id 221 in domains table.
PLESK_ERROR: Failed to update the ModSecurity rule set: Unable to find row with id 221 in domains table.
Cause
Database inconsistency.
Resolution
Note: This article is intended for use by server administrators. In case there is no administrative SSH or RDP access to the server, contact the server administrator or server provider.
Plesk for Linux
-
Connect to the server using SSH.
-
Create Plesk database dump:
# plesk db dump psa > ./psa_dump.sql
-
Run the automatic database repair:
# plesk repair db
Plesk for Windows
- Open PowerShell as administrator.
-
Create Plesk database dump:
PS plesk db dump psa | Out-File psa_dump.sql
-
Run the automatic database repair:
PS plesk repair db
-
If the issue persists, access Plesk database:
PS plesk db
-
Remove the entries for Application Pools that have no domain relations from the database:
MYSQL_WIN: DELETE i, ia FROM IisAppPools i LEFT JOIN IisAppPoolDomains ia ON i.id = ia.poolId LEFT JOIN domains d ON d.id = ia.domainId WHERE d.name IS NULL AND i.id != 1;