I ran into a weird issue where someone had a PR open. They were making commits to branch PR referenced. First couple commits had the “pr” and “push” builds occur. Then a couple had only “push”. Then the rest had “pr” and “push”.
While trying to determine why a couple of commits did not have the “pr” build occur we found 2 web hook events sent got a 500 response from Drone.
When checking the logs from Drone server I noticed the following errors that occurred at the same time for that repo:
time="2017-02-10T15:20:54Z" level=error msg="failure to save commit for user/repo. meddler.Insert: DB error in QueryRow: pq: duplicate key value violates unique constraint \"builds_build_number_build_repo_id_key\""
time="2017-02-10T15:20:54Z" level=error msg="Error #01: meddler.Insert: DB error in QueryRow: pq: duplicate key value violates unique constraint \"builds_build_number_build_repo_id_key\"\n" ip=x.x.x.x latency=261.551846ms method=POST path="/hook" status=500 time="2017-02-10T15:20:54Z" user-agent="GitHub-Hookshot/9254d22"
time="2017-02-10T15:15:13Z" level=error msg="Error #01: meddler.Insert: DB error in QueryRow: pq: duplicate key value violates unique constraint \"builds_build_number_build_repo_id_key\"\n" ip=x.x.x.x latency=267.218395ms method=POST path="/hook" status=500 time="2017-02-10T15:15:13Z" user-agent="GitHub-Hookshot/9254d22"
time="2017-02-10T15:15:13Z" level=error msg="failure to save commit for user/repo. meddler.Insert: DB error in QueryRow: pq: duplicate key value violates unique constraint \"builds_build_number_build_repo_id_key\""
I’m trying to figure out what caused the issue above but not sure how the errors relate. Thanks!