fix(ci): set up snapd in the release job instead of assuming it - #3360
Draft
vroldanbet wants to merge 1 commit into
Draft
vroldanbet wants to merge 1 commit into
vroldanbet wants to merge 1 commit into
Conversation
The release job installs snapcraft with
sudo snap install snapcraft --channel=8.x/stable --classic
which fails on runner images where snapd is not running:
error: cannot communicate with server: Post "http://localhost/v2/snaps/snapcraft":
dial unix /run/snapd.socket: connect: no such file or directory
The identical step in nightly.yaml fails this way on pushes to main today, and
#3321 hit it in the Trivy job. Those two jobs never needed snapcraft and the
step was simply removed. This job does need it: goreleaser builds the snap
declared in .goreleaser.yml here, and this is the job that publishes it to the
Snap Store. Left alone it will fail the same way on the next tag.
So the step now provisions snapd rather than assuming it. It probes for
/run/snapd.socket, installs and starts snapd when the socket is missing,
waits for seeding to finish, and only then installs snapcraft. apt and
systemctl are allowed to fail quietly because the socket check that follows
decides, and gives a clearer message than either would.
If snapd still cannot be had, the step exits 1 with an explicit message rather
than carrying on. Skipping the snap build instead would be worse: a release
that quietly stops publishing the snap is harder to notice than one that stops.
The snap is a live channel, not a leftover - it is at 1.56.2, matching the
latest tag, and the docs list `sudo snap install spicedb` as an install method
for Ubuntu and Debian.
The wait for seeding is bounded at five minutes. #3321 recorded snapd on these
images hanging rather than failing ("timeout waiting for snap system profiles
to get updated"), and a release job that hangs to the six hour limit is worse
than one that stops with a message.
Both failure paths were exercised in a container with no snapd: each prints its
message and exits 1. The success path has not been observed - see the pull
request for what that does and does not tell us.
vroldanbet
force-pushed
the
fix/ci-release-snapd
branch
from
September 22, 2026 14:12
db9dca6 to
edf3c4d
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Makes the "Install snapcraft" step in
.github/workflows/release.yamlset up snapd rather than assume it is already there, and fail with a clear message if it cannot.One file. Independent of #3356 — different file, no dependency, so neither has to wait for the other.
Why
The step installs snapcraft with
sudo snap install, which fails on runner images where snapd is not running:The identical step in
nightly.yamlfails this way on pushes tomaintoday, and #3321 hit it in the Trivy job. In both of those cases snapcraft was never needed and the step was simply deleted. This job is different: goreleaser builds the snap declared in.goreleaser.ymlhere, and this is the job that publishes it to the Snap Store. Left alone, it will fail the same way on the next tag.The snap is a live channel, not a leftover: it is at 1.56.2, matching the latest tag, and the docs list
sudo snap install spicedbas an install method for Ubuntu and Debian. That is why this is fixed rather than dropped.How
The step probes for
/run/snapd.socket, installs and starts snapd when it is missing, waits for seeding to finish, then installs snapcraft.aptandsystemctlare allowed to fail quietly because the socket check after them is what decides, and it gives a clearer message than either would.If snapd still cannot be had, the step prints a
::error::and exits 1. It deliberately does not skip the snap build instead — a release that quietly stops publishing the snap is harder to notice than one that stops loudly.The wait for seeding is capped at five minutes. #3321 recorded snapd on these images hanging rather than failing outright ("timeout waiting for snap system profiles to get updated"), and a release job that hangs until the six-hour limit is worse than one that stops with a message.
What is verified, and what is not
Please read this part — the split between the two is the main thing a reviewer needs from me.
Verified by running:
::error::and exit 1.bash -non the step's script.yamllintandprettier, matching whatmage lint:yamlruns.Not verified — never observed:
The success path — apt installs snapd, systemd starts it, seeding completes, snapcraft installs — is reasoned from the step's structure only. I have not seen it run. It will execute for real for the first time on the next tag, during an actual release.
I could not find a genuinely safe way to rehearse it. This workflow does have
workflow_dispatch, but dispatching it cuts a real release, so it is not a free trial run. Running the same script on a stock Ubuntu container is not a rehearsal either: the failure mode being fixed is a property of the runner image, and a container that already lacks systemd exercises the error branch rather than the success branch. If a reviewer knows a safe way to exercise this against a real runner, I would rather do that than merge on reasoning.The mitigating factor is the shape of the failure, not the confidence in the fix: if the new step is wrong, the release job stops with a message at the same point it stops today. That is the behaviour it is designed for, and it does not publish a partial or snap-less release silently.
References