Unable to load object of type IPAddress in Plesk Control Panel

0

Getting following Error while add a new subscription Plesk Control Panel.

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

Cause :-

The error means that IP pool of ” VPS / Contains” refer to IP address that does not exist in the list of all available IP addresses in Plesk database.
Usually it happen if IP addresses are removed not through Panel interface from Plesk >> Settings >> IP addresses page but directly from ‘IP_Addresses’ table of Plesk database.
Such problem also exist if clone of a “VPS / Container” with already installed Plesk was used. As old “VPS / Container” are already having old IP address in there database. When new IP address was added and Old IP was removed, such problem persist.

Solution :-

Make sure that you have already read the new IP addresses into Plesk by logging into the Plesk control panel >> Settings >> IP addresses >> Reread IP

Now Login to mysql as Plesk admin
[root@vps9999 ~]# mysql -uadmin -p`cat /etc/psa/.psa.shadow` -Dpsa
Use psa database.
mysql> use psa
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 | xxx.xxx.xxx.164 |
| 7 | xxx.xxx.xxx.165 |
| 8 | xxx.xxx.xxx.222 |
You could see the output above, the id is 6, 7 and 8, It supposed to be in sequence like 1, 2 and 3.

Then update the table accordingly as,
mysql> update IP_Addresses set id=1 where ip_address=’xxx.xxx.xxx.164′;
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=’xxx.xxx.xxx.165′;
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=’xxx.xxx.xxx.222′;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0
Verify the changes as,
mysql> select id,ip_address from IP_Addresses;
+—-+—————-+
| id | ip_address |
+—-+—————-+
| 1 | xxx.xxx.xxx.164 |
| 2 | xxx.xxx.xxx.165 |
| 3 | xxx.xxx.xxx.222 |
Once this was done, check the Plesk Home page in Plesk Control Panel. It works fine.

Note :- Replace xxx.xxx.xxx with your original IP address values.
============================================>

Error message “no such row in the table” shows up when I click on IP Pool

0

Error message “no such row in the table” shows up when I click on IP Pool under a Client

Symptoms

When I click on Clients > a Client > IP Pool icon, the following error message is shown:

Unable to create IP Address object: Table->select() failed: no such row in the table

0: /usr/local/psa/admin/plib/common_func.php3:156
psaerror(string ‘Unable to create IP Address object: Table->select() failed: no such row in the table’)
1: /usr/local/psa/admin/plib/class.IPPoolList.php:120
ipPoolList->fetchIPPoolList()
2: /usr/local/psa/admin/plib/class.cList.php3:103
cList->fetchList()
3: /usr/local/psa/admin/plib/class.cList.php3:123
cList->init()
4: /usr/local/psa/admin/htdocs/clients/cl_pool.php3:81

Cause :-

The error means that the IP pool the Client contains refers to an IP address that does not exist in the list of all available IP addresses in the Parallels Plesk Panel (PP) database. Usually, this happens when IP addresses are managed not through the PP interface at the Server > IP addresses page, but directly from the “IP_Addresses” table of the PP database.

Resolution
It is necessary to find the referrer to the non-existent IP in the Client’s IP pool and remove it.

Solution :-

Make sure that you have already read the new IP addresses into Plesk by logging into the Plesk control panel >> Settings >> IP addresses >> Reread IP

1) Now Login to mysql as Plesk admin
# mysql -uadmin -p`cat /etc/psa/.psa.shadow` -Dpsa

2) Find the IP pool of the Client (substitute the real Client login instead of LOGIN below):
mysql> select login, pool_id from clients where login = ‘LOGIN’;
+——-+———+
| login | pool_id |
+——-+———+
| LOGIN | 7 |
+——-+———+

3) The IP pool is “7.” Now find the IDs of the IP addresses that are in this IP pool:
mysql> select * from Repository where rep_id = 7;
+——–+————–+
| rep_id | component_id |
+——–+————–+
| 7 | 1 |
| 7 | 2 |
| 7 | 3 |
+——–+————–+

4) IP pool 7 contains IP addresses with IDs 1, 2, and 3. Now check whether these IP addresses are in the “IP_Addresses” table:
mysql> select id, ip_address, iface from IP_Addresses where id in (1,2,3);
+—-+—————+——-+
| id | ip_address | iface |
+—-+—————+——-+
| 1 | 192.168.45.50 | rl0 |
| 2 | 192.168.45.51 | rl0 |
+—-+—————+——-+

5) As you can see, the IP address with the ID 3 does not exist. Therefore, we need to remove the record where IP pool = 7 and IP Address ID = 3 from the “psa.Repository” table:
mysql> delete from Repository where rep_id = 7 and component_id = 3;
==============================================>
Reference : http://kb.parallels.com/en/2242