ModSecurity: Request body (Content-Length) is larger than the configured limit

ModSecurity: Request body (Content-Length) is larger than the configured limit

While uploading large files, you may get the following error due to mod_security.

ModSecurity: Request body (Content-Length) is larger than the configured limit (134217728). Deny with status (413) [hostname “domain.com”] [uri “/folder/folder2/file.php”] [unique_id “T-VoPZ7-KsUAABnOIf8AAAAC”]

To resolve the issue,

Modify your modsec2.conf and change the limit set for SecRequestBodyInMemoryLimit

# vi /etc/httpd/conf/modsec2.conf

search for SecRequestBodyInMemoryLimit

SecRequestBodyInMemoryLimit 531072

increase the value, save the file and restart the apache service.

Unable to load object of type IPAddress with id=1: Table->select() failed: no such row in the table

While adding a new domain or add an IP address to a client you may get the following error.

ERROR: PleskFatalException

Favorites

Visited Pages

Unable to load object of type IPAddress with id=1: Table->select() failed: no such row in the table

0: common_func.php3:3159

objectMakerEx(string ‘IPAddress’, integer ‘1’)

1: IPPoolManager.php:968

IPPoolManager::toString(integer ‘1’)

2: indicator-ip.php:22

plesk__indicator_ip->renderHtml()

3: IndicatorUIPointer.php:13

IndicatorUIPointer->accessItem(string ‘INDICATOR’, NULL null)

4: UIPointer.php:596

UIPointer->access(string ‘INDICATOR’)

5: DashboardElement.php:1582

DashboardElement_indicator->renderHtml(object of type UserAdmin, NULL null)

6: DashboardElement.php:680

DashboardElement->renderHtml_indicators(array, object of type UserAdmin, NULL null)

7: DashboardElement.php:634

DashboardElement->renderHtml_common(array, object of type UserAdmin, NULL null)

8: DashboardElement.php:991

DashboardElement_top->renderHtml(object of type UserAdmin, NULL null)

This is because plesk tries to check the IP which is not in the IP Address Pool or which is not removed properly or unknown IP. To resolve the issue, you will have to find that IP and remove it from the server.

# mysql -uadmin -p'cat /etc/psa/.psa.shadow' -Dpsa

You will see the list of id numbers in the first column followed by the addresses in the second column.

Perform the modification of the component_id table as,

mysql> select id,ip_address from IP_Addresses;
 +----+----------------+
 | id | ip_address |
 +----+----------------+
 | 6 | 192.168.0.2 |
 | 7 | 192.168.0.3 |
 | 8 | 192.168.0.4 |

In above output the IDs are 6,7 and 8. Its supposed to be 1,2 and 3. To change the IDs

mysql> update IP_Addresses set id=1 where ip_address='192.168.0.2';
 Query OK, 1 row affected (0.01 sec)
 Rows matched: 1 Changed: 1 Warnings: 0
 mysql> update IP_Addresses set id=2 where ip_address='192.168.0.3';
 Query OK, 1 row affected (0.00 sec)
 Rows matched: 1 Changed: 1 Warnings: 0
 mysql> update IP_Addresses set id=3 where ip_address='192.168.0.4';
 Query OK, 1 row affected (0.01 sec)
 Rows matched: 1 Changed: 1 Warnings: 0
 Confirm the ID changes by
 mysql> select id,ip_address from IP_Addresses;
 +----+----------------+
 | id | ip_address |
 +----+----------------+
 | 1 | 192.168.0.2 |
 | 2 | 192.168.0.3 |
 | 3 | 192.168.0.4 |

now, check the plesk, it should be working fine. 🙂

Fatal error: Class ‘NOOP_Translations’ not found in l10n.php

Sometimes you may face the following error for a wordpress website.

Fatal error: Class ‘NOOP_Translations’ not found in wp-includes/l10n.php

This issue can be resolved by simply deleting/renaming current translations.php file in wp-includes/pomo folder and reupload it from current version of the wordpress.

# mv wp-includes/pomo/translations.php wp-includes/pomo/translations.php.bk

Download the wordpress installer on local PC, extract it and copy/upload the file from wp-includes/pomo to wp-includes/pomo folder on your server.

That’s it!