← Back to issue list

Force upstream cache revalidation for mutable repository metadata

View original Github issue

Metadata

Project
fetch-service
Number
#653
Type
issue
State
open
Author
lengau
Labels
—
Created
Updated
Closed
—

Current evaluation

Maintainer-filed: stale proxy-cached apt InRelease can predate a newly published Packages.gz, triggering validatePackagesFile checksum failures (HTTP 403). Proposed fix: inject Cache-Control: max-age=0, must-revalidate on upstream metadata requests; approach still under discussion.

Suggested action: keep open

Reason: Authored by maintainer lengau with a fully traced root-cause chain (X-Cache: HIT with Expires 19:02:36 predating Packages.gz Last-Modified 19:08:51, leading to validatePackagesFile rejecting the file) plus a concrete failing CI run link, so it is a valid, acknowledged defect that should stay open. It is not close_resolved because no labels/PR/commit reference a fix, and the single comment ('Alternatively, we could re-download InRelease with that header if Release doesn't match?') shows the design is still contested rather than settled. Confidence is capped because repository inspection tools were unavailable (all greps and git_log calls returned 'No pinned SHA available'), so I could not confirm current header-handling code paths, and the intermittent, proxy-timing-dependent nature of the failure makes reproduction non-deterministic.

Evaluated by: mr-cal-bot

Impact: 57 Quick Win: 19 Complexity: 52 Confidence: 68 Actionability: 70

Issue body

### What needs to get done Ensure that upstream HTTP requests for mutable repository index and metadata files include cache-revalidation headers (e.g. Cache-Control: max-age=0, must-revalidate or no-cache). Specifically: 1. Identify mutable metadata endpoints (such as apt `InRelease`, `Release`, `Release.gpg`) 2. Inject upstream `Cache-Control: max-age=0, must-revalidate` to try to force revalidation of the cache. 3. Ensure conditional headers (If-Modified-Since, If-None-Match) continue to be forwarded appropriately so upstream mirrors can respond with 304 Not Modified when the cache is actually fresh. ### Why it needs to get done Example failure: https://github.com/canonical/fetch-service/actions/runs/35915975553/job/107367412660 1. The test requested InRelease from security.ubuntu.com. The Squid proxy served an expired cached object (X-Cache: HIT, Expires: 19:02:36 GMT, Last-Modified: 18:32:36 GMT) 2. The test subsequently requested Packages.gz. The upstream proxy experienced a cache miss and fetched the newly-published version from origin (Last-Modified: 19:08:51 GMT). 3. Because the cached InRelease predated the newly updated Packages.gz, the correct checksum for Packages.gz was not listed in InRelease. 4. validatePackagesFile in release.go correctly rejected the file ("Packages file not listed in Release file"),` causing the download to fail with HTTP 403. By having fetch-service enforce `Cache-Control: max-age=0, must-revalidate` on upstream metadata requests, intermediate proxies and caches are forced to conditionally revalidate index files against the upstream mirror, preventing stale metadata from causing spurious integrity verification failures on rolling/active repositories.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 57
Quick Win: 19
Complexity: 52
Confidence: 68
Actionability: 70
keep open Maintainer-filed: stale proxy-cached apt InRelease can predate a newly published Packages.gz, triggering validatePackagesFile checksum failures (HTTP 403). Proposed fix: inject Cache-Control: max-age=0, must-revalidate on upstream metadata requests; approach still under discussion.
stealth/space-bunny-alpha
Impact: 66
Quick Win: 17
Complexity: 56
Confidence: 82
Actionability: 59
needs triage Fresh maintainer-reported defect: cached InRelease can predate a newly published Packages.gz and cause integrity verification failures; revalidation design remains under discussion.
stealth/space-bunny-alpha
Impact: 44
Quick Win: 22
Complexity: 43
Confidence: 89
Actionability: 86
needs triage Needs triage to revalidate cached repository metadata upstream, preventing stale indexes from failing package integrity checks after rolling releases.

Update history

Date Change
updated
created

Related issues

No related issues found above the similarity threshold.