Concourse cannot handle more than 2147483647 checks/builds
search cancel

Concourse cannot handle more than 2147483647 checks/builds

book

Article ID: 297216

calendar_today

Updated On:

Products

Concourse for VMware Tanzu

Issue/Introduction

When build_id id in the builds table exceeds 2147483647, all future builds fail to create.

Errors in the logs like:

concourse-web     | {"timestamp":"2022-05-19T20:54:03.056255000Z","level":"error","source":"atc","message":"atc.tracker.tick.run.lock.acquire.failed-to-register-in-db","data":{"build":"26","build_id":2147483660,"error":"pq: value \"2147483660\" is out of range for type integer","id":[1,2147483660],"job":"job","pipeline":"example","session":"26.486.4.1.1","team":"main"}}
concourse-web     | {"timestamp":"2022-05-19T20:54:03.056311307Z","level":"error","source":"atc","message":"atc.tracker.tick.run.failed-to-get-lock","data":{"build":"26","build_id":2147483660,"error":"pq: value \"2147483660\" is out of range for type integer","job":"job","pipeline":"example","session":"26.486.4","team":"main"}}
concourse-db      | 2022-05-19 20:54:03.056 UTC [70] ERROR:  value "2147483660" is out of range for type integer
concourse-db      | 2022-05-19 20:54:03.056 UTC [70] CONTEXT:  unnamed portal parameter $2 = '...'
concourse-db      | 2022-05-19 20:54:03.056 UTC [70] STATEMENT:  SELECT pg_try_advisory_lock($1,$2)
concourse-db      | 2022-05-19 20:54:03.056 UTC [70] ERROR:  value "2147483656" is out of range for type integer


Resolution

2147483647 is max signed int. Function pg_try_advisory_lock(int, int) takes two int as parameters. 

Concourse v7.9.1 fixes DB out of range error due to build numbers exceed the integer limit. To allow the migration to run Postgresql version has to be v11+. Please review the release notes, breaking changes, and upgrade documentation before upgrading to this version for the fix.