snapcraft list-keys returns no keys, but the user has keys

Bug #1720207 reported by Leo Arias
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Snap Store Server

Bug Description

I am here with ogra checking the snapcraft list-keys command:

$ snapcraft list-keys
    Name SHA3-384 fingerprint

It returns nothing for our real users. Mine is <email address hidden>.

When we try to create a key:

$ snapcraft create-key
You have already registered a key named 'default'

It says that we already have a default key. But list-keys is not showing it.

I tried this with a new test user. I ran list-keys and it showed nothing. Then I ran snapcraft create-key and created the default key. Then I ran list-keys, and the key is shown:

$ snapcraft keys
    Name SHA3-384 fingerprint
- default EjOBIMR_SUxu6z141hsAB22FBTzzkOf606psj0PXMyu2eMZrc3Vb-TaP7r6CAmUV (not registered)

So there's something weird going on with my user and with ogra's. I'm reporting this bug, because it sounds like a bug to me. But maybe somebody with more experience in keys can tell us if we are doing something wrong.

Tags: store
Leo Arias (elopio)
tags: added: store
Revision history for this message
Daniel Manrique (roadmr) wrote :

list-keys only lists *local* keys, it does not show the remote keys uploaded to the store (i.e. the one you registered).

You need to have a corresponding local key (private/public keypair) in order do to signing operations, while the store only has the public portion. So even if you could see that "default" is registered in the store, if you don't have the matching private/public pair, you won't be able to do anything with it.

If you don't have the keypair for "default", at this point your only option is to create a new keypair and register it with the store under another name.

This is also related to

I'll mark this as won't fix since this behavior, while weird, is by design.

Changed in snapstore:
status: New → Won't Fix
Revision history for this message
Bret Barker (noise) wrote :

We should allow list-keys to show these "orphaned" keys that are registered in the store but not available locally, otherwise the UX is confusing and we have hit this multiple times with customers.

Changed in snapstore:
status: Won't Fix → Confirmed
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.