clair icon indicating copy to clipboard operation
clair copied to clipboard

Broken GC?

Open igcherkaev opened this issue 2 months ago • 1 comments

Hello,

We recently ran into a disk space issue on our pgsql server, which holds the db for clair, and after investigation we discovered that GC is broken for some reason in clair 4.8.0:

dockerregistry-corp-clair-5788d775fd-4c4gc projectquay-clair {"level":"info","component":"libvuln/updates/Manager.Run","retention":2,"time":"2025-10-13T17:04:50Z","message":"GC started"}
dockerregistry-corp-clair-5788d775fd-4c4gc projectquay-clair {"level":"error","component":"libvuln/updates/Manager.Run","error":"error querying for update operations: ERROR: syntax error at or near \"]\" (SQLSTATE 42601)","time":"2025-10-13T17:04:50Z","message":"error while performing GC"}
dockerregistry-corp-clair-5788d775fd-vj8tj projectquay-clair {"level":"info","component":"libvuln/updates/Manager.Run","retention":2,"time":"2025-10-13T17:23:58Z","message":"GC started"}
dockerregistry-corp-clair-5788d775fd-vj8tj projectquay-clair {"level":"error","component":"libvuln/updates/Manager.Run","error":"error querying for update operations: ERROR: syntax error at or near \"]\" (SQLSTATE 42601)","time":"2025-10-13T17:23:58Z","message":"error while performing GC"}

Not sure what exact SQL command it tries to execute on the server, but it clearly fails. What troubleshooting steps should we take?

igcherkaev avatar Oct 13 '25 19:10 igcherkaev

Interesting, I'm not really sure how this error is being tripped, the query hasn't changed in the last 5 years so my thought is that the input is somehow off, but it is expecting an int and there should be no issues with accessing the array. Do you have some details about your postgres version?

One possible debugging route is to enable query logging in postgres which I think will allow you to see the failing query in the postgres logs.

crozzy avatar Dec 11 '25 17:12 crozzy