While provisioning a subscription in Odin Business Automation - Standard (OBAS), the following error is shown:
subscription activating failed: failure response: status: -1, module_id: PleskIntegration, extype_id: 12, error_message: Webspace with primary domain name already exists.
Attempting to transfer a domain from Plesk to Plesk Automation (PA) fails with the following error:
[2014-03-10 15:05:49] [INFO] restore/example.com| Create webspace 'example.com' in subscription #33 [2014-03-10 15:05:50] [ERROR] restore| Failed to perform an action on subscription 'example.com': Failed to create webspace in PPA. Exception message: [None] Webspace with primary domain name example.com already exists.
[ERROR] | An internal error occurred in POA XML-RPC:  Subscription #1111 does not exist
When attempting to create webspace, the Control Panel shows an error:
Webspace with primary domain name example.com already exists.
- A domain with the same name is present in the
Websitessection. However, there is no webspace in the existing subscriptions with this name.
Orphaned database records prevent the operation from finishing. This issue is caused when webspace with the same name has been created earlier and then removed, but some tasks failed during the removal process and were canceled. As a result, the subscription was not fully removed.
Log in to the Plesk Automation (PA) Management Node as root.
Make sure that the required domain exists in the PA database:
[root@ppa ~]# psql -U plesk -h `hostname` plesk -c "select * from plesk_webspaces where domain='<domain_name>';" webspace_id | account_id | sub_id | domain | is_enabled | is_brand -------------+------------+--------+--------------------+------------+---------- 988 | 866 | 1143 | <domain_name> | y | n (1 row)
Check the related records in the
'plesk_hosts'tables (they will be empty if the subscription does not exist in PA):
plesk=> select * from plesk_hosts where webspace_id=988; webspace_id | referer | host_id | ipv4 | ipv6 -------------+---------+---------+------+------ (0 rows) plesk=> select * from subscriptions where sub_id=1143; webspace_id | referer | host_id | ipv4 | ipv6 -------------+---------+---------+------+------ (0 rows)
Make sure that the Plesk database does not contain any records for the domain:
mysql> select * from domains where name='<domain_name>'; Empty set (0.00 sec)
Go to PA control Panel > Operations > Tasks > Canceled Tasks and filter tasks by Subscription ID (the
sub_idfrom step 2). Find the canceled task 'Remove the webspace #988' and re-run it (the task should finish successfully). Afterwards, log into the OBAS Control Panel and restart the failed task.
If the canceled tasks were removed, create a backup of the PPA database using the following article, then remove the orphaned domain record from the PA database:
[root@ppa ~]# psql -U plesk -h `hostname` plesk -c "delete from plesk_webspaces where domain='<domain_name>';
NOTE:* The tables "plesk_counters", "plesk_hosts", "plesk_resource_usage", "plesk_webspace_resources" are referenced by the 'webspace_id' field on the delete cascade. As a result, removing the record from the "plesk_webspaces" table will cause the corresponding record to be removed from the other tables.
'domain'utility to make sure that there are no leftovers in the Plesk database for the corresponding domain:
# /usr/local/psa/bin/domain --remove <domain_name>
If you encounter a message that the domain does not exist, remove the corresponding entry from the database manually:
# mysql -uadmin -p`cat /etc/psa/.psa.shadow ` psa -e"delete from domains where name='example.com'"
- If the issue is related to provisioning in OBAS, log into the OBAS Control Panel and restart the failed task.