• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

Plesk Firewall or DNS Broke

dalydesign

Basic Pleskian
I'm currently on the latest version of plesk. The server is only a month old.

I added a new rule to the firewall, to open ports 49152-65534 for Passive FTP
I also opened Port 26 as an alternative SMTP port.

Now when I apply my firewall rules, I receive the following error:

MySQL query failed: Duplicate entry '1-2-0' for key 'configuration_id'

the problem now is that it has knocked out a few of my domains, but not all!!! When I try to access some of the domains on the server, some will load, others are blocked.

there are no related error messages in /var/log/messages
There are no related error messages in /var/log/mysqld.log
There are no related error messages in /var/log/sw-cp-server/error_log
 
In order to overcome this issue, I have tried to uninstall psa-firewall, then reinstall it

Here's the log from /var/log/plesk/panel.log

Code:
[2015-10-20 14:37:19] ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/f2bmng' '--status'] with exit code [1]
[2015-10-20 14:37:19] ERR [1] '/usr/local/psa/admin/bin/f2bmng' '--status' failed with code 1.

stdout:


stderr:
ERROR:f2bmng:Timeout of 10 seconds has been reached. Lock 'service.fail2ban' is already owned by another process with pid <unknown>

[2015-10-20 14:39:54] ERR [1] DB query failed:
insert into module_firewall_rules (configuration_id, direction, priority, object) values (1, 0, 6, "a:6:{s:4:\"type\";s:7:\"service\";s:5:\"class\";s:6:\"tomcat\";s:9:\"direction\";s:5:\"input\";s:5:\"ports\";a:2:{i:0;s:8:\"9008/tcp\";i:1;s:8:\"9080/tcp\";}s:6:\"action\";s:5:\"allow\";s:10:\"originalId\";s:1:\"9\";}")

Error: Duplicate entry '1-0-6' for key 'configuration_id'
[2015-10-20 14:39:55] ERR [panel] MySQL query failed: Duplicate entry '1-0-6' for key 'configuration_id':
0: /usr/local/psa/admin/plib/db.php:89
    db_query(string 'insert into module_firewall_rules (configuration_id, direction, priority, object) values (1, 0, 6, "a:6:{s:4:\"type\";s:7:\"service\";s:5:\"class\";s:6:\"tomcat\";s:9:\"direction\";s:5:\"input\";s:5:\"ports\";a:2:{i:0;s:8:\"9008/tcp\";i:1;s:8:\"9080/tcp\";}s:6:\"action\";s:5:\"allow\";s:10:\"originalId\";s:1:\"9\";}")')
1: /usr/local/psa/admin/plib/db.php:155
    db_query_ex(string 'insert into module_firewall_rules (configuration_id, direction, priority, object) values (?(configuration), ?(direction), ?(priority), "?(object)")', array)
2: /usr/local/psa/admin/plib/modules/firewall/FwConfigurator.php:142
    FwConfigurator->copyConfiguration(integer '2', integer '1')
3: /usr/local/psa/admin/plib/modules/firewall/ui/modules.firewall.edit.activate.php:38
    plesk__modules__firewall__edit__activate->accessItem(string 'POST', NULL null)
4: /usr/local/psa/admin/plib/UIPointer.php:619
    UIPointer->access(string 'POST')
5: /usr/local/psa/admin/htdocs/plesk.php:36
[2015-10-20 14:39:55] ERR [1] MySQL query failed: Duplicate entry '1-0-6' for key 'configuration_id'
[2015-10-20 15:38:18] ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/f2bmng' '--status'] with exit code [1]
[2015-10-20 15:38:18] ERR [1] '/usr/local/psa/admin/bin/f2bmng' '--status' failed with code 1.

stdout:


stderr:
ERROR:f2bmng:Timeout of 10 seconds has been reached. Lock 'service.fail2ban' is already owned by another process with pid <unknown>

[2015-10-20 15:47:10] ERR [1] DB query failed:
insert into module_firewall_rules (configuration_id, direction, priority, object) values (1, 0, 16, "a:6:{s:4:\"type\";s:7:\"service\";s:5:\"class\";s:3:\"www\";s:9:\"direction\";s:5:\"input\";s:5:\"ports\";a:2:{i:0;s:6:\"80/tcp\";i:1;s:7:\"443/tcp\";}s:6:\"action\";s:5:\"allow\";s:10:\"originalId\";s:2:\"19\";}")

Error: Duplicate entry '1-0-16' for key 'configuration_id'
[2015-10-20 15:47:11] ERR [panel] MySQL query failed: Duplicate entry '1-0-16' for key 'configuration_id':
0: /usr/local/psa/admin/plib/db.php:89
    db_query(string 'insert into module_firewall_rules (configuration_id, direction, priority, object) values (1, 0, 16, "a:6:{s:4:\"type\";s:7:\"service\";s:5:\"class\";s:3:\"www\";s:9:\"direction\";s:5:\"input\";s:5:\"ports\";a:2:{i:0;s:6:\"80/tcp\";i:1;s:7:\"443/tcp\";}s:6:\"action\";s:5:\"allow\";s:10:\"originalId\";s:2:\"19\";}")')
1: /usr/local/psa/admin/plib/db.php:155
    db_query_ex(string 'insert into module_firewall_rules (configuration_id, direction, priority, object) values (?(configuration), ?(direction), ?(priority), "?(object)")', array)
2: /usr/local/psa/admin/plib/modules/firewall/FwConfigurator.php:142
    FwConfigurator->copyConfiguration(integer '2', integer '1')
3: /usr/local/psa/admin/plib/modules/firewall/ui/modules.firewall.edit.activate.php:38
    plesk__modules__firewall__edit__activate->accessItem(string 'POST', NULL null)
4: /usr/local/psa/admin/plib/UIPointer.php:619
    UIPointer->access(string 'POST')
5: /usr/local/psa/admin/htdocs/plesk.php:36
[2015-10-20 15:47:11] ERR [1] MySQL query failed: Duplicate entry '1-0-16' for key 'configuration_id'
[2015-10-20 16:05:01] ERR [1] DB query failed:
insert into module_firewall_rules (configuration_id, direction, priority, object) values (1, 0, 16, "a:6:{s:4:\"type\";s:7:\"service\";s:5:\"class\";s:3:\"www\";s:9:\"direction\";s:5:\"input\";s:5:\"ports\";a:2:{i:0;s:6:\"80/tcp\";i:1;s:7:\"443/tcp\";}s:6:\"action\";s:5:\"allow\";s:10:\"originalId\";s:2:\"19\";}")

Error: Duplicate entry '1-0-16' for key 'configuration_id'
[2015-10-20 16:05:02] ERR [panel] MySQL query failed: Duplicate entry '1-0-16' for key 'configuration_id':
0: /usr/local/psa/admin/plib/db.php:89
    db_query(string 'insert into module_firewall_rules (configuration_id, direction, priority, object) values (1, 0, 16, "a:6:{s:4:\"type\";s:7:\"service\";s:5:\"class\";s:3:\"www\";s:9:\"direction\";s:5:\"input\";s:5:\"ports\";a:2:{i:0;s:6:\"80/tcp\";i:1;s:7:\"443/tcp\";}s:6:\"action\";s:5:\"allow\";s:10:\"originalId\";s:2:\"19\";}")')
1: /usr/local/psa/admin/plib/db.php:155
    db_query_ex(string 'insert into module_firewall_rules (configuration_id, direction, priority, object) values (?(configuration), ?(direction), ?(priority), "?(object)")', array)
2: /usr/local/psa/admin/plib/modules/firewall/FwConfigurator.php:142
    FwConfigurator->copyConfiguration(integer '2', integer '1')
3: /usr/local/psa/admin/plib/modules/firewall/ui/modules.firewall.edit.activate.php:38
    plesk__modules__firewall__edit__activate->accessItem(string 'POST', NULL null)
4: /usr/local/psa/admin/plib/UIPointer.php:619
    UIPointer->access(string 'POST')
5: /usr/local/psa/admin/htdocs/plesk.php:36
[2015-10-20 16:05:02] ERR [1] MySQL query failed: Duplicate entry '1-0-16' for key 'configuration_id'
[2015-10-20 16:08:01] ERR [1] DB query failed:
insert into module_firewall_rules (configuration_id, direction, priority, object) values (1, 1, 0, "a:5:{s:4:\"type\";s:8:\"catchall\";s:5:\"class\";s:8:\"catchall\";s:9:\"direction\";s:6:\"output\";s:6:\"action\";s:5:\"allow\";s:10:\"originalId\";s:1:\"3\";}")

Error: Duplicate entry '1-1-0' for key 'configuration_id'
[2015-10-20 16:08:02] ERR [panel] MySQL query failed: Duplicate entry '1-1-0' for key 'configuration_id':
0: /usr/local/psa/admin/plib/db.php:89
    db_query(string 'insert into module_firewall_rules (configuration_id, direction, priority, object) values (1, 1, 0, "a:5:{s:4:\"type\";s:8:\"catchall\";s:5:\"class\";s:8:\"catchall\";s:9:\"direction\";s:6:\"output\";s:6:\"action\";s:5:\"allow\";s:10:\"originalId\";s:1:\"3\";}")')
1: /usr/local/psa/admin/plib/db.php:155
    db_query_ex(string 'insert into module_firewall_rules (configuration_id, direction, priority, object) values (?(configuration), ?(direction), ?(priority), "?(object)")', array)
2: /usr/local/psa/admin/plib/modules/firewall/FwConfigurator.php:142
    FwConfigurator->copyConfiguration(integer '2', integer '1')
3: /usr/local/psa/admin/plib/modules/firewall/ui/modules.firewall.edit.activate.php:38
    plesk__modules__firewall__edit__activate->accessItem(string 'POST', NULL null)
4: /usr/local/psa/admin/plib/UIPointer.php:619
    UIPointer->access(string 'POST')
5: /usr/local/psa/admin/htdocs/plesk.php:36
[2015-10-20 16:08:02] ERR [1] MySQL query failed: Duplicate entry '1-1-0' for key 'configuration_id'
[2015-10-20 16:18:49] ERR [panel] PleskBadURIException: Unknown or inappropriate locator: firewall
[2015-10-20 16:18:53] ERR [panel] PleskBadURIException: Unknown or inappropriate locator: firewall
[2015-10-20 16:18:56] ERR [panel] PleskBadURIException: Unknown or inappropriate locator: firewall
[2015-10-20 16:18:59] ERR [panel] PleskBadURIException: Unknown or inappropriate locator: firewall
[2015-10-20 16:19:02] ERR [panel] PleskBadURIException: Unknown or inappropriate locator: firewall
[2015-10-20 16:19:06] ERR [panel] PleskBadURIException: Unknown or inappropriate locator: firewall
[2015-10-20 16:19:10] ERR [panel] PleskBadURIException: Unknown or inappropriate locator: firewall
[2015-10-20 16:19:13] ERR [panel] PleskBadURIException: Unknown or inappropriate locator: firewall
[2015-10-20 16:19:17] ERR [panel] PleskBadURIException: Unknown or inappropriate locator: firewall
[2015-10-20 16:19:21] ERR [panel] PleskBadURIException: Unknown or inappropriate locator: firewall
[2015-10-20 16:19:29] ERR [1] DB query failed:
select object from module_firewall_objects where tag = "bootstrapped"
 
At this point I had uninstalled the firewall, and was now re-installing it.

Then I re-added 2 firewall rules (to block MySQL unless its my IP, and to open Port 26 again)
So here's the rest of the log since its been back up and running....

Code:
Error: Table 'psa.module_firewall_objects' doesn't exist

[2015-10-20 16:19:31] ERR [panel] MySQL query failed: Table 'psa.module_firewall_objects' doesn't exist:

0: /usr/local/psa/admin/plib/db.php:89

    db_query(string 'select object from module_firewall_objects where tag = "bootstrapped"')

1: /usr/local/psa/admin/plib/db.php:155

    db_query_ex(string 'select object from module_firewall_objects where tag = "?(tag)"', array)

2: /usr/local/psa/admin/plib/modules/firewall/FwConfigurator.php:55

    FwConfigurator->loadObject(string 'bootstrapped')

3: /usr/local/psa/admin/plib/modules/firewall/FwConfigurator.php:40

    FwConfigurator->FwConfigurator(boolean true)

4: /usr/local/psa/admin/plib/modules/firewall/FwConfigurator.php:27

    FwConfigurator::getInstance()

5: /usr/local/psa/admin/plib/modules/firewall/ui/modules.firewall.edit.activate.php:17

    plesk__modules__firewall__edit__activate->accessItem(string 'GET', NULL null)

6: /usr/local/psa/admin/plib/UIPointer.php:619

    UIPointer->access(string 'GET')

7: /usr/local/psa/admin/htdocs/plesk.php:36

[2015-10-20 16:19:31] ERR [1] MySQL query failed: Table 'psa.module_firewall_objects' doesn't exist

[2015-10-20 16:20:46] ERR [panel] Invalid URL was requested.

[2015-10-20 16:20:47] ERR [panel] Invalid URL was requested.

[2015-10-20 16:24:10] ERR [1] DB query failed:

insert into module_firewall_rules (configuration_id, direction, priority, object) values (1, 2, 0, "a:5:{s:4:\"type\";s:8:\"catchall\";s:5:\"class\";s:8:\"catchall\";s:9:\"direction\";s:7:\"forward\";s:6:\"action\";s:4:\"deny\";s:10:\"originalId\";s:1:\"1\";}")




Error: Duplicate entry '1-2-0' for key 'configuration_id'

[2015-10-20 16:24:11] ERR [panel] MySQL query failed: Duplicate entry '1-2-0' for key 'configuration_id':

0: /usr/local/psa/admin/plib/db.php:89

    db_query(string 'insert into module_firewall_rules (configuration_id, direction, priority, object) values (1, 2, 0, "a:5:{s:4:\"type\";s:8:\"catchall\";s:5:\"class\";s:8:\"catchall\";s:9:\"direction\";s:7:\"forward\";s:6:\"action\";s:4:\"deny\";s:10:\"originalId\";s:1:\"1\";}")')

1: /usr/local/psa/admin/plib/db.php:155

    db_query_ex(string 'insert into module_firewall_rules (configuration_id, direction, priority, object) values (?(configuration), ?(direction), ?(priority), "?(object)")', array)

2: /usr/local/psa/admin/plib/modules/firewall/FwConfigurator.php:142

    FwConfigurator->copyConfiguration(integer '2', integer '1')

3: /usr/local/psa/admin/plib/modules/firewall/ui/modules.firewall.edit.activate.php:38

    plesk__modules__firewall__edit__activate->accessItem(string 'POST', NULL null)

4: /usr/local/psa/admin/plib/UIPointer.php:619

    UIPointer->access(string 'POST')

5: /usr/local/psa/admin/htdocs/plesk.php:36

[2015-10-20 16:24:11] ERR [1] MySQL query failed: Duplicate entry '1-2-0' for key 'configuration_id'
 
I have logged into the psa database and deleted 2 custom records from module_firewall_rules table (duplicate port 26 rules).

Then uninstalled Firewall, Then reinstalled it just to be safe (it deleted the module_firewall_rules table anyway!! lol).

Firewall behaving properly now, but some domains not working still. Could not telnet port 53, but other ports were ok.

Then switched DNS off/On for one of the affected domains and was then able to telnet 53 successfully!

So the DNS now working again! ...until I tester the server. ....then the DNS is broke again... So I go to a domain, switch it's DNS config to disabled, then re-enable. ....and it works again.

I've rebooted several times and same things happened again.... Disable/re-enable any domain DNS config and it fixes it until next reboot.!
 
Last edited:
Back
Top