pg_cron launcher crashes with 'duplicate key value violates unique constraint'
#42484
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This is a copy of a troubleshooting article on Supabase's docs site. It may be missing some details from the original. View the original article.
The
pg_cronlauncher process crashes approximately every minute, displaying the error'duplicate key value violates unique constraint "job_run_details_pkey"'.Why does this happen?
This issue occurs when the
cron.runid_seqsequence is out of sync with thecron.job_run_detailstable. The sequence attempts to generaterunidvalues that already exist in the table, leading to a unique key violation. This is typically due to the sequence's last value not being correctly aligned with the maximumrunidalready present in the table.How to resolve this
To resolve this, you need to reset the
cron.job_run_detailstable. If data preservation is required, ensure you back up its contents before proceeding.Execute the following SQL command via the SQL editor:
TRUNCATE cron.job_run_details;Beta Was this translation helpful? Give feedback.
All reactions