Symptoms

Attempt to remove a domain via API fails with the following error:

com.parallels.pa.corba.ServiceInvoker AuthenticationManager invocation failedjavax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.ConstraintViolationException: could not execute statement 

Similar message is shown in OA main system log:

Mar 30 11:22:11 osscore : DBG [UI:9a256a22:50604873:1459329720463 RequestProcessor-352300 pau ]: com.parallels.pa.corba.ServiceInvoker AuthenticationManager invocation failedjavax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.ConstraintViolationException: could not execute statement#012#011at 

Cause

The domain has a service user that is bound to a disabled subscription:

select * from users where domain_id =1234567;
-[ RECORD 1 ]-----------+---------------------
user_id                 | 1231231
....
sub_id                  | 12345
domain_id               | 1234567
dns_path_of_domain_part | tld.domain
locked_by               |
deleting                | n

select is_active from subscriptions where sub_id = 12345;
is_active
-----------
        0

Resolution

Remove this service user, then try to remove the domain again.

You might need to re-enable the subscription in order to remove the service user, the pem.enableSubscription API method can be used to do it. After the user is removed, subscription can be disabled again using the pem.disableSubscription API method.

Internal content