• 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

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