← Back to issue list

snap pack returned non-zero exit status 20

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#2075311
Type
issue
State
open
Author
~nteodosio
Labels
—
Created
Updated
Closed
—

Current evaluation

Snapcraft exposed snap pack failures as an opaque exit-status exception; current code reports the underlying snapd error instead, resolving the reported diagnostic problem.

Suggested action: close resolved

Reason: Commit a9fc44093 (canonical/snapcraft#5188) introduced SnapPackError handling that extracts the underlying snapd error from stderr, with unit tests covering normal, multiple, missing, and absent errors. The current snapcraft/pack.py and snapcraft/errors.py contain this behavior, so users no longer receive only the raw exit-status exception reported here.

Evaluated by: mr-cal-bot

Impact: 42 Quick Win: 28 Complexity: 16 Confidence: 96 Actionability: 78

Issue body

Problem ------- See [3][4]. Command '['snap', 'pack', '--filename', 'llvm-chromium_llvmorg-19-init-14561-gecea8371+_amd64.snap', '--compression', 'xz', PosixPath('/build/llvm-chromium/prime'), PosixPath('/build/llvm-chromium')]' returned non-zero exit status 20. or Command '['snap', 'pack', '--filename', 'llvm-chromium_llvmorg-19-init-14561-gecea8371e_amd64.snap', '--compression', 'xz', PosixPath('/build/llvm-chromium/prime'), PosixPath('/build/llvm-chromium')]' returned non-zero exit status 20. Background ---------- I've been trying to do one simple thing, namely programatically setting the version of this snap[0]. But Snapcraft really wants me to surrender. :P Block [1]: Version string is "llvmorg-19-init-14561-gecea8371-3000" but must be <= 32 bytes. Fix 1: Filter it through 'head -c32'. Block [2]: Version string is "llvmorg-19-init-14561-gecea8371-" but must end with an ASCII alphanumeric or one of '+' or '~' (and not '-'). Fix 2: Filter it through 'head -c31' and add a + to it. Block [3]: Command '['snap', 'pack', '--filename', 'llvm-chromium_llvmorg-19-init-14561-gecea8371+_amd64.snap', '--compression', 'xz', PosixPath('/build/llvm-chromium/prime'), PosixPath('/build/llvm-chromium')]' returned non-zero exit status 20. Fix 3: So for some reason I thought this might be the + and substituted it with an e. Block [4]: Command '['snap', 'pack', '--filename', 'llvm-chromium_llvmorg-19-init-14561-gecea8371e_amd64.snap', '--compression', 'xz', PosixPath('/build/llvm-chromium/prime'), PosixPath('/build/llvm-chromium')]' returned non-zero exit status 20. [0] https://launchpad.net/~chromium-team/+snap/llvm-chromium [1] https://launchpadlibrarian.net/741481652/buildlog_snap_ubuntu_noble_amd64_llvm-chromium_BUILDING.txt.gz [2] https://launchpadlibrarian.net/741581930/buildlog_snap_ubuntu_noble_amd64_llvm-chromium_BUILDING.txt.gz [3] https://launchpadlibrarian.net/741697371/buildlog_snap_ubuntu_noble_amd64_llvm-chromium_BUILDING.txt.gz [4] https://launchpadlibrarian.net/741729763/buildlog_snap_ubuntu_noble_amd64_llvm-chromium_BUILDING.txt.gz

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 42
Quick Win: 28
Complexity: 16
Confidence: 96
Actionability: 78
close resolved Snapcraft exposed snap pack failures as an opaque exit-status exception; current code reports the underlying snapd error instead, resolving the reported diagnostic problem.
stealth/space-bunny-alpha
Impact: 45
Quick Win: 28
Complexity: 25
Confidence: 91
Actionability: 82
close resolved Snapcraft now catches snapd pack failures and surfaces snapd error output instead of exposing the raw exit-status exception reported here.
stealth/space-bunny-alpha
Impact: 25
Quick Win: 5
Complexity: 45
Confidence: 85
Actionability: 35
needs triage Snapcraft build fails during snap pack with exit status 20 while setting an LLVM snap version; no maintainer triage or reproduction details are available
qwen3.6-35b-a3b-mtp-q6
Impact: 20
Quick Win: 14
Staleness: 95
Complexity: 30
Confidence: 70
Support Request: 80
close not a bug User reports snap pack returning exit status 20 while trying to programmatically set snap version strings. Issue is 765 days old with no maintainer response or comments.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 40
Confidence: 85
Support Request: 75
needs triage External contributor reports snap pack failing with exit status 20 while programmatically setting a version string. No maintainer response, no labels, inactive for over 660 days.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 20
Confidence: 90
Support Request: 90
close not a bug User reports snap pack failing with exit status 20 while programmatically setting version strings. The post details troubleshooting steps for version constraints. No maintainer response, no labels, inactive for over a year.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 40
Confidence: 85
Support Request: 60
close stale Reports snap pack failing with exit code 20 due to version string constraints during a build. No maintainer interaction or labels in over two years.

Update history

Date Change
created

Related work

  • Likely Fixed By: canonical/snapcraft#5188 (confidence 98%)

    Commit a9fc44093 is titled "fix: improve error message from snapd pack" and added the tested stderr-processing implementation now present in SnapPackError.

Related issues

Issue Project State Summary Similarity
#4870 snapcraft pack error obtuse on snapd errors snapcraft closed Closed as a duplicate of #4548, which was tracked by #4499; hidden snapd pack diagnostics were fixed by merged PR #5188 (a9fc44093).
72%