Symptoms

The existing PA customer placed new Sales Order for POA subscription. PBA cannot process the order with generic error message which says that new entry cannot be added to POA database in the 'accounts' table:

`Service Creation Failed: Parallels Operations Automation error #extype_id=1; module_id=db_service; 'ERROR: 重複キーが一意性制約"account_pk"に違反しています;
 Error while executing the query' while ' INSERT INTO accounts ( account_id , owner_id , account_type , is_personal , rt_instance_id , path , address_id , company_name , adm_contact_id , bill_contact_id , tech_contact_id , l_language_code_default , l_country_code_default , l_variant_default , l_language_code , l_country_code , l_variant ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )'.`

Pay attention to the fact taht error message from POA is provided in non-English language.

Cause

During Sales Order processing PBA always sends request pem.addAccount to POA to create customer account. If customer account already exists then POA replies with the following error message:

`Account #1000006 already exists.`

PBA correctly processes such error message from POA and continues to process Sales Order.

In case English locale is configured in PostgreSQL database POA may correctly process the situation when PBA is trying to create customer account which already exists, see the example below:

`Nov 28 07:57:13 poa : DBG [1:25278:b5ff0b90:4247 1:25278:b6effb90 Kernel]: STMT [Con: 9237, 0xaeb82558 txn:615083] ' INSERT INTO  accounts ( account_id ,  owner_id ,  account_type ,  is_personal ,  rt_instance_id ,  path ,  address_id ,  company_name ,  adm_contact_id ,  bill_contact_id ,  tech_contact_id ,  l_language_code_default ,  l_country_code_default ,  l_variant_default ,  l_language_code ,  l_country_code ,  l_variant ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )'($0 = 1000006, $1 = 1, $2 = 3, $3 = 'n', $4 = 2, $5 = 'x1x1000006', $6 = 503, $7 = 'John Doe', $8 = 935, $9 = 935, $10 = 935, $11 = 'en', $12 = 'US', $13 = '', $14 = 'en', $15 = 'US', $16 = '')
 Nov 28 07:57:13 poa : DBG [1:25278:b5ff0b90:4247 1:25278:b6effb90 lib]: [txn:615083 DB::Statement::execQuery] {module_id="db_service"; code="110"} Duplicate key violates unique constraint 'account_pk' while executing ' INSERT INTO  accounts ( account_id ,  owner_id ,  account_type ,  is_personal ,  rt_instance_id ,  path ,  address_id ,  company_name ,  adm_contact_id ,  bill_contact_id ,  tech_contact_id ,  l_language_code_default ,  l_country_code_default ,  l_variant_default ,  l_language_code ,  l_country_code ,  l_variant ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )'.
 Nov 28 07:57:13 poa : DBG [1:25278:b5ff0b90:4247 1:25278:b6effb90 lib]: CORBA_1:25278:b5ff0b90 </1> EXCEPTION
 Nov 28 07:57:13 poa : DBG [SYSTEM 1:25278:b5ff0b90 lib]: [txn:615083 AccountManagement::AccountCreator::create] {module_id="AccountManagement"; code="50"; old_code="7"} Account #1000006 already exists.
 Nov 28 07:57:13 poa : DBG [SYSTEM 1:25278:b5ff0b90 AccountManagement]: [txn:615083 AccountManagement::AccountCreator::create] <=== EXIT (by exception) [0.032309]`

In this case POA correctly throws exception 'Account #1000006 already exists' because it can correctly recognize the reply from PostgreSQL database engine.

In case non-English locale is configured in PostgreSQL database POA cannot correctly parse error message from database engine:

`Nov 27 19:58:13 poa: DBG [SYSTEM 1:32713:b389fb90 Kernel]: STMT [Con: 5908, 0xabe2af58 txn:463171] ' INSERT INTO  accounts ( account_id ,  owner_id ,  account_type ,  is_personal ,  rt_instance_id ,  path ,  address_id ,  company_name ,  adm_contact_id ,  bill_contact_id ,  tech_contact_id ,  l_language_code_default ,  l_country_code_default ,  l_variant_default ,  l_language_code ,  l_country_code ,  l_variant ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )'($0 = 1000925, $1 = 1, $2 = 3, $3 = 'n', $4 = 2, $5 = 'x1x1000925', $6 = 2608, $7 = 'パラレルス', $8 = 4837, $9 = 4837, $10 = 4837, $11 = 'en', $12 = 'US', $13 = '', $14 = 'en', $15 = 'US', $16 = '')
 Nov 27 19:58:13 poa : ERR [SYSTEM 1:32713:b389fb90 lib]: [txn:463171 DB::Statement::execQuery] {module_id="db_service"; code="1"} 'ERROR:  重複キーが一意性制約"account_pk"に違反しています; Error while executing the query' while ' INSERT INTO  accounts ( account_id ,  owner_id ,  account_type ,  is_personal ,  rt_instance_id ,  path ,  address_id ,  company_name ,  adm_contact_id ,  bill_contact_id ,  tech_contact_id ,  l_language_code_default ,  l_country_code_default ,  l_variant_default ,  l_language_code ,  l_country_code ,  l_variant ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )'
 Nov 27 19:58:13 poa : DBG [SYSTEM 1:32713:b389fb90 AccountManagement]: [txn:463171 AccountManagement::AccountCreator::create] <=== EXIT (by exception) [0.036285]`

As the restul POA throws generic error message to PBA, PBA cannot process this generic error message and stops to process Sales Order.

Resolution

Change system error messages locale on POA PostgreSQL Database Server to en_US.UTF-8:

  1. Log into POA PostgreSQL Database Server and POA Management Node by SSH as root.
  2. Set the parameter lc_messages in the PostgreSQL configuration file '/var/lib/pgsql/data/postgresql.conf' to 'en_US.UTF-8':

    `lc_messages = 'en_US.UTF-8'`
    
  3. Stop POA service on POA Management Node:

    `# /etc/init.d/pem stop`
    
  4. Stop PostgreSQL service on POA Database Server:

    `# /etc/init.d/postgresql-9.0 stop`
    
  5. Start PostgreSQL service on POA Database Server:

    `# /etc/init.d/postgresql-9.0 start`
    
  6. Start POA service on POA Management Node:

    `# /etc/init.d/pem start`
    
  7. Re-submit failed order in PBA for provisioning.

Internal content