← Back to issue list

inaccurate error output in snapcraft release if given invalid revision

View original Launchpad issue

Metadata

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

Current evaluation

Valid CLI parsing bug: an invalid revision makes snapcraft release claim the release command does not exist; current code still uses type=int, and an exact duplicate remains open.

Suggested action: needs triage

Reason: The command snapcraft release juju "" 2.9 provides a clear reproducer on Snapcraft 7.5.5, and manage.py still declares revision with type=int, so the report remains valid. With no labels, comments, assignee, or maintainer response, it needs triage and consolidation with the exact open duplicate #1999038.

Evaluated by: mr-cal-bot

Impact: 35 Quick Win: 18 Complexity: 45 Confidence: 94 Actionability: 92

Issue body

We noticed in one of our release jobs an error stating "No such command 'release'", while `snapcraft release` was certainly working in the previous tasks within the same job: ``` ... 19:13:41 Starting Snapcraft 7.5.5 19:13:41 Logging execution to '/home/jenkins/.local/state/snapcraft/log/snapcraft-20240329-011340.363807.log' 19:13:41 Released 'juju' revision 26908 to channels: '2.9/candidate' 19:13:41 + [[ False == \T\r\u\e ]] 19:13:41 + [[ 2.9 == \2\.\9 ]] 19:13:41 + for arch in $build_arches 19:13:41 ++ snapcraft list-revisions juju 19:13:41 ++ awk '{print $1;exit}' 19:13:41 ++ grep 2.9/candidate/strict-501fcd8 19:13:41 ++ grep ' amd64 ' 19:13:46 Starting Snapcraft 7.5.5 19:13:46 Logging execution to '/home/jenkins/.local/state/snapcraft/log/snapcraft-20240329-011343.737494.log' 19:13:46 + store_revision=26909 19:13:46 ++ cat amd64.store_revision 19:13:46 cat: amd64.store_revision: No such file or directory 19:13:46 + snapcraft release juju 2.9/candidate/strict 19:13:49 Starting Snapcraft 7.5.5 19:13:49 Logging execution to '/home/jenkins/.local/state/snapcraft/log/snapcraft-20240329-011349.286474.log' 19:13:49 Usage: snapcraft [OPTIONS] COMMAND [ARGS]... 19:13:49 Try 'snapcraft -h' for help. 19:13:49 19:13:49 Error: No such command 'release'. ``` We noticed that the origin of this issue is that one of our release scripts is passing an invalid store_revision, and we're fixing that, however, along the way we noticed that if `snapcraft release` is ran with an invalid revision, we get the error messsage "No such command `release`", just wanted to raise this. To recreate, run `snapcraft release juju "" 2.9`

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 35
Quick Win: 18
Complexity: 45
Confidence: 94
Actionability: 92
needs triage Valid CLI parsing bug: an invalid revision makes snapcraft release claim the release command does not exist; current code still uses type=int, and an exact duplicate remains open.
stealth/space-bunny-alpha
Impact: 25
Quick Win: 16
Complexity: 25
Confidence: 92
Actionability: 88
needs triage Invalid or empty revisions still yield the misleading `No such command 'release'`; the parser bug is reproduced and remains open and untriaged.
stealth/space-bunny-alpha
Impact: 25
Quick Win: 16
Complexity: 28
Confidence: 86
Actionability: 88
needs triage Untriaged report: an empty or invalid revision makes `snapcraft release` report `No such command 'release'`. Release remains supported, but no confirming fix was found.
qwen3.6-35b-a3b-mtp-q6
Impact: 45
Quick Win: 34
Staleness: 92
Complexity: 25
Confidence: 30
Support Request: 15
needs triage Bug report: snapcraft release shows misleading 'No such command release' error when given an invalid revision. Untriaged, 888 days old with no maintainer interaction.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 15
Confidence: 90
Support Request: 10
needs triage Reports misleading error output when snapcraft release receives an invalid revision. Untriaged, inactive for over two years, no maintainer response.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 15
Confidence: 70
Support Request: 10
needs triage Reports misleading error output when snapcraft release receives an invalid revision. Unlabeled, no maintainer response, inactive for over two years.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 15
Confidence: 85
Support Request: 10
close stale snapcraft release displays misleading No such command release error when passed an invalid revision. Untriaged, inactive for over two years.

Update history

Date Change
created

Related work

  • Duplicate Of: snapcraft (launchpad)#1999038 (confidence 99%)

    Exact parser bug: an invalid release revision reports "No such command 'release'"; it was reproduced on 7.2.9 and remains open.

  • Related To: snapcraft (launchpad)#1604815 (confidence 90%)

    Concerns non-integer release revisions, but its store-error formatting fix in #1599 does not address this parser misclassification.

  • Related To: snapcraft (launchpad)#1604810 (confidence 85%)

    Also tracks a misleading release error caused by an invalid revision value, though it covers a nonexistent store revision.

Related issues

Issue Project State Summary Similarity
#1999038 "snapcraft release" chokes given an invalid revision value snapcraft (launchpad) open Confirmed parser bug: `snapcraft release mysnap fubar` reports "No such command 'release'" instead of a bad-revision error. Reproduced by mr-cal on 7.2.9, labeled craft-1532, still open with no fix.
82%
#4401 misleading error message on "release" if mandatory arguments are missing snapcraft closed `snapcraft release` now reports missing required arguments or invalid revision types instead of falsely claiming the release command does not exist.
81%
#1604815 The error when trying to release a revision that's not a integer is ugly snapcraft (launchpad) closed Invalid release revisions now produce a formatted user-facing StoreReleaseError; the fix merged in canonical/snapcraft#1599 (c7adb25f7) and shipped in Snapcraft 2.35.
78%
#1604810 try to snapcraft release an unexisting revision shows the wrong error snapcraft (launchpad) open Maintainer-confirmed misleading error when releasing a nonexistent revision; store-specific behavior still needs clarification before implementation.
78%
#1664704 snapcraft release gives misleading error when revision does not exist snapcraft (launchpad) open The legacy snapcraft release error wrongly advised registering an already-registered snap; that obsolete code path was removed in ffb164b7a, and current releases use craft-store.
76%
#1615215 release command misbehaving snapcraft (launchpad) closed Closed as invalid by maintainer sergiusens: 'snapcraft release' only sends snap-name, revision and channel to the store; channel tracking and release maps are store-side, so the reported behaviour was not a snapcraft bug.
73%
#1621713 snapcraft release doesn't match the spec snapcraft (launchpad) closed Snapcraft now correctly handles revision arguments and channel updates; the maintainer confirmed the outdated release behavior is resolved.
70%
#5184 Running snapcraft list-revision is giving error snapcraft closed Reporter confirmed the list-revisions help IndexError occurred only in an old Snapcraft version; no code fix was needed, and current releases use revisions.
70%