← Back to issue list

snapcraft list-keys doesn't show the non-registered key when no key is registered

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1858994
Type
issue
State
open
Author
~ethan.hsieh
Labels
—
Created
Updated
Closed
—

Current evaluation

list-keys hid local unregistered keys when no key was registered (snapcraft 3.8). Fixed by 1c44a58fc; today's 'keys' command lists local keys and marks unregistered ones, and list-keys was removed in Snapcraft 9.

Suggested action: close resolved

Reason: Commit 1c44a58fc ("store: add missing case for list-keys (#4245)") added exactly the missing case, and the current implementation in snapcraft/commands/keys.py builds its table from _get_usable_keys() (local keys via `snap keys --json`), marking any key absent from enabled_keys with "-" and "(not registered)" — enabled_keys only affects that marker column and a separate "registered but not available on this system" list, so the reporter's scenario now yields the expected table. The 'No keys have been registered...' string the reporter saw came from the earlier PR 5c76509ff (#1784), which only added the hint message and not the fix; unit test test_keys asserts the "- test-key-2 deadbeef (not registered)" row. Additionally, list-keys was renamed to keys and is now a RemovedCommand stub (snapcraft/commands/keys.py:113, docs/release-notes/snapcraft-9-0.rst), so the exact command reported no longer exists.

Evaluated by: mr-cal-bot

Impact: 32 Quick Win: 21 Complexity: 22 Confidence: 88 Actionability: 85

Issue body

Here are the reproduction steps: $ snapcraft create-key test We're supposed to get following result $ snapcraft list-keys     Name SHA3-384 fingerprint - test <fingerprint> (not registered) But, list-keys returns no keys $ snapcraft list-keys No keys have been registered. See 'snapcraft register-key --help' to register a key. Need to register the first key. $ snapcraft register-key test $ snapcraft list-keys     Name SHA3-384 fingerprint * test <fingerprint> After the first key is registered, list-keys can show the non-registered key. $ snapcraft create-key serial $ snapcraft list-keys     Name SHA3-384 fingerprint * test <fingerprint> - serial <fingerprint> (not registered) --- $ snap list Name Version Rev Tracking Publisher Notes snapcraft 3.8 3440 stable canonical* classic

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 32
Quick Win: 21
Complexity: 22
Confidence: 88
Actionability: 85
close resolved list-keys hid local unregistered keys when no key was registered (snapcraft 3.8). Fixed by 1c44a58fc; today's 'keys' command lists local keys and marks unregistered ones, and list-keys was removed in Snapcraft 9.
stealth/space-bunny-alpha
Impact: 30
Quick Win: 19
Complexity: 25
Confidence: 93
Actionability: 85
close resolved The original list-keys bug is fixed: current Snapcraft lists local unregistered keys with their fingerprints, while the old command was renamed to keys and removed in Snapcraft 9.
qwen/qwen3.8-27b
Impact: 15
Quick Win: 12
Staleness: 95
Complexity: 20
Confidence: 70
Support Request: 10
close stale list-keys (snapcraft 3.8) fails to show a locally created key when no key is registered yet, printing 'No keys have been registered' instead. Unlabelled, zero comments, no activity for ~6.6 years; the command was later removed and replaced by snapcraft keys.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 25
Confidence: 90
Support Request: 5
close stale snapcraft list-keys fails to display unregistered keys until a key is registered. Reported for v3.8 with no maintainer response in over 6 years.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 20
Confidence: 80
Support Request: 5
close stale Bug where snapcraft list-keys fails to display newly created keys until at least one key is registered. Issue is over six years old with no maintainer interaction.
qwen3.6-35b-a3b-mtp-q6
Staleness: 98
Complexity: 20
Confidence: 75
Support Request: 5
close stale Bug where snapcraft list-keys fails to display locally created but unregistered keys until a key is registered. Untriaged, inactive for over 6 years.

Update history

Date Change
created

Related work

  • Related To: snapcraft#1784 (confidence 90%)

    Merged PR (commit 5c76509ff) added the 'No keys have been registered. See register-key --help' message the reporter quotes, but not the underlying fix — hence the misleading output in 3.8.

  • Likely Fixed By: snapcraft#4245 (confidence 88%)

    Commit 1c44a58fc 'store: add missing case for list-keys (#4245)' is the direct match for this bug; corroborated by the current keys command listing local keys with the '(not registered)' marker regardless of registered keys.

  • Duplicate Of: snapcraft (launchpad)#1720207 (confidence 72%)

    Launchpad #1720207 'snapcraft list-keys returns no keys, but the user has keys' is the same root cause (keys only enumerated from registered account keys) and is likewise recorded as resolved.

  • Related To: snapcraft (launchpad)#1996618 (confidence 55%)

    Same command area; concerns snapd/External Key Manager keys not being listed, and notes keys now surfaces remote-only registered fingerprints separately from local keys.

Related issues

Issue Project State Summary Similarity
#1720207 snapcraft list-keys returns no keys, but the user has keys snapcraft (launchpad) open Observed behavior is resolved: keys now displays registered remote-only key fingerprints separately from local keys; legacy list-keys was renamed and removed in Snapcraft 9.
88%
#1996618 Snapcraft does not list keys reported from snapd via External Key Manager snapcraft (launchpad) open Legacy `snapcraft list-keys` hid keys returned by snapd/External Key Manager when the account had no registered keys; superseded by the craft-app `keys` command and Snapcraft 9 removal of list-keys.
80%
#1736864 snapcraft list-keys with no snap keys returns an empty table snapcraft (launchpad) closed Fixed via merged canonical/snapcraft#1784 (commit 5c76509ff): list-keys now shows registration guidance instead of an empty table when no keys exist.
80%
#1720210 snapcraft list-keys with no keys returns an empty table snapcraft (launchpad) closed Empty-key output was fixed by PR #4245 (commit 1c44a58fc): keys now reports that no keys are registered and points users to register-key help.
79%
#1622037 snapcraft list-keys prints no message when there are no keys snapcraft (launchpad) closed Fixed in #1784 (commit 5c76509ff); snapcraft list-keys now prints a helpful message when no keys are present instead of an empty table.
79%
#1784 cli: show helpful message for 'snapcraft list-keys' with no keys snapcraft merged Merged PR #1784 (commit 5c76509ff): snapcraft list-keys now directs users to register-key --help when no keys exist instead of printing an empty table.
77%