Repository navigation
Description
Summary
Pinned resources that aren't build triggers are never re-checked once they have history (regression since 8.2.0 / #9492)
Summary
Since v8.2.0 (#9492, "Smarter resource checking - Only check triggering resources"), Lidar stops scanning any resource that is not a build trigger, once that resource has at least one successfully-checked version. This is fine for normal get-only resources, but it breaks pinned resources (version: {path: ...} / version: {ref: ...} etc. in the pipeline config) whose underlying artifact is published by a system outside Concourse: updating the pin to a newly-published version now fails with pinned version ... not found, even though the artifact genuinely exists, because Concourse's DB was never told to look for it.
Environment
- Concourse:
8.2.4(also reproduces on8.2.0–8.2.3) - Confirmed absent on
8.1.0—atc/db/check_factory.go'sResources()query in 8.1.0 includes any resource that's an input to any job, regardless oftrigger:. This is exactly the query Smarter resource checking - Only check triggering resources #9492 changed. - Resource type:
s3(concourse/s3-resource), but the bug is in ATC core, not the resource type — confirmed thecheck/versionscode is byte-identical between thes3versions bundled with 7.14.3 (v2.4.0) and 8.2.4 (v2.5.4).
Root cause
atc/scheduler/algorithm/pinned_resolver.go's Resolve() resolves a pin via VersionsDB.FindVersionOfResource, which is a pure SQL lookup against resource_config_versions — it never live-checks the resource's source:
version, found, err := r.vdb.FindVersionOfResource(ctx, r.inputConfig.ResourceID, r.inputConfig.PinnedVersion)
...
if !found {
return nil, db.PinnedVersionNotFound{PinnedVersion: r.inputConfig.PinnedVersion}.String(), nil
}So a pin can only resolve if some check has already discovered and recorded that exact version.
Since #9492, checkFactory.Resources() (atc/db/check_factory.go) only includes a resource in Lidar's scan set if one of:
- it's a triggering input to some job (
bool_or(trigger) = true, excludingpassed:-constrained inputs), or - it has never been successfully checked, or
- it's a non-triggering input with zero versions in
resource_config_versions.
A resource that is (a) not a trigger, (b) already has a working pinned history, and (c) gets a new externally-published version pinned in config, satisfies none of these. It's permanently excluded from Lidar's rotation, so the new pin's version is never discovered, and pinnedResolver fails with "not found" — indefinitely, until someone manually runs fly check-resource -f <version>.
Workarounds we're aware of
fly check-resource -r <pipeline>/<resource> -f path:<value>immediately afterset-pipeline— works, but requires remembering to script it for every pin change, on every resource whose pin changed.webhook_tokenon the resource — requires external plumbing to call the webhook after publishing each artifact.trigger: true— works, but has broader semantics: it turns the resource into an active build trigger, which for pipelines using a single dedicated "trigger" resource to drive a serialpassed:chain (a common pattern) is an unwanted behavior change for every other pinned resource.- Holding off on upgrading past
8.1.xfor now — avoids the regression entirely (confirmed above), at the cost of missing8.2.x's fixes, including two CVEs (a containerd privilege-escalation fix in8.2.2and an open-redirect fix in8.2.3). This is what we've done in the meantime.
Proposed fix
Extend the third condition in checkFactory.Resources() from "non-triggering input resources with no versions in history" to "non-triggering input resources whose currently pinned version (if any) is not present in history." That directly targets the gap without reintroducing checks for every non-triggering resource (which is what #9492 was trying to avoid).
I have a fix implemented along these lines, with test coverage, here: https://github.com/fbehrens51/concourse/tree/fix/pinned-resource-lidar-check. Happy to open a PR against this if it looks like the right direction.
Note: this fix passes the full atc/db test suite (including a regression test confirmed to fail without it and pass with it), but hasn't yet been deployed and observed handling a real pinned-resource update end-to-end.
Steps to Reproduce
- Pipeline has a resource pinned via
version: {path: "artifact/artifact-1.0.0.zip"}, consumed only via a plain (non-trigger)get, and it's already been successfully checked at least once (so it has existing rows inresource_config_versions). - Something outside Concourse uploads
artifact/artifact-1.0.1.zipto the bucket. - Update the pipeline config's pin to
artifact/artifact-1.0.1.zipandset-pipeline. - Any job that gets this resource fails at "Preparing build" / "not found" for the pinned version — indefinitely — even though the object is confirmed to exist in the bucket.
Expected Results
Either:
- Lidar continues to check pinned, non-triggering resources when the currently configured pin isn't yet present in
resource_config_versions(a natural extension of the existing "no versions in history" fallback condition in theResources()query — the resource does have history, just not the newly pinned version), or pinnedResolverfalls back to an on-demand check whenFindVersionOfResourcemisses, instead of failing immediately.
Actual Results
The resource is silently dropped from all future automatic checking, and pin updates fail permanently without manual intervention.
Web Node(s) configuration
No response
Worker(s) configuration
No response
Concourse Version
= 8.2.4
Browser (if applicable)
No response
Did this use to work?
prior to 8.2.x, yes
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
taylorsilva commentedon Jul 20, 2026
Thanks for the report. Looked at the diff on your fork. I'd need to do some performance testing on the query before deciding that is the route to take.
I'll reproduce and see what solutions seems viable. I've added this to the next release milestone since I want to fix as many regressions as I can from the scheduling change I made in 8.2.
fbehrens51 commentedon Jul 20, 2026
Thanks for the update — Let me know if you need anything from me.
taylorsilva commentedon Jul 22, 2026
Took a different route and refactored the scheduler code to instead take into consideration pinned resources. Mostly meant deleting a bunch of code, so yay!
taylorsilva commentedon Jul 22, 2026
Realized my change didn't cover the case for automatically triggered builds! I think the query modification you've suggested is going to be the best way to resolve this.
Just did some
EXPLAIN ANALYZEon the query in question to see if there was any impact on performance:concourse/atc/db/check_factory.go
Lines 171 to 203 in 29cc3b4
Current query:
With new filter for resource pins:
Looks like no impact on the run time of the query. I ran this against the db backing https://ci.concourse-ci.org/
I'll make a PR merging in your changes and some of the stuff I changed as well. Ended up fixing up some tests while exploring the problem space.