java.sql.BatchUpdateException: Duplicate entry 'cmdb_ci_business_app' for key 'h549041925_category_unique_i'

Durgaprasad Voo
ServiceNow Employee
ServiceNow Employee

Hi,

Getting below error while Upgrade clone instance from NY to Paris master.

Error: java.sql.BatchUpdateException: Duplicate entry 'cmdb_ci_business_app' for key 'h549041925_category_unique_i'

What exactly the error is saying?

How can we find in which table data is getting inserted and what is the column name and value?

Stack :2020-08-18 00:05:26 (607) worker.3 worker.3 txid=43367333db22 Loading update: com.snc.cmdb/update/sys_number_5a3b28629323120028517a75e57ffbab.xml
2020-08-18 00:05:26 (622) worker.3 worker.3 txid=43367333db22 SEVERE *** ERROR *** Exception during batch statement commit to glide:testingtmobile14_1:testingtmobile14:jdbc:mysql://db175159.sjc201.service-now.com:3401/, rolling back (all or nothing): (conn=185143) Duplicate entry 'cmdb_ci_business_app' for key 'h549041925_category_unique_i'
2020-08-18 00:05:26 (624) worker.3 worker.3 txid=43367333db22 SEVERE *** ERROR *** Exception executing DBInsertOrUpdate
com.glide.db.GlideSQLException: FAILED TRYING TO EXECUTE ON CONNECTION glide.22 (connpid=185143): INSERT INTO sys_metadata (`sys_mod_count`,`sys_updated_on`,`sys_class_name`,`sys_id`,`sys_package`,`sys_update_name`,`sys_updated_by`,`sys_created_on`,`sys_name`,`sys_scope`,`sys_created_by`,`sys_policy`) VALUES(2,'2019-08-07 10:44:45','sys_number','5a3b28629323120028517a75e57ffbab','1ded51626f211100125d53eabb3ee44b','sys_number_5a3b28629323120028517a75e57ffbab','admin','2016-05-25 10:54:05','APM','global','admin',NULL),INSERT INTO sys_number (`prefix`,`number`,`sys_id`,`maximum_digits`,`category`) VALUES('APM',1000,'5a3b28629323120028517a75e57ffbab',7,'cmdb_ci_business_app')
java.sql.BatchUpdateException: (conn=185143) Duplicate entry 'cmdb_ci_business_app' for key 'h549041925_category_unique_i'
at com.glide.db.DBIError.wrapAndThrow(DBIError.java:153)
at com.glide.db.DBIError.handleException(DBIError.java:86)
at com.glide.db.StatementBatcher.commitBatch(StatementBatcher.java:595)
at com.glide.db.StatementBatcher.commitAllOrNothing(StatementBatcher.java:469)
at com.glide.db.DBCompositeAction.executeAsBatch(DBCompositeAction.java:228)
at com.glide.db.DBCompositeAction.executeChunk(DBCompositeAction.java:171)
at com.glide.db.DBCompositeAction.executeAsResultSet0(DBCompositeAction.java:108)
at com.glide.db.DBAction.executeAndReturnTable(DBAction.java:267)
at com.glide.db.DBAction.executeNormal(DBAction.java:256)
at com.glide.db.DBAction.executeAndReturnException(DBAction.java:210)
at com.glide.db.DBInsertOrUpdate.execute(DBInsertOrUpdate.java:182)
at com.glide.db.DBInsertOrUpdate.execute(DBInsertOrUpdate.java:172)
at com.glide.db.DBInsertOrUpdate.execute(DBInsertOrUpdate.java:91)
at com.glide.db.DBInsertOrUpdate.insertOrUpdateAndReturnException(DBInsertOrUpdate.java:61)
at com.glide.db.impex.load.RecordLoaderInsertUpdate.insertOrUpdate(RecordLoaderInsertUpdate.java:59)
at com.glide.db.impex.load.RecordLoaderInsertUpdate.load(RecordLoaderInsertUpdate.java:45)
at com.glide.db.impex.Loader.loadRecord0(Loader.java:506)
at com.glide.db.impex.Loader.loadRecord(Loader.java:435)
at com.glide.update.AbstractUpdateLoader.loadRecord(AbstractUpdateLoader.java:78)
at com.glide.update.loader.DefaultUpdateLoader.load(DefaultUpdateLoader.java:41)

1 ACCEPTED SOLUTION

Durgaprasad Voo
ServiceNow Employee
ServiceNow Employee

Found the correct answer here.

https://buildtools1.service-now.com/community?id=community_question&sys_id=8cd7e778db3310102076ea75ca96193e

View solution in original post

3 REPLIES 3

Yash Agrawal1
Tera Guru

Hellp Voota,

It is entering duplicate value in table cmdb_ci_business_app into category field...

But on the other hand..the messege is showing Uniqe key volition.

So i would request you to open the cmdb_ci_business_app table and group by it the Colounm where you are storing unique values.

If you  found two record same id,you can delete or inactivate one...your issue will get resolved.

Please keep posted

Regards

Yash Agrawal

Durgaprasad Voo
ServiceNow Employee
ServiceNow Employee

Found the correct answer here.

https://buildtools1.service-now.com/community?id=community_question&sys_id=8cd7e778db3310102076ea75ca96193e

For those who don't have access to that site, what is the fix you found?