← Back to issue list

snapcraft create-key incorrect error message

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1979907
Type
issue
State
closed
Author
~picchietti
Labels
craft-1161
Created
Updated
Closed

Current evaluation

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.

Resolution: closed resolved

Reason: PR #3844 added a distinct KeyAlreadyExistsError and updated create-key handling. A maintainer confirmed that Snapcraft 7.1.1 on stable fixes the issue.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Description: "snapcraft create-key" will error with a message that says a key has been registered when it has not been. To reproduce: ```bash # verify key "test1" has not been created yet snapcraft keys # create key that has not been registered with "snapcraft register" snapcraft create-key test1 # See that key "test1" has "(not registered)" to the right of its fingerprint snapcraft keys # Receive incorrect error message snapcraft create-key test1 ``` Note: I'm not aware of any way to delete a key, so you will probably have "test1" in your keys forever. Sorry! Suggested fix: Change wording to say "You have already created a key named 'key_name'"

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved 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.
stealth/space-bunny-alpha — closed resolved Corrected the duplicate-key error so it no longer implies Store registration; the fix shipped in Snapcraft 7.1.1.
stealth/space-bunny-alpha — closed stale The incorrect create-key error wording was never fixed; Launchpad bug #1979907 was closed without a resolution or implementing the proposed change.
qwen/qwen3.6-35b-a3b — — Reported an incorrect error message for snapcraft create-key. The report was closed without a fix or resolution. No pull requests were merged, and the suggested wording change was not implemented.
qwen/qwen3.6-35b-a3b — — Abandoned. The incorrect error message in snapcraft create-key for locally created keys was not fixed. The suggested wording update was never implemented.
qwen/qwen3.6-35b-a3b — — Closed. The misleading error message for snapcraft create-key was corrected to clarify that a key was already created rather than registered.
qwen3.6-35b-a3b-mtp-q6 — — The snapcraft create-key error message report was closed without a fix. Zero comments and no linked pull requests indicate the report was abandoned or closed as stale.

Update history

Date Change
created

Related work

  • Likely Fixed By: canonical/snapcraft#3844 (confidence 99%)

    Commit ef3318398 added separate errors for keys that already exist versus keys already registered.

Related issues

Issue Project State Summary Similarity
#1637623 snapcraft create-key displays an ugly error when the keys don't match snapcraft (launchpad) 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.
77%
#1629942 Implement `snapcraft create-key` snapcraft (launchpad) closed Implemented `snapcraft create-key` wrapping `snap create-key`, with early errors for existing local/store keys. Merged as snapcore/snapcraft PR #824 (commit 01d512e65); maintainer closed the Launchpad bug pointing at that PR.
73%
#824 Add `snapcraft create-key` snapcraft merged Merged #824 in commit 01d512e65, adding `snapcraft create-key` to wrap `snap create-key` and reject names already registered with the store.
72%