snapcraft fails to unsquashfs some snaps
Metadata
Current evaluation
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.
Suggested action: —
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 |
|---|---|---|---|---|
| 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. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Fixed by modifying the snap extraction utility to only extract necessary files, resolving the unsquashfs failure with character devices. The issue is closed and the fix will ship in Snapcraft 9. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1902 many: use in-snap unsquashfs and readelf if running from snap | snapcraft | merged | Merged after review approval and passing CI. The change updates Snapcraft to use in-snap unsquashfs and readelf when running from a snap, modifying 11 files with 133 additions and 20 deletions. | |
| #5147 fix(unsquashfs): fix Fatal Error when using unsquashfs | snapcraft | closed | Author closed the PR to avoid overlap. The unsquashfs data queue bug was fixed via PR #5136, updating squashfs-tools to 4.6.1. The fix is in the edge channel and targeted for Snapcraft 8.6. | |
| #1752766 Snapcraft fails to prime part containg device files | snapcraft (launchpad) | closed | Closed without a direct fix. Snapcraft crashes when priming parts with device files, throwing an OSError during ELF detection. The bug was likely abandoned or resolved in newer Snapcraft versions. |