← Back to issue list

Destructive mode with sudo: /snap/bin/snapcraft: 4: exec: /bin/snapcraft: not found

View original Github issue

Metadata

Project
snapcraft
Number
#6419
Type
issue
State
open
Author
nteodosio
Labels
—
Created
Updated
Closed
—

Current evaluation

Confirmed snap shim failure under sudo in Docker when SNAP is stripped; setting SNAP=/snap/snapcraft/current works around the launcher error, but ownership remains unresolved.

Suggested action: keep open

Reason: Maintainer @lengau identified a likely snap shim or snapd behavior change, and the reporter confirmed that SNAP=/snap/snapcraft/current bypasses the original /bin/snapcraft failure. The problem is acknowledged, reproducible, and blocking Firefox CI, but no fix, root-cause confirmation, or owning snapd issue has been identified.

Evaluated by: mr-cal-bot

Impact: 46 Quick Win: 14 Complexity: 52 Confidence: 88 Actionability: 64

Issue body

### Check existing issues - [x] I've verified that this bug isn't described by any existing issues. ### Bug description The Firefox CI, which runs Snapcraft in Docker, has been failing when cross-compiling to Arm64: ``` [task 2026-09-14T13:17:52.860+00:00] + snapcraft --destructive-mode --verbosity verbose --build-for arm64 [task 2026-09-14T13:17:53.817+00:00] Starting snapcraft, version 8.14.5 [task 2026-09-14T13:17:53.817+00:00] Logging execution to '/builds/worker/.local/state/snapcraft/log/snapcraft-20260914-131753.793351.log' [task 2026-09-14T13:17:53.817+00:00] Running snapcraft without a command will not be possible in future releases. Use 'snapcraft pack' instead. [task 2026-09-14T13:17:53.819+00:00] Warning: Running in destructive mode as a non-super user is not recommended and may cause unexpected behavior. [task 2026-09-14T13:17:56.984+00:00] Package repositories installed [task 2026-09-14T13:17:56.995+00:00] Initializing lifecycle [task 2026-09-14T13:17:56.998+00:00] Installing build-packages [task 2026-09-14T13:18:00.737+00:00] Packages list not refreshed, not running as superuser. ``` -- https://firefoxci.taskcluster-artifacts.net/E8kZ5nrXTw-tMKuHsdWmfQ/0/public/logs/live_backing.log If I try to run snapcraft with sudo, this happens instead: ``` [task 2026-09-15T08:35:50.175+00:00] + sudo snapcraft --destructive-mode --verbosity verbose --build-for amd64 [task 2026-09-15T08:35:50.183+00:00] /snap/bin/snapcraft: 4: exec: /bin/snapcraft: not found ``` -- https://firefoxci.taskcluster-artifacts.net/HvJB-_qpSfCKFmzK-gboUA/0/public/logs/live_backing.log The script running snapcraft is [run.sh](https://searchfox.org/firefox-main/source/taskcluster/docker/snap-coreXX-build/run.sh). This is Snapcraft 8.14.5. Unfortunately, I do not have information as to at which version started being an issue. ### Steps to reproduce I reproduce the error by cloning Firefox sources and doing a TRY run with `./mach try fuzzy --full -q "'snap 'upstream 'local"`. ### Environment Snapcraft in destructive mode in Docker ### snapcraft.yaml ```yaml If the issue is specific to a project, share its `snapcraft.yaml`. This field automatically renders as YAML, so you don't need to add special formatting. ``` ### Log output ```shell Provide any relevant logging. This field automatically renders as a log, so you don't need to add special formatting. ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 46
Quick Win: 14
Complexity: 52
Confidence: 88
Actionability: 64
keep open Confirmed snap shim failure under sudo in Docker when SNAP is stripped; setting SNAP=/snap/snapcraft/current works around the launcher error, but ownership remains unresolved.
stealth/space-bunny-alpha
Impact: 42
Quick Win: 11
Complexity: 57
Confidence: 89
Actionability: 60
needs triage Confirmed Snap shim failure when Snapcraft runs via sudo in Docker: SNAP is unset, causing a /bin/snapcraft lookup failure. Snapd 2.76.3 workaround works; root cause is unassigned.
stealth/space-bunny-alpha
Impact: 43
Quick Win: 11
Complexity: 58
Confidence: 81
Actionability: 63
needs triage Snapcraft 8.14.5's snap shim fails under sudo in Docker with exec: /bin/snapcraft: not found. Maintainers suspect snapd; preserving SNAP works around it, but later dependency errors remain.
qwen/qwen3.6-35b-a3b
Impact: 60
Quick Win: 33
Staleness: 5
Complexity: 45
Confidence: 70
Support Request: 10
needs triage Running snapcraft with sudo in destructive mode fails with '/snap/bin/snapcraft: 4: exec: /bin/snapcraft: not found'. Fresh report with clear reproduction steps and logs.

Update history

Date Change
updated
updated
updated
updated
updated
created

Related issues

Issue Project State Summary Similarity
#6328 Snapcraft 9: cannot create directory '/snap/command-chain': Permission denied Edit snapcraft closed Confirmed as a Snapcraft 9 destructive-mode regression and moved to internal SNAPCRAFT-1366, but no public fixing PR or commit was recorded before closure.
70%