← Back to issue list

snapcraft fails to run if it is installed as a try snap

View original Launchpad issue

Metadata

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

Current evaluation

Snapcraft 4.x fails when installed via 'snap try': the LXD build provider tries to download the host snapcraft snap file from snapd, which returns 400 for try snaps. Unlabelled, 0 comments, ~6 years old, never triaged.

Suggested action: needs triage

Reason: The issue has no labels, 0 comments, and no maintainer interaction in ~6 years, so it has never been assessed. It cannot be closed as stale because the root cause (snapd refusing to serve try-snap files, cited from snapd's api_snap_file.go) is a permanent snapd constraint, and a nearly identical later report (launchpad #2014963) is still open; a maintainer should verify whether the current craft-providers-based host-snap injection still fails and consolidate the two reports.

Impact: 25 Quick Win: 13.75 Staleness: 95 Complexity: 45 Confidence: 55 Support Request: 10

Issue body

if you install a version of snapcraft via try mode, i.e. `snap try --classic squashfs-root` for an unpacked snapcraft snap, it fails to run because it can't download the snapcraft snap file: ``` 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Waiting for network to be ready... 2020-08-21T16:56:10Z INFO Waiting for automatic snapd restart... core 16-2.45.3.1 from Canonical✓ installed "core" switched to the "latest/stable" channel core18 20200807 from Canonical✓ installed "core18" switched to the "latest/edge" channel Sorry, an error occurred in Snapcraft: 400 Client Error: Bad Request for url: http+unix://%2Frun%2Fsnapd.socket/v2/snaps/snapcraft/file We would appreciate it if you anonymously reported this issue. No other data than the traceback and the version of snapcraft in use will be sent. Would you like to send this error data? (Yes/No/Always/View) [no]: yes Thank you, sent. You can find the traceback in file '/tmp/tmpn2l6zob_/trace.txt'. ``` Traceback (most recent call last): File "/snap/snapcraft/x1/bin/snapcraft", line 33, in <module> sys.exit(load_entry_point('snapcraft==4.1.5.post12+gitfbd93aaa', 'console_scripts', 'snapcraft')()) File "/snap/snapcraft/x1/lib/python3.6/site-packages/click/core.py", line 829, in __call__ return self.main(*args, **kwargs) File "/snap/snapcraft/x1/lib/python3.6/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx) File "/snap/snapcraft/x1/lib/python3.6/site-packages/click/core.py", line 1236, in invoke return Command.invoke(self, ctx) File "/snap/snapcraft/x1/lib/python3.6/site-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, **ctx.params) File "/snap/snapcraft/x1/lib/python3.6/site-packages/click/core.py", line 610, in invoke return callback(*args, **kwargs) File "/snap/snapcraft/x1/lib/python3.6/site-packages/click/decorators.py", line 21, in new_func return f(get_current_context(), *args, **kwargs) File "/snap/snapcraft/x1/lib/python3.6/site-packages/snapcraft/cli/_runner.py", line 132, in run snap_command.invoke(ctx) File "/snap/snapcraft/x1/lib/python3.6/site-packages/snapcraft/cli/_command.py", line 88, in invoke return super().invoke(ctx) File "/snap/snapcraft/x1/lib/python3.6/site-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, **ctx.params) File "/snap/snapcraft/x1/lib/python3.6/site-packages/click/core.py", line 610, in invoke return callback(*args, **kwargs) File "/snap/snapcraft/x1/lib/python3.6/site-packages/snapcraft/cli/lifecycle.py", line 354, in snap _execute(steps.PRIME, parts=tuple(), pack_project=True, output=output, **kwargs) File "/snap/snapcraft/x1/lib/python3.6/site-packages/snapcraft/cli/lifecycle.py", line 116, in _execute project=project, echoer=echo, build_provider_flags=build_provider_flags File "/snap/snapcraft/x1/lib/python3.6/site-packages/snapcraft/internal/build_providers/_base_provider.py", line 87, in __enter__ self.create() File "/snap/snapcraft/x1/lib/python3.6/site-packages/snapcraft/internal/build_providers/_lxd/_lxd.py", line 284, in create self.launch_instance() File "/snap/snapcraft/x1/lib/python3.6/site-packages/snapcraft/internal/build_providers/_base_provider.py", line 259, in launch_instance self._setup_snapcraft() File "/snap/snapcraft/x1/lib/python3.6/site-packages/snapcraft/internal/build_providers/_lxd/_lxd.py", line 470, in _setup_snapcraft super()._setup_snapcraft() File "/snap/snapcraft/x1/lib/python3.6/site-packages/snapcraft/internal/build_providers/_base_provider.py", line 470, in _setup_snapcraft snap_injector.apply() File "/snap/snapcraft/x1/lib/python3.6/site-packages/snapcraft/internal/build_providers/_snap.py", line 394, in apply snap.push_host_snap(file_pusher=self._file_pusher) File "/snap/snapcraft/x1/lib/python3.6/site-packages/snapcraft/internal/build_providers/_snap.py", line 141, in push_host_snap snap_path=snap_file_path, assertion_path=assertion_file_path File "/snap/snapcraft/x1/lib/python3.6/site-packages/snapcraft/internal/repo/snaps.py", line 198, in local_download snap_file_iter = _get_local_snap_file_iter(self.name, chunk_size=1024) File "/snap/snapcraft/x1/lib/python3.6/site-packages/snapcraft/internal/repo/snaps.py", line 373, in _get_local_snap_file_iter snap_file.raise_for_status() File "/snap/snapcraft/x1/lib/python3.6/site-packages/requests/models.py", line 940, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http+unix://%2Frun%2Fsnapd.socket/v2/snaps/snapcraft/file This is expected as you cannot download the snap file for a try mode snap: https://github.com/snapcore/snapd/blob/f964a2817cbc0a61aface6104768b6a80c00a2ca/daemon/api_snap_file.go#L63-L65

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 25
Quick Win: 13.75
Staleness: 95
Complexity: 45
Confidence: 55
Support Request: 10
needs triage Snapcraft 4.x fails when installed via 'snap try': the LXD build provider tries to download the host snapcraft snap file from snapd, which returns 400 for try snaps. Unlabelled, 0 comments, ~6 years old, never triaged.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 10
Confidence: 90
Support Request: 80
close not a bug Running snapcraft via 'snap try' fails because snapd does not support fetching snap files for try-mode snaps. The issue is ~6 years old with no maintainer response.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 15
Confidence: 90
Support Request: 75
close not a bug Reports snapcraft failing when installed via snap try due to an expected 400 error fetching the snap file. Author acknowledges this is a known snap try limitation. No maintainer response in ~6 years.
qwen3.6-35b-a3b-mtp-q6
Staleness: 98
Complexity: 15
Confidence: 90
Support Request: 75
close not a bug Snapcraft fails when run from a snap try installation because it attempts to fetch its own snap file via snapd, which is blocked for try mode snaps. Unlabelled and inactive for nearly six years.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 40
Confidence: 85
Support Request: 10
close stale Running snapcraft via snap try mode triggers a 400 error when fetching the snapcraft snap file. The report remains open with zero comments and over four years of inactivity, requiring triage.

Update history

No update history recorded yet.

Related work

  • Related To: snapcraft (launchpad)#2014963 (confidence 75%)

    Nearly identical later report ('Snapcraft fails to build snap if Snapcraft itself is installed using snap try'), still open and untriaged, indicating the problem persisted after this 2020 report.

  • Related To: snapcraft (launchpad)#1729069 (confidence 45%)

    Earlier 'snapcraft container builds with snap try' report, closed without resolution; different failure mode (cp traceback) but same try-snap plus container-build context.

Related issues

Issue Project State Summary Similarity
#2014963 Snapcraft fails to build snap if Snapcraft itself is installed using `snap try` snapcraft (launchpad) open Snapcraft fails when using snap try due to snapd not allowing file downloads for try-mode snaps. Issue is 1251 days old with no maintainer engagement.
78%
#1795827 Snapcraft doesn't install snapcraft inside the lxd container snapcraft (launchpad) open Snapcraft's LXD build provider failed to install the snapcraft snap inside the container, leaving 'snapcraft: not found'. Reported ~8 years ago with no maintainer interaction; the provider code has since been heavily refactored (craft-providers integration).
75%
#1978844 snapcraft try not available for core22-based snap snapcraft (launchpad) closed Closed without resolution or comments. The snapcraft try command remains unavailable for core22-based snaps, with attempts failing or falling back to legacy implementations.
75%
#1839399 snapcraft not pulling snap from lxd container snapcraft (launchpad) open 2019 report that snapcraft 3.7.1 with --use-lxd built a snap inside the LXD container but never copied it back to the host. No labels, no maintainer interaction, 7 years old; the LXD provider has since been rewritten via craft-providers.
74%
#1896820 Snapcraft can't be run against a local or remote LXD project snapcraft (launchpad) open Feature request from the LXD maintainer for snapcraft to support LXD projects (local/remote) for isolated or cluster-based builds. ~6 years old, no labels, zero comments, no maintainer response. Overlaps with remote LXD work tracked in snapcraft#4454.
74%
#1996508 snapcraft try with core22 doesn't support lxd snapcraft (launchpad) closed Closed without resolution. The snapcraft try --use-lxd command fails with core22 bases due to an LXD provider limitation. No fix was implemented, and the report was abandoned after extended inactivity.
74%
#1746612 Snapcraft cleanbuild doesn't work if you're not using the LXD snap snapcraft (launchpad) closed Closed without resolution. Snapcraft hardcodes the LXD snap path during cleanbuild, causing failures with deb-installed LXD. The report appears abandoned or superseded by updated Snapcraft versions that dynamically detect LXD installations.
73%
#1666735 snapcraft cleanbuild does not work with lxd installed via snap snapcraft (launchpad) closed Closed without resolution or merge. The report notes snapcraft cleanbuild fails to detect LXD installed via snap, suggesting checks via snap list or lxc list instead of apt cache. No fix was implemented or documented.
73%
#1865230 snapcraft --use-lxd should have message about requring sudo snapcraft (launchpad) open snapcraft 3.x --use-lxd (LXD provider, a technology preview) left LXD in a broken state when run without sudo; reporter suggests failing early. 6.5 years old, zero comments, no labels or maintainer interaction; LXD preview since superseded by Multipass.
71%
#1697979 snapcraft fails on initial cleanbuild probe snapcraft (launchpad) closed Closed without resolution. Snapcraft cleanbuild failed due to LXD connection errors when LXD was provided via a third-party snap alias. The report received no comments or fixes and was abandoned.
71%