← Back to issue list

It is not possible to install a build-snap with the default track

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1716054
Type
issue
State
open
Author
~elopio
Labels
Created
Updated
Closed

Current evaluation

Snapcraft build-snaps fails with KeyError when a channel is given without a track (e.g. snap/edge), because the code looks up store channels by the bare channel name instead of track/risk. Old bug, no maintainer response, no labels.

Suggested action: needs triage

Reason: Filed by maintainer elopio with a clear traceback (KeyError: 'edge' in repo/snaps.py is_classic) and a working workaround (specify the track explicitly), but it has 0 comments, no labels, and no maintainer acknowledgement in ~9 years, so it has never been triaged. The referenced code path (snapcraft/internal/repo/snaps.py) no longer exists in the current layout, so it needs a maintainer to confirm whether the bug still reproduces before closing.

Impact: 40 Quick Win: 26.0 Staleness: 95 Complexity: 35 Confidence: 55 Support Request: 10

Issue body

When the track is not specified, latest is used. For example, it is possible to install with: sudo snap install u1test-snap-with-tracks --channel edge which would be the same as: sudo snap install u1test-snap-with-tracks --channel edge However, when using build-snaps in snapcraft, if I write: build-snaps: [u1test-snap-with-tracks/edge] it will fail with: Traceback (most recent call last): File "/home/ubuntu/venv/snapcraft/bin/snapcraft", line 6, in <module> exec(compile(open(__file__).read(), __file__, 'exec')) File "/home/ubuntu/workspace/canonical/snapcraft/bin/snapcraft", line 36, in <module> obj=dict(project=snapcraft.ProjectOptions())) File "/home/ubuntu/venv/snapcraft/lib/python3.5/site-packages/click/core.py", line 722, in __call__ return self.main(*args, **kwargs) File "/home/ubuntu/venv/snapcraft/lib/python3.5/site-packages/click/core.py", line 697, in main rv = self.invoke(ctx) File "/home/ubuntu/venv/snapcraft/lib/python3.5/site-packages/click/core.py", line 1043, in invoke return Command.invoke(self, ctx) File "/home/ubuntu/venv/snapcraft/lib/python3.5/site-packages/click/core.py", line 895, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/ubuntu/venv/snapcraft/lib/python3.5/site-packages/click/core.py", line 535, in invoke return callback(*args, **kwargs) File "/home/ubuntu/venv/snapcraft/lib/python3.5/site-packages/click/decorators.py", line 17, in new_func return f(get_current_context(), *args, **kwargs) File "/home/ubuntu/workspace/canonical/snapcraft/snapcraft/cli/__init__.py", line 110, in run ctx.forward(lifecyclecli.commands['snap']) File "/home/ubuntu/venv/snapcraft/lib/python3.5/site-packages/click/core.py", line 553, in forward return self.invoke(cmd, **kwargs) File "/home/ubuntu/venv/snapcraft/lib/python3.5/site-packages/click/core.py", line 535, in invoke return callback(*args, **kwargs) File "/home/ubuntu/workspace/canonical/snapcraft/snapcraft/cli/lifecycle.py", line 132, in snap project_options, directory=directory, output=output) File "/home/ubuntu/workspace/canonical/snapcraft/snapcraft/internal/lifecycle.py", line 349, in snap execute('prime', project_options) File "/home/ubuntu/workspace/canonical/snapcraft/snapcraft/internal/lifecycle.py", line 120, in execute repo.snaps.install_snaps(config.build_snaps) File "/home/ubuntu/workspace/canonical/snapcraft/snapcraft/internal/repo/snaps.py", line 167, in install_snaps snap_pkg.install() File "/home/ubuntu/workspace/canonical/snapcraft/snapcraft/internal/repo/snaps.py", line 136, in install if self.is_classic(): File "/home/ubuntu/workspace/canonical/snapcraft/snapcraft/internal/repo/snaps.py", line 119, in is_classic return store_channels[self.channel]['confinement'] == 'classic' KeyError: 'edge' To reproduce, build using the snapcraft.yaml from http://paste.ubuntu.com/25492423/ with the latest unreleased snapcraft. It works when the track is specified: build-snaps: [u1test-snap-with-tracks/latest/edge]

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 40
Quick Win: 26.0
Staleness: 95
Complexity: 35
Confidence: 55
Support Request: 10
needs triage Snapcraft build-snaps fails with KeyError when a channel is given without a track (e.g. snap/edge), because the code looks up store channels by the bare channel name instead of track/risk. Old bug, no maintainer response, no labels.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 30
Confidence: 90
Support Request: 5
close stale Bug in snapcraft where build-snaps fail with a KeyError when the track is omitted from the channel string. Issue is 8.9 years old with no maintainer interaction or updates.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 35
Confidence: 90
Support Request: 5
close stale Snapcraft fails to install build-snaps using the default track, causing a KeyError. The report is over 8 years old with no maintainer response or comments.
qwen3.6-35b-a3b-mtp-q6
Staleness: 98
Complexity: 30
Confidence: 90
Support Request: 5
close stale snapcraft throws a KeyError when installing a build-snap without an explicit track. The report is over 8 years old with zero maintainer interaction or labels.
qwen3.6-35b-a3b-mtp-q6
Staleness: 98
Complexity: 30
Confidence: 90
Support Request: 5
close stale Snapcraft crashes with a KeyError when installing a build-snap with a specified channel or track in snapcraft.yaml. Open, inactive for nearly nine years, zero comments, no labels. Needs triage and assignment.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/snapcraft#1442 (confidence 70%)

    build-snaps feature (the syntax this bug affects) was implemented in PR #1518 closing issue #1442; this issue is a follow-up bug in that feature's channel/track handling.

Related issues

Issue Project State Summary Similarity
#1716055 It is not possible to install a build-snap with a closed risk snapcraft (launchpad) open build-snaps with a closed channel (e.g. latest/candidate) crashes with KeyError instead of falling back to the next open risk level; filed by maintainer elopio 9 years ago, zero activity, old internal/repo code path no longer exists in current architecture
70%