ATF : Unique Key violation detected by database

Frank Cheung
Tera Expert

Hi, step 5 of my ATF test is failing. I am not sure how to resolve it. The error is :

 

This step failed because the client error 'FAILED TRYING TO EXECUTE ON CONNECTION glide.30 (connpid=79042): INSERT INTO task (`short_description`,`a_str_6`,`made_sla`,`assignment_group`,`upon_reject`,`a_ref_1`,`sys_updated_on`,`service_offering`,`sys_class_name`,`task_effective_number`,`closed_by`,`a_bln_1`,`number`,`sys_id`,`contact_type`,`sys_updated_by`,`opened_by`,`urgency`,`a_num_1`,`sys_created_on`,`sys_domain`,`a_str_7`,`state`,`reassignment_count`,`sys_created_by`,`knowledge`,`a_str_13`,`closed_at`,`approval`,`impact`,`due_date`,`sys_mod_count`,`active`,`business_service`,`priority`,`sys_domain_path`,`u_next_action`,`opened_at`,`a_str_5`,`a_str_1`,`escalation`,`upon_approval`,`u_life_cycle_stage`,`approval_set`,`location`,`universal_request`) VALUES('Request for an accepted software package',NULL,0,NULL,'cancel','b5c8b5fe1b57d2107dfd8326464bcb49','2025-01-28 11:54:06','656be351dbba7200e53abedffe96193c','sc_request','Q0090438',NULL,0,'REQ0466336','20d839fe1b57d2107dfd8326464bcbea',NULL,'35c8b5fe1b57d2107dfd8326464bcb49','b5c8b5fe1b57d2107dfd8326464bcb49',3,0,'2025-01-28 11:54:06','global','8483',1,0,'35c8b5fe1b57d2107dfd8326464bcb49',0,NULL,NULL,'requested',3,NULL,0,1,'c5a6244cdb827200b81e36fffe96191e',3,'/','not set','2025-01-28 11:54:06','requested','requested',0,'proceed',1,NULL,NULL,'74d839fe1b57d2107dfd8326464bcbf0') /* quilteruat010, gs:CE71B1FA1B17D2107DFD8326464BCB3E, tx:28d8713a1b57d2107dfd8326464bcb66 */
Unique Key violation detected by database ((conn=79042) Duplicate entry '20d839fe1b57d2107dfd8326464bcbea' for key 'PRIMARY')

 

FrankCheung_0-1738070372038.png

 

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@Frank Cheung 

try to give some timeout for Step 5 (10 or 15 seconds)

check this KB

Unique Key Violation error is displayed after submitting a catalog item 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi,

I tried increasing the timeout and the problem seems intermittent; it's failing more often than not.

So I should do search for "current.update()" in the client scripts?

Cheers.