org.postgresql.util.PSQLException: ERROR: restart transaction: txn "sql/executor.go:492 sql txn" id=8af60dec key=/Table/52/2/1473772745977/"ns0"/"k28"/0 rw=false pri=0.03528562 iso=SERIALIZABLE stat=PENDING epo=1 ts=1473775603.683415039,1 orig=1473775603.683415039,1 max=1473775599.758548667,0 wto=false rop=false failed to push "sql/executor.go:492 sql txn" id=2f6d7d07 key=/Table/52/1/"ns0"/"k28"/0 rw=true pri=0.03528567 iso=SERIALIZABLE stat=PENDING epo=0 ts=1473775603.679379439,0 orig=1473775603.679379439,0 max=1473775603.679379439,0 wto=false rop=false

GitHub | kosii | 3 months ago
  1. 0

    GitHub comment 9317#246692261

    GitHub | 3 months ago | kosii
    org.postgresql.util.PSQLException: ERROR: restart transaction: txn "sql/executor.go:492 sql txn" id=8af60dec key=/Table/52/2/1473772745977/"ns0"/"k28"/0 rw=false pri=0.03528562 iso=SERIALIZABLE stat=PENDING epo=1 ts=1473775603.683415039,1 orig=1473775603.683415039,1 max=1473775599.758548667,0 wto=false rop=false failed to push "sql/executor.go:492 sql txn" id=2f6d7d07 key=/Table/52/1/"ns0"/"k28"/0 rw=true pri=0.03528567 iso=SERIALIZABLE stat=PENDING epo=0 ts=1473775603.679379439,0 orig=1473775603.679379439,0 max=1473775603.679379439,0 wto=false rop=false
  2. 0

    How to resolve "Caused by: org.postgresql.util.PSQLException: ERROR: relation "employee" does not exist Position: 13" error?

    Stack Overflow | 6 months ago | TechGuy
    javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute statement
  3. 0

    Impossible to execute Save action: org.hibernate.exception.SQLGrammarException: could not execute statement

    openxava | 5 months ago | tianschoeman
    javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute statement
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    We have done an upgrade from PuppetDB 3.2.4 to PuppetDB 4.1.2 (using apt.puppetlabs.com packages). While the upgrade basically seems to be fine and it looks like that all PuppetDB-related stuff is working too, we see reoccurring duplicate-key-value-violates-unique-constraint in the puppetdb.log: {code:java} 2016-07-21 07:56:07,017 ERROR [p.p.mq-listener] [bc81b75b-9dad-432d-ae6c-a15d4f3e9305] [store report] Retrying after attempt 11 for somenode.example.com, due to: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "reports_hash_expr_idx" Detail: Key (encode(hash, 'hex'::text))=(66929dd40d99b8addcb9f42e02f51675cd6a2357) already exists. org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "reports_hash_expr_idx" Detail: Key (encode(hash, 'hex'::text))=(66929dd40d99b8addcb9f42e02f51675cd6a2357) already exists. at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2284) ~[puppetdb.jar:na] at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2003) ~[puppetdb.jar:na] at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:200) ~[puppetdb.jar:na] at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:424) ~[puppetdb.jar:na] at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:161) ~[puppetdb.jar:na] at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:133) ~[puppetdb.jar:na] at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61) ~[puppetdb.jar:na] at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java) ~[puppetdb.jar:na] at clojure.java.jdbc$db_do_prepared_return_keys$exec_and_return_keys__20693.invoke(jdbc.clj:727) ~[na:na] at clojure.java.jdbc$db_do_prepared_return_keys.invokeStatic(jdbc.clj:742) ~[na:na] at clojure.java.jdbc$db_do_prepared_return_keys.invoke(jdbc.clj:714) ~[na:na] at clojure.java.jdbc$multi_insert_helper$fn__20747.invoke(jdbc.clj:937) ~[na:na] at clojure.core$map$fn__4785.invoke(core.clj:2646) ~[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:521) ~[puppetdb.jar:na] at clojure.core$seq__4357.invokeStatic(core.clj:137) ~[puppetdb.jar:na] at clojure.core$dorun.invokeStatic(core.clj:3024) ~[puppetdb.jar:na] at clojure.core$doall.invokeStatic(core.clj:3039) ~[puppetdb.jar:na] at clojure.core$doall.invoke(core.clj:3039) ~[puppetdb.jar:na] at clojure.java.jdbc$multi_insert_helper.invokeStatic(jdbc.clj:936) ~[na:na] at clojure.java.jdbc$multi_insert_helper.invoke(jdbc.clj:931) ~[na:na] at clojure.java.jdbc$insert_helper$fn__20750.invoke(jdbc.clj:947) ~[na:na] at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:620) ~[na:na] at clojure.java.jdbc$db_transaction_STAR_.doInvoke(jdbc.clj:568) ~[na:na] at clojure.lang.RestFn.invoke(RestFn.java:425) ~[puppetdb.jar:na] at clojure.java.jdbc$insert_helper.invokeStatic(jdbc.clj:947) ~[na:na] at clojure.java.jdbc$insert_helper.invoke(jdbc.clj:940) ~[na:na] at clojure.java.jdbc$insert_BANG_.invokeStatic(jdbc.clj:1037) ~[na:na] at clojure.java.jdbc$insert_BANG_.doInvoke(jdbc.clj:1024) ~[na:na] at clojure.lang.RestFn.applyTo(RestFn.java:142) ~[puppetdb.jar:na] at clojure.core$apply.invokeStatic(core.clj:650) ~[puppetdb.jar:na] at clojure.core$apply.invoke(core.clj:641) ~[puppetdb.jar:na] at puppetlabs.puppetdb.jdbc$insert_BANG_.invokeStatic(jdbc.clj:64) ~[na:na] at puppetlabs.puppetdb.jdbc$insert_BANG_.doInvoke(jdbc.clj:57) ~[na:na] at clojure.lang.RestFn.invoke(RestFn.java:423) ~[puppetdb.jar:na] at puppetlabs.puppetdb.scf.storage$eval35201$add_report_BANG__STAR___35206$fn__35207$fn__35208$fn__35210.invoke(storage.clj:1260) ~[na:na] at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:620) ~[na:na] at clojure.java.jdbc$db_transaction_STAR_.doInvoke(jdbc.clj:568) ~[na:na] at clojure.lang.RestFn.invoke(RestFn.java:425) ~[puppetdb.jar:na] at puppetlabs.puppetdb.scf.storage$eval35201$add_report_BANG__STAR___35206$fn__35207$fn__35208.invoke(storage.clj:1236) ~[na:na] at puppetlabs.puppetdb.scf.storage.proxy$java.lang.Object$Callable$7da976d4.call(Unknown Source) ~[na:na] at com.codahale.metrics.Timer.time(Timer.java:101) ~[puppetdb.jar:na] at puppetlabs.puppetdb.scf.storage$eval35201$add_report_BANG__STAR___35206$fn__35207.invoke(storage.clj:1229) ~[na:na] at puppetlabs.puppetdb.scf.storage$eval35201$add_report_BANG__STAR___35206.invoke(storage.clj:1221) ~[na:na] at puppetlabs.puppetdb.scf.storage$eval35437$add_report_BANG___35442$fn__35443.invoke(storage.clj:1400) ~[na:na] at puppetlabs.puppetdb.scf.storage$eval35437$add_report_BANG___35442.invoke(storage.clj:1396) ~[na:na] at puppetlabs.puppetdb.command$store_report_STAR_$fn__40763.invoke(command.clj:331) ~[na:na] at puppetlabs.puppetdb.jdbc$with_transacted_connection_fn$fn__21230$fn__21231.invoke(jdbc.clj:306) ~[na:na] at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:595) ~[na:na] at clojure.java.jdbc$db_transaction_STAR_.doInvoke(jdbc.clj:568) ~[na:na] at clojure.lang.RestFn.invoke(RestFn.java:464) ~[puppetdb.jar:na] at puppetlabs.puppetdb.jdbc$with_transacted_connection_fn$fn__21230.invoke(jdbc.clj:305) ~[na:na] at puppetlabs.puppetdb.jdbc$eval21204$retry_sql_STAR___21209$fn__21210$fn__21211.invoke(jdbc.clj:283) ~[na:na] at puppetlabs.puppetdb.jdbc$eval21204$retry_sql_STAR___21209$fn__21210.invoke(jdbc.clj:282) ~[na:na] at puppetlabs.puppetdb.jdbc$eval21204$retry_sql_STAR___21209.invoke(jdbc.clj:273) ~[na:na] at puppetlabs.puppetdb.jdbc$with_transacted_connection_fn.invokeStatic(jdbc.clj:303) ~[na:na] at puppetlabs.puppetdb.jdbc$with_transacted_connection_fn.invoke(jdbc.clj:298) ~[na:na] at puppetlabs.puppetdb.command$store_report_STAR_.invokeStatic(command.clj:329) ~[na:na] at puppetlabs.puppetdb.command$store_report_STAR_.invoke(command.clj:324) ~[na:na] at puppetlabs.puppetdb.command$store_report.invokeStatic(command.clj:348) ~[na:na] at puppetlabs.puppetdb.command$store_report.invoke(command.clj:336) ~[na:na] at puppetlabs.puppetdb.command$process_command_BANG_.invokeStatic(command.clj:370) ~[na:na] at puppetlabs.puppetdb.command$process_command_BANG_.invoke(command.clj:363) ~[na:na] at puppetlabs.puppetdb.command$process_command_and_respond_BANG_.invokeStatic(command.clj:415) ~[na:na] at puppetlabs.puppetdb.command$process_command_and_respond_BANG_.invoke(command.clj:413) ~[na:na] at puppetlabs.puppetdb.command$reify__40907$service_fnk__11356__auto___positional$reify__40918$fn__40921.invoke(command.clj:451) ~[na:na] at puppetlabs.puppetdb.mq_listener$reify__41157$service_fnk__11356__auto___positional$reify__41167.process_message(mq_listener.clj:412) ~[na:na] at puppetlabs.puppetdb.mq_listener$reify__41157$service_fnk__11356__auto___positional$reify__41167$process_msg__41168.invoke(mq_listener.clj:380) ~[na:na] at puppetlabs.puppetdb.mq_listener$wrap_with_discard$fn__40983$fn__40985.invoke(mq_listener.clj:228) ~[na:na] at puppetlabs.puppetdb.mq_listener.proxy$java.lang.Object$Callable$7da976d4.call(Unknown Source) ~[na:na] at com.codahale.metrics.Timer.time(Timer.java:101) ~[puppetdb.jar:na] at puppetlabs.puppetdb.mq_listener$wrap_with_discard$fn__40983.invoke(mq_listener.clj:227) ~[na:na] at puppetlabs.puppetdb.mq_listener$wrap_with_exception_handling$fn__40971$fn__40973.invoke(mq_listener.clj:182) ~[na:na] at puppetlabs.puppetdb.mq_listener.proxy$java.lang.Object$Callable$7da976d4.call(Unknown Source) ~[na:na] at com.codahale.metrics.Timer.time(Timer.java:101) ~[puppetdb.jar:na] at puppetlabs.puppetdb.mq_listener$wrap_with_exception_handling$fn__40971.invoke(mq_listener.clj:181) ~[na:na] at puppetlabs.puppetdb.mq_listener$wrap_with_command_parser$fn__40979.invoke(mq_listener.clj:204) [na:na] at puppetlabs.puppetdb.mq_listener$wrap_with_meter$fn__40963.invoke(mq_listener.clj:142) [na:na] at puppetlabs.puppetdb.mq_listener$wrap_with_thread_name$fn__40990.invoke(mq_listener.clj:243) [na:na] at puppetlabs.puppetdb.mq_listener$start_receiver$reify__41150.onMessage(mq_listener.clj:360) [na:na] at org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:1401) [puppetdb.jar:na] at org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:131) [puppetdb.jar:na] at org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java:202) [puppetdb.jar:na] at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:133) [puppetdb.jar:na] at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:48) [puppetdb.jar:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_101] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_101] at java.lang.Thread.run(Thread.java:745) [na:1.7.0_101] {code} Despite this message, reports seems to be stored fine in PuppetDB - at least what we can see with puppetboard. I'm not sure if this is related, but also another message is displayed since the ugprade to 4.1.2 and appears ahead the "store report" entries: {code:java} 2016-07-21 07:56:07,495 WARN [p.p.h.command] Unable to stream command posted without parameters (loading into RAM) 2016-07-21 07:56:07,527 INFO [p.p.command] [6bd95e5b-7d5c-45c2-a238-65f1812f7a3a] [store report] puppet v3.8.5 - somenode1.example.com 2016-07-21 07:56:07,880 WARN [p.p.h.command] Unable to stream command posted without parameters (loading into RAM) 2016-07-21 07:56:07,912 INFO [p.p.command] [f839e90d-6ece-44e2-9abf-1fdb4eeb7e89] [store report] puppet v3.8.5 - somenode2.example.com {code}

    JIRA | 5 months ago | Andreas Unterkircher
    org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "reports_hash_expr_idx" Detail: Key (encode(hash, 'hex'::text))=(66929dd40d99b8addcb9f42e02f51675cd6a2357) already exists.
  6. 0

    GitHub comment 121#244860184

    GitHub | 3 months ago | vwilliam
    javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute statement
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.postgresql.util.PSQLException

    ERROR: restart transaction: txn "sql/executor.go:492 sql txn" id=8af60dec key=/Table/52/2/1473772745977/"ns0"/"k28"/0 rw=false pri=0.03528562 iso=SERIALIZABLE stat=PENDING epo=1 ts=1473775603.683415039,1 orig=1473775603.683415039,1 max=1473775599.758548667,0 wto=false rop=false failed to push "sql/executor.go:492 sql txn" id=2f6d7d07 key=/Table/52/1/"ns0"/"k28"/0 rw=true pri=0.03528567 iso=SERIALIZABLE stat=PENDING epo=0 ts=1473775603.679379439,0 orig=1473775603.679379439,0 max=1473775603.679379439,0 wto=false rop=false

    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse()
  2. PostgreSQL JDBC Driver
    QueryExecutorImpl.execute
    1. org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2284)
    2. org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2003)
    3. org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:200)
    3 frames
  3. org.postgresql.jdbc
    PgPreparedStatement.executeUpdate
    1. org.postgresql.jdbc.PgStatement.execute(PgStatement.java:424)
    2. org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:161)
    3. org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:133)
    3 frames
  4. Apache Commons DBCP
    DelegatingPreparedStatement.executeUpdate
    1. org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:98)
    2. org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:98)
    2 frames
  5. scalikejdbc-core
    SQLUpdate.apply
    1. scalikejdbc.DBConnectionAttributesWiredPreparedStatement.executeUpdate(DBConnectionAttributesWiredPreparedStatement.scala:79)
    2. scalikejdbc.StatementExecutor$$anonfun$executeUpdate$1.apply$mcI$sp(StatementExecutor.scala:342)
    3. scalikejdbc.StatementExecutor$$anonfun$executeUpdate$1.apply(StatementExecutor.scala:342)
    4. scalikejdbc.StatementExecutor$$anonfun$executeUpdate$1.apply(StatementExecutor.scala:342)
    5. scalikejdbc.StatementExecutor$NakedExecutor.apply(StatementExecutor.scala:18)
    6. scalikejdbc.StatementExecutor$$anon$1.scalikejdbc$StatementExecutor$LoggingSQLAndTiming$$super$apply(StatementExecutor.scala:320)
    7. scalikejdbc.StatementExecutor$LoggingSQLAndTiming$class.apply(StatementExecutor.scala:264)
    8. scalikejdbc.StatementExecutor$$anon$1.scalikejdbc$StatementExecutor$LoggingSQLIfFailed$$super$apply(StatementExecutor.scala:320)
    9. scalikejdbc.StatementExecutor$LoggingSQLIfFailed$class.apply(StatementExecutor.scala:297)
    10. scalikejdbc.StatementExecutor$$anon$1.apply(StatementExecutor.scala:320)
    11. scalikejdbc.StatementExecutor.executeUpdate(StatementExecutor.scala:342)
    12. scalikejdbc.DBSession$$anonfun$updateWithFilters$1.apply(DBSession.scala:477)
    13. scalikejdbc.DBSession$$anonfun$updateWithFilters$1.apply(DBSession.scala:475)
    14. scalikejdbc.LoanPattern$class.using(LoanPattern.scala:18)
    15. scalikejdbc.ActiveSession.scalikejdbc$DBSession$$super$using(DBSession.scala:706)
    16. scalikejdbc.DBSession$class.using(DBSession.scala:30)
    17. scalikejdbc.ActiveSession.using(DBSession.scala:706)
    18. scalikejdbc.DBSession$class.updateWithFilters(DBSession.scala:474)
    19. scalikejdbc.ActiveSession.updateWithFilters(DBSession.scala:706)
    20. scalikejdbc.DBSession$class.updateWithFilters(DBSession.scala:449)
    21. scalikejdbc.ActiveSession.updateWithFilters(DBSession.scala:706)
    22. scalikejdbc.SQLUpdate.apply(SQL.scala:632)
    22 frames
  6. Unknown
    Main$$anonfun$clean$1.apply
    1. Main$$anonfun$clean$1.apply(Main.scala:39)
    2. Main$$anonfun$clean$1.apply(Main.scala:38)
    2 frames
  7. Scala
    List.map
    1. scala.collection.immutable.List.map(List.scala:277)
    1 frame
  8. Unknown
    Main$$anonfun$1$$anonfun$6$$anonfun$2.apply
    1. Main$.clean(Main.scala:38)
    2. Main$$anonfun$1$$anonfun$6$$anonfun$2.apply$mcJ$sp(Main.scala:59)
    3. Main$$anonfun$1$$anonfun$6$$anonfun$2.apply(Main.scala:59)
    4. Main$$anonfun$1$$anonfun$6$$anonfun$2.apply(Main.scala:59)
    4 frames
  9. Scala
    Try$.apply
    1. scala.util.Try$.apply(Try.scala:192)
    1 frame
  10. Unknown
    Main$$anonfun$1$$anonfun$6.apply
    1. Main$$anonfun$1$$anonfun$6.apply(Main.scala:59)
    2. Main$$anonfun$1$$anonfun$6.apply(Main.scala:57)
    2 frames
  11. scalikejdbc-core
    DB$.localTx
    1. scalikejdbc.DBConnection$$anonfun$3.apply(DBConnection.scala:305)
    2. scalikejdbc.DBConnection$class.scalikejdbc$DBConnection$$rollbackIfThrowable(DBConnection.scala:274)
    3. scalikejdbc.DBConnection$class.localTx(DBConnection.scala:303)
    4. scalikejdbc.DB.localTx(DB.scala:60)
    5. scalikejdbc.DB$.localTx(DB.scala:260)
    5 frames
  12. Unknown
    Main$$anonfun$1.apply
    1. Main$$anonfun$1.apply$mcV$sp(Main.scala:56)
    2. Main$$anonfun$1.apply(Main.scala:56)
    3. Main$$anonfun$1.apply(Main.scala:56)
    3 frames
  13. Scala
    Future$PromiseCompletingRunnable.run
    1. scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
    2. scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
    2 frames
  14. Java RT
    Thread.run
    1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    3. java.lang.Thread.run(Thread.java:745)
    3 frames