org.jooq.exception.DataAccessException: SQL [insert into secrets (name, createdat, updatedat, description, createdby, updatedby, type, options) values (?, cast(? as timestamp), cast(? as timestamp), ?, ?, ?, ?, ?) returning secrets.id]; duplicate key value violates unique constraint "secrets_pkey"

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via GitHub by sureshg
, 10 months ago
SQL [insert into secrets (name, createdat, updatedat, description, createdby, updatedby, type, options) values (?, cast(? as timestamp), cast(? as timestamp), ?, ?, ?, ?, ?) returning secrets.id]; duplicate key value violates unique constraint "secrets_pkey"
org.jooq.exception.DataAccessException: SQL [insert into secrets (name, createdat, updatedat, description, createdby, updatedby, type, options) values (?, cast(? as timestamp), cast(? as timestamp), ?, ?, ?, ?, ?) returning secrets.id]; duplicate key value violates unique constraint "secrets_pkey"
at com.impossibl.postgres.jdbc.ErrorUtils.makeSQLException(ErrorUtils.java:154)
at com.impossibl.postgres.jdbc.ErrorUtils.makeSQLException(ErrorUtils.java:136)
at com.impossibl.postgres.jdbc.PGConnectionImpl.execute(PGConnectionImpl.java:438)
at com.impossibl.postgres.jdbc.PGStatement.executeStatement(PGStatement.java:375)
at com.impossibl.postgres.jdbc.PGPreparedStatement.execute(PGPreparedStatement.java:261)
at com.impossibl.postgres.jdbc.PGPreparedStatement.executeQuery(PGPreparedStatement.java:277)
at org.jooq.tools.jdbc.DefaultPreparedStatement.executeQuery(DefaultPreparedStatement.java:83)
at org.jooq.impl.AbstractDMLQuery.execute(AbstractDMLQuery.java:376)
at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:342)
at org.jooq.impl.TableRecordImpl.storeInsert0(TableRecordImpl.java:176)
at org.jooq.impl.TableRecordImpl$1.operate(TableRecordImpl.java:142)
at org.jooq.impl.RecordDelegate.operate(RecordDelegate.java:123)
at org.jooq.impl.TableRecordImpl.storeInsert(TableRecordImpl.java:138)
at org.jooq.impl.UpdatableRecordImpl.store0(UpdatableRecordImpl.java:185)
at org.jooq.impl.UpdatableRecordImpl.access$000(UpdatableRecordImpl.java:85)
at org.jooq.impl.UpdatableRecordImpl$1.operate(UpdatableRecordImpl.java:135)
at org.jooq.impl.RecordDelegate.operate(RecordDelegate.java:123)
at org.jooq.impl.UpdatableRecordImpl.store(UpdatableRecordImpl.java:131)
at org.jooq.impl.UpdatableRecordImpl.store(UpdatableRecordImpl.java:123)
at keywhiz.service.daos.SecretSeriesDAO.createSecretSeries(SecretSeriesDAO.java:91)
at keywhiz.service.daos.SecretDAO.lambda$createSecret$17(SecretDAO.java:93)
at keywhiz.service.daos.SecretDAO.createSecret(SecretDAO.java:79)
at keywhiz.service.daos.SecretDAOTest.createSecretSucceedsIfCurrentVersionIsNull(SecretDAOTest.java:200)

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.

Know the solutions? Share your knowledge to help other developers to debug faster.