org.postgresql.util.PSQLException

ERROR: duplicate key value violates unique constraint "reports_pkey" Detail: Key (hash)=(6cb10ac4b4be82870db2a709a346fb4a132325cb) already exists.

Samebug tips1

Try downgrading PostgresSQL server to 9.5 or update your PostgresSQL driver to 9.4-1211 with the following command: <postgresql.version>9.4.1211</postgresql.version>

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

Solutions on the web3106

  • via JIRA by James Glenn, 9 months ago
    ERROR: duplicate key value violates unique constraint "reports_pkey" Detail: Key (hash)=(6cb10ac4b4be82870db2a709a346fb4a132325cb) already exists.
  • via JIRA by James Glenn, 1 year ago
    ERROR: duplicate key value violates unique constraint "reports_pkey" Detail: Key (hash)=(6cb10ac4b4be82870db2a709a346fb4a132325cb) already exists.
  • via JIRA by Andreas Unterkircher, 11 months ago
    ERROR: duplicate key value violates unique constraint "reports_hash_expr_idx" Detail: Key (encode(hash, 'hex'::text))=(66929dd40d99b8addcb9f42e02f51675cd6a2357) already exists.
  • Stack trace

    • org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "reports_pkey" Detail: Key (hash)=(6cb10ac4b4be82870db2a709a346fb4a132325cb) already exists. at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)[puppetdb.jar:na] at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886)[puppetdb.jar:na] at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)[puppetdb.jar:na] at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:555)[puppetdb.jar:na] at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:417)[puppetdb.jar:na] at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:363)[puppetdb.jar:na] at com.jolbox.bonecp.PreparedStatementHandle.executeUpdate(PreparedStatementHandle.java:203)[puppetdb.jar:na] at clojure.java.jdbc.internal$do_prepared_return_keys_STAR_$fn__5838.invoke(internal.clj:337)[na:na] at clojure.java.jdbc.internal$transaction_STAR_.invoke(internal.clj:223)[na:na] at clojure.java.jdbc.internal$do_prepared_return_keys_STAR_.invoke(internal.clj:337)[na:na] at clojure.lang.AFn.applyToHelper(AFn.java:156)[puppetdb.jar:na] at clojure.lang.AFn.applyTo(AFn.java:144)[puppetdb.jar:na] at clojure.core$apply.invoke(core.clj:626)[puppetdb.jar:na] at clojure.java.jdbc$insert_values.doInvoke(jdbc.clj:263)[na:na] at clojure.lang.RestFn.invoke(RestFn.java:442)[puppetdb.jar:na] at clojure.java.jdbc$insert_records$ins_v__5906.invoke(jdbc.clj:278)[na:na] at clojure.core$map$fn__4245.invoke(core.clj:2559)[puppetdb.jar:na] at clojure.lang.LazySeq.sval(LazySeq.java:40)[puppetdb.jar:na] at clojure.lang.LazySeq.seq(LazySeq.java:49)[puppetdb.jar:na] at clojure.lang.RT.seq(RT.java:484)[puppetdb.jar:na] at clojure.core$seq.invoke(core.clj:133)[puppetdb.jar:na] at clojure.core$dorun.invoke(core.clj:2855)[puppetdb.jar:na] at clojure.core$doall.invoke(core.clj:2871)[puppetdb.jar:na] at clojure.java.jdbc$insert_records.doInvoke(jdbc.clj:279)[na:na] at clojure.lang.RestFn.invoke(RestFn.java:423)[puppetdb.jar:na] at clojure.java.jdbc$insert_record.invoke(jdbc.clj:286)[na:na] at com.puppetlabs.puppetdb.scf.storage$add_report_BANG__STAR_$fn__9641$fn__9645.invoke(storage.clj:1104)[na:na] at clojure.java.jdbc.internal$transaction_STAR_.invoke(internal.clj:223)[na:na] at com.puppetlabs.puppetdb.scf.storage$add_report_BANG__STAR_$fn__9641.invoke(storage.clj:1094)[na:na] at com.puppetlabs.puppetdb.scf.storage.proxy$java.lang.Object$Callable$7da976d4.call(Unknown Source)[na:na] at com.yammer.metrics.core.Timer.time(Timer.java:91)[puppetdb.jar:na] at com.puppetlabs.puppetdb.scf.storage$add_report_BANG__STAR_.invoke(storage.clj:1088)[na:na] at com.puppetlabs.puppetdb.scf.storage$eval9812$add_report_BANG___9813$fn__9814.invoke(storage.clj:1221)[na:na] at com.puppetlabs.puppetdb.scf.storage$eval9812$add_report_BANG___9813.invoke(storage.clj:1217)[na:na] at com.puppetlabs.puppetdb.command$store_report_STAR_$fn__13416.invoke(command.clj:413)[na:na] at com.puppetlabs.jdbc$with_transacted_connection_fn$fn__6256$fn__6257$fn__6258.invoke(jdbc.clj:290)[na:na] at clojure.java.jdbc.internal$transaction_STAR_.invoke(internal.clj:204)[na:na] at com.puppetlabs.jdbc$with_transacted_connection_fn$fn__6256$fn__6257.invoke(jdbc.clj:290)[na:na] at clojure.java.jdbc.internal$with_connection_STAR_.invoke(internal.clj:186)[na:na] at com.puppetlabs.jdbc$with_transacted_connection_fn$fn__6256.invoke(jdbc.clj:287)[na:na] at com.puppetlabs.jdbc$eval6234$retry_sql_STAR___6235$fn__6236$fn__6237.invoke(jdbc.clj:259)[na:na] at com.puppetlabs.jdbc$eval6234$retry_sql_STAR___6235$fn__6236.invoke(jdbc.clj:258)[na:na] at com.puppetlabs.jdbc$eval6234$retry_sql_STAR___6235.invoke(jdbc.clj:250)[na:na] at com.puppetlabs.jdbc$with_transacted_connection_fn.invoke(jdbc.clj:286)[na:na] at com.puppetlabs.puppetdb.command$store_report_STAR_.invoke(command.clj:411)[na:na] at com.puppetlabs.puppetdb.command$eval13444$fn__13447.invoke(command.clj:434)[na:na] at clojure.lang.MultiFn.invoke(MultiFn.java:231)[puppetdb.jar:na] at com.puppetlabs.puppetdb.command$produce_message_handler$fn__13528.invoke(command.clj:647)[na:na] at com.puppetlabs.puppetdb.command$wrap_with_discard$fn__13477$fn__13481.invoke(command.clj:554)[na:na] at com.puppetlabs.puppetdb.command.proxy$java.lang.Object$Callable$7da976d4.call(Unknown Source)[na:na] at com.yammer.metrics.core.Timer.time(Timer.java:91)[puppetdb.jar:na] at com.puppetlabs.puppetdb.command$wrap_with_discard$fn__13477.invoke(command.clj:553)[na:na] at com.puppetlabs.puppetdb.command$wrap_with_exception_handling$fn__13462$fn__13463.invoke(command.clj:507)[na:na] at com.puppetlabs.puppetdb.command.proxy$java.lang.Object$Callable$7da976d4.call(Unknown Source)[na:na] at com.yammer.metrics.core.Timer.time(Timer.java:91)[puppetdb.jar:na] at com.puppetlabs.puppetdb.command$wrap_with_exception_handling$fn__13462.invoke(command.clj:506)[na:na] at com.puppetlabs.puppetdb.command$wrap_with_command_parser$fn__13472.invoke(command.clj:529)[na:na] at com.puppetlabs.puppetdb.command$wrap_with_meter$fn__13452.invoke(command.clj:467)[na:na] at com.puppetlabs.puppetdb.command$wrap_with_thread_name$fn__13486.invoke(command.clj:569)[na:na] at com.puppetlabs.mq$create_message_listener$reify__10371.onMessage(mq.clj:277)[na:na] at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:560)[puppetdb.jar:na] at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:498)[puppetdb.jar:na] at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467)[puppetdb.jar:na] at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)[puppetdb.jar:na] at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)[puppetdb.jar:na] at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058)[puppetdb.jar:na] at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1050)[puppetdb.jar:na] at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947)[puppetdb.jar:na] at java.lang.Thread.run(Thread.java:745)[na:1.7.0_85]

    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

    Unknown user
    Once, 1 year ago
    Unknown user
    Once, 11 months ago
    Unknown user
    Once, 1 year ago
    Unknown user
    Once, 1 year ago
    Once, 12 hours ago
    93 more bugmates