Symptoms
[LOGTEE]: 2013-12-22 22:33:07.745 INFO [main] ----> executing atomic action 153010-PPA-135959-upgrade-referers owner PleskIntegration
[LOGTEE]: 2013-12-22 22:33:07.845 ERROR Error trace:
[LOGTEE]: 2013-12-22 22:33:07.845 ERROR poaupdater.uSysDB.OperationalError
[LOGTEE]: ['executing stmt with params:', "UPDATE dns_record_references drr SET obj_domain = 'PPA_DNS', obj_kind = 'Domain', obj_id = (SELECT dr.domain_id FROM dns_resource_records dr WHERE dr.rr_id=drr.rr_id) WHERE obj_kind='Subscription' AND obj_domain LIKE 'Plesk%'", (), 'ERROR: duplicate key value violates unique constraint "dns_record_references_pk"\nDETAIL: Key (obj_domain, obj_kind, obj_id, rr_id)=(PPA_DNS, Domain, 119, 25597) already exists.\n']
2013-12-22 22:33:07,846 [LOGTEE]: 2013-12-22 22:33:07.846 ERROR poaupdater.uSysDB.OperationalError occurred during executing atomic action 153010-PPA-135959-upgrade-referers owner PleskIntegration
Cause
Error is caused by duplicate records in PPA database.
Resolution
It is necessary to find incorrect records and delete unnecessary record.
Access to PPA database:
# psql -h `hostname` -U plesk plesk
Find rr_id value from the error message. In our case rr_id=25597
Find all rows for rr_id=25597:
select * from dns_record_references where rr_id=25597; rr_id | obj_domain | obj_kind | obj_id -------+------------------+--------------+-------- 25597 | manual | manual | 0 25597 | PleskIntegration | Subscription | 1 25597 | PleskIntegration | Subscription | 112 (3 rows)
It is necessary to pay attention on the number of records where obj_domain = 'PleskIntegration' and obj_kind='Subscription'. Only single record should exist. In our case we need to find unnecessary record and delete it.
Find domain_id with the following query:
select domain_id from dns_resource_records where rr_id = 25597; domain_id ----------- 641 (1 row)
Using domain_id from the previous step, find the subscription on which this domain is assigned:
SELECT sub_id FROM domains d JOIN subs_resources sr ON (d.hosting_res = sr.rt_instance_id) WHERE d.domain_id = 641; sub_id -------- 1 (1 row)
It means that the domain associated with the subscription 1 (sub_id=1). It means that the record following record from the step 3 is correct.
rr_id | obj_domain | obj_kind | obj_id
-------+------------------+--------------+--------
25597 | PleskIntegration | Subscription | 1
Record with obj_id=112 can be deleted.
- In case of empty result on step 6, both records can be deleted.