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.

Duplicate key value violates unique constraint "shedlock_pkey"

See original GitHub issue

Hello,

when application starts we have following error on PostgreSQL logs:

ERROR:  duplicate key value violates unique constraint "shedlock_pkey"
DETAIL:  Key (name)=(SomeScheduler) already exists.
STATEMENT:  INSERT INTO shedlock(name, lock_until, locked_at, locked_by) VALUES($1, $2, $3, $4)

Is there a possibility to avoid or fix above error?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
manjinderroopraicommented, Aug 26, 2021

I am using the JDBC template provider -Oracle. On every restart of service, we are getting duplicate key value “violates unique constraint” Exception. It seems a bit annoying to me and was looking for a resolution by extending the JdbcTemplateStorageAccessor but failed to do so. Is there a possibility to avoid this exception in logs?

0reactions
onlinemdcommented, Sep 5, 2022

@lukas-krecan I hope I sent the PR properly, can you please check once?

PR - #1155

Read more comments on GitHub >

github_iconTop Results From Across the Web

postgresql duplicate key violates unique constraint
If the first value is higher than the second value, your sequence is out of sync. Back up your PG database (just in...
Read more >
Handling duplicate key value violates unique constraint error
Hey! When trying to register with an email that exists in the database I'm getting the following error: SQLSTATE[23505]: Unique violation: 7 ERROR: ......
Read more >
How to solve "duplicate key value violates unique constraint ...
The import of a configuration into an existing organisation failed.
Read more >
Bug #15729: duplicate key value violates unique constraint ...
Description. ERROR: duplicate key value violates unique constraint "dynflow_coordinator_records_pkey" DETAIL: Key (id, class)=(delayed-executor, ...
Read more >
Why am I getting ERROR: duplicate key value violates unique ...
You cannot have duplicate keys on primary key column i.e movie_num=20 Change Movie Die Another Day with movie_num =20 to 24
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