Error message on snap pack is not nice
Metadata
Current evaluation
Fixed by merged PR #4424 (commit ec09cc07b): pack failures now show concise snapd errors while command details remain in execution logs; backported to 7.x and 8.x.
Resolution: closed resolved
Reason: PR #4424 was merged into hotfix/7.5 as ec09cc07b, moving raw subprocess details to the log while surfacing snapd's concise stderr. The maintainer confirmed the fix for the 7.x and 8.x branches.
Evaluated by: mr-cal-bot
No scores available.
Issue body
### Bug Description
The error needs cleanup, the command run is relevant for debugging, we need to clean it up and present the operation and the error from that operation
### To Reproduce
run `snapcraft pack` for the presented project
### Environment
Ubuntu
### snapcraft.yaml
```shell
name: pack-error
summary: show bad pack error
base: core22
description: |
show the not so nice error rendered by snapcraft
when pack --check-skeleton errors due to the use of =
confinement: strict
version: "1.0"
grade: stable
apps:
pack-error:
command: pack-error foo=bar
parts:
pack-error:
source: .
plugin: dump
```
### Relevant log output
```shell
Executed: pull pack-error
Executed: build pack-error
Executed: stage pack-error
Executed: prime pack-error
Executed parts lifecycle
Generated snap metadata
Running linter: library :: Cannot pack snap file: Command '['snap', 'pack', '--check-skeleton', PosixPath('/home/sergiusens/f/prime')]' returned non-zero exit status 1. (error: cannot validate snap "pack-error": invalid definition of application "pack-error": app description field 'command' contains illegal "pack-error foo=bar" (legal: '^[A-Za-z0-9/. _#:$-]*$'))
Running linter: library :: Full execution log: '/home/sergiusens/.local/state/snapcraft/log/snapcraft-20231020-092117.502041.log'
```
### Additional context
```
$ cat pack-error
#!/bin/bash
echo "$@"
$ ./pack-error foo=bar
foo=bar
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Fixed by merged PR #4424 (commit ec09cc07b): pack failures now show concise snapd errors while command details remain in execution logs; backported to 7.x and 8.x. | |
| stealth/space-bunny-alpha | — | closed resolved | Cleaned up Snapcraft’s pack failure output in merged PR #4424 (ec09cc07b), releasing the fix in the 7.x and 8.x branches. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed in 7.x and 8.x by merged PR #4424 (commit ec09cc07b), which hid snapcraft’s internal error details in logs and displayed a cleaner snap pack failure message. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed in snapcraft 7.x and 8.x. Error handling for snapcraft pack was updated to cleanly surface the underlying snap pack --check-skeleton validation error, removing cluttered internal execution details from the output. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed in versions 7.x and 8.x. The maintainer resolved the issue by improving how snapcraft surfaces underlying snapd validation errors during pack, replacing the verbose internal traceback with a cleaner command output. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed in snapcraft 7.x and 8.x. The error originates from snapd, not snapcraft. Output was cleaned to hide internal snapcraft details and display only the relevant snap command error. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Fixed in versions 7.x and 8.x. Improved error handling to suppress internal snapcraft execution details and surface only the underlying snapd validation error when snap pack fails. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
canonical/snapcraft#4424
(confidence 100%)
Merged PR that hid verbose pack-failure details in logs; recorded as ec09cc07b.
-
Related To:
canonical/snapcraft#4434
(confidence 90%)
Follow-up cleanup titled 'hide command in output when pack failed,' merged as 71fa15744.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #5188 fix: improve error message from snapd pack | snapcraft | merged | Merged PR #5188 in commit a9fc44093, improving snapd pack failures by surfacing snapd's error output and fixing snapcraft#4499. | |
| #4499 Failures when running `snap pack` don't get sent to the user. | snapcraft | closed | Fixed by merged PR #5188 (commit a9fc44093), which surfaces snapd's error output when snap pack fails instead of showing only the command and exit status. | |
| #4548 Make `snap pack ...` errors also return the problem instead of just the error code | snapcraft | closed | Closed by mr-cal as a duplicate of #4499 (tracked as CRAFT-2559); that issue was fixed by merged PR #5188 (commit a9fc44093), which surfaces snapd's error output when `snap pack` fails. |