snapcraft fails to unsquashfs some snaps
Metadata
Current evaluation
Fixed in canonical/snapcraft#6235 (commit 52bc82495), merged into main and planned for Snapcraft 9. Upload now unsquashes only snap.yaml and manifest.yaml, avoiding device-node errors.
Resolution: closed resolved
Reason: PR #6235 changed get_data_from_snap_file to extract only meta/snap.yaml and snap/manifest.yaml, preventing failures on snaps containing character devices. The merged commit closes #6206, and the maintainer confirmed it will be included in Snapcraft 9.
Evaluated by: mr-cal-bot
No scores available.
Issue body
### Check existing issues
- [x] I've verified that this bug isn't described by any existing issues.
### Bug description
snacraft from edge (8.14.5.post106) is having trouble with uploading some snaps because it cannot unsquash them:
```
$ snapcraft upload core26_20260422_s390x.snap --release latest/edge
Warning: Early core26 support is subject to change until core26 is stable.
could not unsquash snap file 'core26_20260422_s390x.snap'
Full execution log: '/home/abeato/.local/state/snapcraft/log/snapcraft-20260423-073841.626705.log'
```
I can unsquash the file without issue from the command line. I've seen this happening this before for an arm64 snap too. The build for this snap happened in LP: https://launchpad.net/~ubuntu-core-service/+snap/core26/+build/3130078
### Steps to reproduce
Provide step-by-step instructions to reproduce the bug.
### Environment
snapcraft run on 24.04.
### snapcraft.yaml
```yaml
```
### Log output
```shell
2026-04-23 07:38:41.628 Starting snapcraft, version 8.14.5.post106
2026-04-23 07:38:41.628 Log verbosity level set to BRIEF
2026-04-23 07:38:41.628 Setting up Project
2026-04-23 07:38:41.628 Project file found at '/home/abeato/Descargas/snapcraft.yaml'
2026-04-23 07:38:41.628 Loading project file 'snapcraft.yaml
2026-04-23 07:38:41.632 Setting up BuildPlan
2026-04-23 07:38:41.632 Build plan contains 1 build(s).
2026-04-23 07:38:41.637 Preparing application...
2026-04-23 07:38:41.637 Setting up ConfigService
2026-04-23 07:38:41.651 Warning: Early core26 support is subject to change until core26 is stable.
2026-04-23 07:38:41.652 Merging commands for group 'Lifecycle':
2026-04-23 07:38:41.652 - using application command for 'clean'.
2026-04-23 07:38:41.652 - using application command for 'pull'.
2026-04-23 07:38:41.652 - using application command for 'build'.
2026-04-23 07:38:41.652 - using application command for 'stage'.
2026-04-23 07:38:41.652 - using application command for 'prime'.
2026-04-23 07:38:41.652 - using application command for 'pack'.
2026-04-23 07:38:41.652 Merging commands for group 'Other':
2026-04-23 07:38:41.652 Configuring application...
2026-04-23 07:38:41.673 Build plan: platform=None, build_for=None
2026-04-23 07:38:41.673 Running snapcraft upload on host
2026-04-23 07:38:41.773 Unsquashing snap file 'core26_20260422_s390x.snap'.
2026-04-23 07:38:42.869 could not unsquash snap file 'core26_20260422_s390x.snap'
2026-04-23 07:38:42.874 Traceback (most recent call last):
2026-04-23 07:38:42.874 File "/snap/snapcraft/17698/lib/python3.12/site-packages/snapcraft/utils.py", line 410, in unsquash_snap
2026-04-23 07:38:42.874 subprocess.run(extract_command, capture_output=True, check=True)
2026-04-23 07:38:42.874 File "/snap/snapcraft/current/usr/lib/python3.12/subprocess.py", line 571, in run
2026-04-23 07:38:42.874 raise CalledProcessError(retcode, process.args,
2026-04-23 07:38:42.874 subprocess.CalledProcessError: Command '['unsquashfs', '-force', '-dest', '/home/abeato/Descargas/tmp625rvdwc', '/home/abeato/Descargas/core26_20260422_s390x.snap']' returned non-zero exit status 2.
2026-04-23 07:38:42.874 Full execution log: '/home/abeato/.local/state/snapcraft/log/snapcraft-20260423-073841.626705.log'
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Fixed in canonical/snapcraft#6235 (commit 52bc82495), merged into main and planned for Snapcraft 9. Upload now unsquashes only snap.yaml and manifest.yaml, avoiding device-node errors. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed by PR #6235 (commit 52bc82495, SNAPCRAFT-1337), merged to main: get_data_from_snap_file now unsquashes only meta/snap.yaml and snap/manifest.yaml instead of the whole snap, fixing upload failures on snaps containing device nodes. Ships in Snapcraft 9. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed in #6235 (commit 52bc82495): Snapcraft now extracts only snap.yaml and manifest.yaml during upload, avoiding device-extraction failures. Included in Snapcraft 9. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed by modifying the snap extraction utility to only extract required files, resolving unsquashfs failures on snaps containing character devices. The fix is included in Snapcraft 9. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed by updating the snap extraction utility to only extract necessary files instead of the entire archive, which previously failed on character devices like /dev/null. The fix is resolved and will be included in Snapcraft 9. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed snapcraft upload failing to unsquash snaps containing character devices. A utility change incorrectly extracted the entire snap. Extraction logic was updated to only pull necessary files. Fix included in Snapcraft 9. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Snapcraft upload failed to unsquash snaps containing character devices after a change extracted the entire archive. The extraction utility was updated to only extract necessary files. The bug is fixed and will be included in Snapcraft 9. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
canonical/snapcraft#6235
(confidence 100%)
Merged fix commit 52bc82495 limits unsquashing to metadata files and closes #6206.
-
Caused By:
canonical/snapcraft#6109
(confidence 99%)
Commit 5864b582e migrated upload metadata extraction to a utility that extracted the entire snap.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #6235 fix(utils): only unsquash metadata files | snapcraft | merged | PR #6235 (commit 52bc82495, SNAPCRAFT-1337) merged to main, making get_data_from_snap_file unsquash only meta/snap.yaml and snap/manifest.yaml, fixing upload/keys failures on snaps containing device nodes. Closes #6206. | |
| #5132 push of locally built snap fails on arm64 device | snapcraft | closed | Fixed in Snapcraft 8.6 by merged PR #5136 (commit 2e7f5c3b), which migrated Snapcraft to core24 and updated bundled unsquashfs to 4.6.1; overlapping PR #5147 was closed. | |
| #5147 fix(unsquashfs): fix Fatal Error when using unsquashfs | snapcraft | closed | Closed unmerged as overlapping work: PR #5136 (commit 2e7f5c3b) delivered the same squashfs-tools 4.6.1/Core24 update in Snapcraft 8.6. |