Applicable to:
- Plesk for Linux
- Plesk for Windows
Symptoms
When activating or updating ModSecurity rule-set in Plesk at Tools & Settings > Web Application Firewall (ModSecurity), the operation fails with:
PLESK_ERROR: Unable to find row with id X in domains table.
Cause
Inconsistency in the Plesk database: orphaned records exist in the psa.IisAppPools
table.
Resolution
-
Connect to the Plesk server via SSH.
-
# plesk db dump psa > /root/psa_dump.sql
-
Repair the Plesk database:
# plesk repair db -y
-
Go to Tools & Settings > Web Application Firewall (ModSecurity), and click OK to update/activate the rule-set.
Note: If the error message is still shown, select another rule-set and apply the changes. Then switch back to previous rule-set.
-
Connect to the Plesk server via RDP.
-
C:\> plesk db dump psa > C:\psa_dump.sql
-
Repair the Plesk database:
C:\> plesk repair db -y
-
Open the Plesk database in MySQL:
C:\> plesk db
-
Remove the orphaned entries:
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;
-
Go to Tools & Settings > Web Application Firewall (ModSecurity), and click OK to update/activate the rule-set.
Note: If the error message is still shown, select another rule-set and apply the changes. Then switch back to previous rule-set.
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.