Applicable to:
- Plesk Onyx for Linux
- Plesk Onyx for Windows
Symptoms
Unable to activate Tools & Settings > Web Application Firewall (ModSecurity) in Plesk with the following error:
PLESK_ERROR: Failed to install the Mod-security rule set: Unable to find row with id 221 in domains table.
OR
PLESK_ERROR: Db_Table_Exception: Unable to find row with id 221 in domains table.
OR
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.
-
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
- 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;
Comments
3 comments
Still getting the same error.
Hi!
I'd like to investigate this issue deeper, so I will create a ticket for you.
We had same issue.
Failed to install the ModSecurity rule set: Unable to find row with id 11 in domains table.Unable to use the current ModSecurity rule set and to roll back to the previous version because they contain invalid rules.
Below solution worked for me,
Check whether the domain exists in the server with the same ID.
mysql> select * from domains where id=916;
Empty set (0.00 sec)
Check whether the Application pool entry exists in 'IisAppPools' for that particular domain id.
mysql> select id from IisAppPools where ownerId=916;
+-----+
| id |
+-----+
| 188 |
+-----+
1 row in set (0.00 sec)
Remove record:
mysql> delete from IisAppPools where ownerId=916;
Query OK, 1 row affected (0.03 sec)
Enable mod_security again.
Please sign in to leave a comment.