• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved Plesk repair DB - Bug

Tozz

Regular Pleskian
Plesk Onyx - Latest version with all updates installed; Debian 8 or Debian 9.

SYMPTOM:

If "plesk repair db" finds clients with a Pool ID 0 it returns a message that there is no IP Pool with ID 0. It asks the admin if it should create that IP Pool with ID 0.

EXPECTED RESULT:

plesk repair db should change the pool_id in the clients table, not create the pool as ID value of zero is invalid

ACTUAL RESULT:

New IP pool with an invalid value is created.

The 'ip_pool' table has the following layout:

Code:
MariaDB [psa]> describe ip_pool;     
+---------------+----------------------------+------+-----+---------+----------------+
| Field         | Type                       | Null | Key | Default | Extra          |
+---------------+----------------------------+------+-----+---------+----------------+
| id            | int(10) unsigned           | NO   | PRI | NULL    | auto_increment |
| ip_address_id | int(10) unsigned           | NO   | PRI | NULL    |                |
| type          | enum('shared','exclusive') | NO   |     | shared  |                |
+---------------+----------------------------+------+-----+---------+----------------+
3 rows in set (0.00 sec)

A column with an auto_increment value CAN NOT have a value of 0, unless MySQL is explicitly configured to allow the value zero in an auto_increment column. Plesk doensn't set this parameter in MySQL.

Thus, as a result nothing happens:

Code:
MariaDB [psa]> insert into ip_pool values(0, 1, 'shared');
Query OK, 1 row affected (0.00 sec)

MariaDB [psa]> delete from ip_pool where id = 0;
Query OK, 0 rows affected (0.00 sec)

MariaDB [psa]> insert into ip_pool values(0, 999, 'exclusive');   
Query OK, 1 row affected (0.00 sec)

MariaDB [psa]> select * from ip_pool where ip_address_id = 999;
+------+---------------+-----------+
| id   | ip_address_id | type      |
+------+---------------+-----------+
| 1046 |           999 | exclusive |
+------+---------------+-----------+
1 row in set (0.00 sec)

As one can see, MySQL sees the value '0' as NULL, which means instead of saving the value 0 it just uses the next auto increment counter as value.
 
Back
Top