question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ShedLock does not work with PostgreSQL JDBC Driver version 42.2.11

See original GitHub issue
  1. Which version do you use shedlock-spring:4.5.1
  2. Which Lock Provider shedlock-provider-jdbc-template:4.5.1
  3. ShedLock configuration lockAtLeastFor = “PT10S”, lockAtMostFor = “PT120S”

Expected behavior Shedlock can start without errors

Actual behavior After an update on the latest PostgreSQL JDBC Driver JDBC 4.2 » 42.2.11 and deployment we found that Shedlock can not start because of error:

org.springframework.transaction.TransactionSystemException: Could not commit JDBC transaction; nested exception is org.postgresql.util.PSQLException: The database returned ROLLBACK, so the transaction cannot be committed. Transaction failure cause is <<ERROR: duplicate key value violates unique constraint "shedlock_pkey"
  Detail: Key (name)=(documentProcessingJob) already exists.>>
	at org.springframework.jdbc.datasource.DataSourceTransactionManager.doCommit(DataSourceTransactionManager.java:334)
	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:744) 

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
pavel-is24commented, Apr 3, 2020

I am just going to leave some keywords here for someone googling this issue in future:

ShedLock, Spring boot upgrade, PostgreSQL.

We have upgraded Sprint Boot from v2.1 to v2.2 and got

Detail: Key (name)=(myclass_mymethod) already exists.>>
	at org.springframework.jdbc.datasource.DataSourceTransactionManager.doCommit(DataSourceTransactionManager.java:335)
...
Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "shedlock_pkey"
  Detail: Key (name)=(myclass_mymethod) already exists.
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2578)
...
	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
1reaction
davecramercommented, Apr 3, 2020

FWIW PgJDBC 42.2.12 has been released and this change has been reverted. We (the PgJDBC group are recommending that 42.2.11 not be used and use 42.2.12 instead. Also note that we will be releasing 42.3.0 with the above mentioned change.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring Boot ShedLock "relation "shedlock" does not exist"
I have the exact same problem when I perform a clean with Flyway, which deletes everything from database. When I restart all my...
Read more >
PostgreSQL JDBC Driver 42.2.0 Released | pgJDBC
Notable Changes. Known issues. SCRAM authentication does not work as scram client classes are not packaged; client_encoding has to be UTF8 even with ......
Read more >
ShedLock: Distributed Lock for Your Scheduled Tasks For Java
Please note that ShedLock is not and will never be full-fledged scheduler, it's just a lock. ... Made compatible with PostgreSQL JDBC Driver...
Read more >
1983824 – Postgres JDBC 42.2.23 wont connect to Postgresql ...
However, since JDBC driver version 42.2.23 was introduced, ... I have discovered a problem with stopping and restarting the postgresql server: The command ......
Read more >
providers/redis · mysql8 · mirrors / lukas-krecan / ShedLock · GitCode
Please note that ShedLock is not and will never be full-fledged scheduler, it's just a lock. ... Made compatible with PostgreSQL JDBC Driver...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found