← Back to issue list

snapcraft create-key displays an ugly error when the keys don't match

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1637623
Type
issue
State
open
Author
~elopio
Labels
store ui
Created
Updated
Closed
—

Current evaluation

snapcraft create-key still surfaces a raw CalledProcessError traceback when the two entered passphrases don't match; code confirms subprocess.check_call at keys.py:162 is unguarded.

Suggested action: keep open

Reason: The defect is still present at HEAD: StoreCreateKeyCommand.run ends with a bare `subprocess.check_call(["snap", "create-key", parsed_args.key_name])` in snapcraft/commands/keys.py:162, with no try/except (unlike _sign_build, which wraps failure into store.errors.SignBuildAssertionError, and unlike SnapPackError which extracts snapd's 'error: ...' stderr line). The report is a maintainer-filed (elopio), labelled store/ui issue with a precise one-step reproducer and exact output, so it remains valid but is only a cosmetic/UX defect on an infrequent path. Fix is well-scoped: catch subprocess.CalledProcessError and raise a SnapcraftError, with a unit test alongside tests/unit/commands/test_keys.py::TestCreateKeyCommand; confidence is slightly tempered because the issue has had no maintainer discussion or discussion in ~10 years, so the desired final wording/whether to also prompt to retry is unspecified.

Evaluated by: mr-cal-bot

Impact: 25 Quick Win: 14 Complexity: 30 Confidence: 84 Actionability: 82

Issue body

To reproduce, run snapcraft create-key and confirm the wrong password. $ snapcraft create-key Passphrase: Confirm passphrase: error: passphrases do not match Command '['snap', 'create-key', 'default']' returned non-zero exit status 1

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 25
Quick Win: 14
Complexity: 30
Confidence: 84
Actionability: 82
keep open snapcraft create-key still surfaces a raw CalledProcessError traceback when the two entered passphrases don't match; code confirms subprocess.check_call at keys.py:162 is unguarded.
qwen/qwen3.6-35b-a3b
Impact: 30
Quick Win: 19
Complexity: 20
Confidence: 85
Actionability: 80
keep open snapcraft create-key shows raw subprocess error when passphrases don't match instead of a clean user-facing message
qwen/qwen3.8-27b
Impact: 10
Quick Win: 8
Staleness: 90
Complexity: 15
Confidence: 60
Support Request: 0
keep open snapcraft create-key leaks a raw subprocess error when passphrases don't match. Labeled store/ui, filed by a maintainer, no comments for ~10 years; a related error-message bug was closed as abandoned.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 15
Confidence: 85
Support Request: 0
close stale CLI command shows raw shell error instead of user-friendly message when passphrases mismatch. Issue remains open with no maintainer comments after nearly 10 years.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 15
Confidence: 90
Support Request: 5
close stale snapcraft create-key shows a raw Python traceback instead of a user-friendly error when passphrases do not match. No maintainer response or activity in nearly ten years.
qwen3.6-35b-a3b-mtp-q6
Staleness: 98
Complexity: 20
Confidence: 90
Support Request: 10
close stale Reports ugly raw command error output when passphrases do not match during snapcraft create-key. Open for nearly a decade with no maintainer interaction or comments.

Update history

Date Change
created

Related work

  • Related To: snapcraft (launchpad)#1979907 (confidence 45%)

    Also targets create-key error-message quality (duplicate-key wording) and was fixed in Snapcraft 7.1.1, but addresses a different failure mode and does not touch the passphrase-mismatch path.

Related issues

Issue Project State Summary Similarity
#1979907 snapcraft create-key incorrect error message snapcraft (launchpad) closed Fixed by canonical/snapcraft#3844 (commit ef3318398), which distinguishes an existing local key from a registered key; released in Snapcraft 7.1.1 on stable.
77%