java.lang.RuntimeException

Exception while executing statement : Unique index or primary key violation: "CONSTRAINT_9D9B1_INDEX_F ON PUBLIC.ASSET_META(NAME) VALUES (CAST('SUFFIX' AS VARCHAR_IGNORECASE), 48)"; SQL statement: insert into asset_meta (name, priority, value_type, description, label) values (?,?,?,?,?) [23505-188] errorCode: 23505, sqlState: 23505 insert into asset_meta (name, priority, value_type, description, label) values (?,?,?,?,?) jdbcParams:[SUFFIX,-1,1,SUFFIX,Suffix]


Samebug tips1

Check if you're not creating unused SQL entities, as it might cause this exception.

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.


Solutions on the web23296

Solution icon of github
Exception while executing statement : Unique index or primary key violation: "CONSTRAINT_9D9B1_INDEX_F ON PUBLIC.ASSET_META(NAME) VALUES (CAST('SUFFIX' AS VARCHAR_IGNORECASE), 48)"; SQL statement: insert into asset_meta (name, priority, value_type

Solution icon of github
via GitHub by grahamc
, 6 months ago
Exception while executing statement : Unique index or primary key violation: "CONSTRAINT_9D9B1_INDEX_F ON PUBLIC.ASSET_META(NAME) VALUES (CAST('SUFFIX' AS VARCHAR_IGN Feb 01 17:47:40 nixos docker[5807]: insert into asset_meta (name, priority

Solution icon of github
org.h2.jdbc.JdbcSQLException: Unique index or primary key violation: "CONSTRAINT_INDEX_6 ON PUBLIC.MESSAGE(IV) VALUES (X'769f8dca6666fcbd6e97c59b1ea00cfccfac4272ce98aae9ea54e2a98d54f763', 7)"; SQL statement: INSERT INTO Message (iv, type, sender, recipient, data, sent, received, status) VALUES (?, ?, ?, ?, ?, ?, ?, ?) [23505-187]

Solution icon of bugzilla
via https://bugzilla.redhat.com/bugzilla/ by Filip Brychta, 1 year ago
, DESCRIPTION, FSYSTEM, ID) values ('newRole', NULL, '0', '10052') was aborted. Call getNextException to see the cause. -> ERROR: duplicate key value violates unique constraint "rhq_role_name_key" Detail: Key (name)=(newRole) already exists.(error-code=0,sql-state=23505)]

Solution icon of web
via JIRA by Yannick Marcon, 10 months ago
entry 'ccc-Drugs-CLASS-Human' for key 'PRIMARY' [Failed SQL: INSERT INTO `opal_tabular`.`categories` (`datasource`, `value_table`, `variable`, `name`, `missing`) VALUES ('ccc', 'Drugs', 'CLASS', 'Human', 0)]

Solution icon of googlegroups
Unexpected code path"; SQL statement: INSERT INTO FT.MAP(ROWID, WORDID) VALUES(?, ?) [50000-152]

Solution icon of stackoverflow
via Stack Overflow by Unknown author, 1 year ago
org.h2.jdbc.JdbcSQLException: Table "ANIMALS" not found; SQL statement: INSERT INTO animals ( animal_name, animal_type_id ) VALUES ( ?, ? ); [42102-173]

Solution icon of googlegroups
via Google Groups by pierre-antoine pinard, 1 year ago
expected pos: 1106 got: 1021"; SQL statement: INSERT INTO LIBELLE VALUES (?,?) [50000-150]

Solution icon of github
via GitHub by kunall17
, 3 months ago
java.sql.SQLException: Unable to run insert stmt on object com.zulip.android.models.Person@1255087c: INSERT INTO `people` (`avatarUrl` ,`email` ,`id` ,`isActive` ,`isBot` ,`name` ) VALUES (?,?,?,?,?,?)

Solution icon of github
via GitHub by niftynei
, 11 months ago
java.sql.SQLException: Unable to run insert stmt on object com.zulip.android.models.Stream@2275a78e: INSERT INTO `streams` (`color` ,`inHomeView` ,`inviteOnly` ,`name` ,`subscribed` ) VALUES (?,?,?,?,?)

Stack trace

  • java.lang.RuntimeException: Exception while executing statement : Unique index or primary key violation: "CONSTRAINT_9D9B1_INDEX_F ON PUBLIC.ASSET_META(NAME) VALUES (CAST('SUFFIX' AS VARCHAR_IGNORECASE), 48)"; SQL statement: insert into asset_meta (name, priority, value_type, description, label) values (?,?,?,?,?) [23505-188] errorCode: 23505, sqlState: 23505 insert into asset_meta (name, priority, value_type, description, label) values (?,?,?,?,?) jdbcParams:[SUFFIX,-1,1,SUFFIX,Suffix] at org.squeryl.internals.DatabaseAdapter$class._exec(DatabaseAdapter.scala:297)[org.squeryl.squeryl_2.11-0.9.5-7.jar:0.9.5-7] at org.squeryl.internals.DatabaseAdapter$class.exec(DatabaseAdapter.scala:349)[org.squeryl.squeryl_2.11-0.9.5-7.jar:0.9.5-7] at org.squeryl.adapters.H2Adapter.exec(H2Adapter.scala:22)[org.squeryl.squeryl_2.11-0.9.5-7.jar:0.9.5-7] at org.squeryl.internals.DatabaseAdapter$class.executeUpdateForInsert(DatabaseAdapter.scala:383)[org.squeryl.squeryl_2.11-0.9.5-7.jar:0.9.5-7] at org.squeryl.adapters.H2Adapter.executeUpdateForInsert(H2Adapter.scala:22)[org.squeryl.squeryl_2.11-0.9.5-7.jar:0.9.5-7] Caused by: org.h2.jdbc.JdbcSQLException: Unique index or primary key violation: "CONSTRAINT_9D9B1_INDEX_F ON PUBLIC.ASSET_META(NAME) VALUES (CAST('SUFFIX' AS VARCHAR_IGNORECASE), 48)"; SQL statement: insert into asset_meta (name, priority, value_type, description, label) values (?,?,?,?,?) [23505-188] at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)[com.h2database.h2-1.4.188.jar:1.4.188] at org.h2.message.DbException.get(DbException.java:179)[com.h2database.h2-1.4.188.jar:1.4.188] at org.h2.message.DbException.get(DbException.java:155)[com.h2database.h2-1.4.188.jar:1.4.188] at org.h2.index.BaseIndex.getDuplicateKeyException(BaseIndex.java:102)[com.h2database.h2-1.4.188.jar:1.4.188] at org.h2.mvstore.db.MVSecondaryIndex.checkUnique(MVSecondaryIndex.java:231)[com.h2database.h2-1.4.188.jar:1.4.188]

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

2 times, 1 day ago
Once, 1 month ago
34 times, 1 month ago
4 times, 1 month ago
Samebug visitor profile picture
Unknown user
Once, 2 months ago
143 more bugmates