Skip to content

fix: fallbacks on current archive if old release not moved yet - #313

Open
upils wants to merge 4 commits into
canonical:mainfrom
upils:fix/old-releases-not-moved
Open

upils wants to merge 4 commits into
canonical:mainfrom
upils:fix/old-releases-not-moved

Conversation

@upils

@upils upils commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator
  • Have you signed the CLA?

When an Ubuntu release passes its end-of-life date, Chisel routes to old-releases.ubuntu.com. However, the physical migration of the suite to that mirror is a manual admin operation that can lag the scheduled EOL — so for recently-EOL releases (e.g. 25.04, 25.10), old-releases returns 404 and archive.Open fails, blocking rootfs cuts.

archiveURL became candidateArchiveURLs, returning the base URLs to try in order of preference (old-releases first, current archive as fallback for old releases). openUbuntu now attempts a full open against each candidate, falling back only on a missing release (404) — auth, network or signature errors still fail immediately, so a broken archive is never masked. The index-opening flow was extracted into ubuntuArchive.setupIndexes so it can be retried per candidate without duplicate downloads: the winning candidate's InRelease fetch is the one used going forward.

Fix #312

Signed-off-by: Paul Mars <paul.mars@canonical.com>
@upils upils added the Simple Nice for a quick look on a minute or two label Jul 22, 2026

@niemeyer niemeyer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs some work so it's a bit more polished as well.

Comment thread internal/archive/archive.go Outdated
}

func archiveURL(pro, arch string, oldRelease bool) (string, *credentials, error) {
func archiveURL(pro, arch string, oldRelease bool) (string, string, *credentials, error) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's please make this a []string, and implement the feature in terms of it being fallback URLs, first one wins.

The function also needs a comment explaining this, in either new implementation. It's not just an archiveURL anymore, which is what it says on the tin.

Also, as a hint for the future: when results are naked like this (string, string), they need names so that we can tell what they are at a glimpse.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed, documented and changed the signature of the function. I think the candidateArchiveURLs better convey to the caller that they must then pick one from the list and not use all of the entries.

Thanks for the hint.

Comment thread internal/archive/archive.go Outdated
}
_, err := probe.fetch(probe.distPath("InRelease"), "", fetchDefault)
if err == errNotFound {
archive.baseURL = fallbackURL

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems quite hackish. Look at the logic below.. where is "InRelease"?

Let's please implement an elegant fallback mechanism using the abstractions and respecting the encapsulations we already have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Simple Nice for a quick look on a minute or two

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(25.10): chisel cut failing for 25.10

2 participants