Snapcraft register-key failing

hi,

snapcraft register-key inforce-key
Enter your Ubuntu One e-mail address and password.
If you do not have an Ubuntu One account, you can create one at https://dashboard.snapcraft.io/openid/login
Email: vinaysimha@inforcecomputing.com
Password:

We strongly recommend enabling multi-factor authentication: https://help.ubuntu.com/community/SSO/FAQs/2FA
Registering key …

You need a passphrase to unlock the secret key for
user: “inforce-key”
4096-bit RSA key, ID 6D95ED33, created 2016-01-01

The Snap Store encountered an error while processing your request: internal server error (code 500).
The operational status of the Snap Store can be checked at https://status.snapcraft.io/

regards,
vinaysimha

@natalia Can you please comment? thanks!

@vinaysimha your account (3PsQUHZm2qTPSDAMCuuZBzUNhzHWcXYf) already has a key named inforce-key registered:

$ curl -s https://api.snapcraft.io/api/v1/snaps/assertions/account-key/THKLWv1d-JdnZv2Gr60kS5hPgC7YEFxNw4yETMZ3IKkNiWVNcCESNQfICSDHIqBP | jq
{
  "headers": {
    "account-id": "3PsQUHZm2qTPSDAMCuuZBzUNhzHWcXYf",
    "authority-id": "canonical",
    "body-length": "717",
    "name": "inforce-key",
    "public-key-sha3-384": "THKLWv1d-JdnZv2Gr60kS5hPgC7YEFxNw4yETMZ3IKkNiWVNcCESNQfICSDHIqBP",
    "sign-key-sha3-384": "BWDEoaqyr25nF5SNCvEv2v7QnM9QsfCc0PBMYD_i2NGSQ32EF2d4D0hqUel3m8ul",
    "since": "2018-02-15T09:59:55Z",
    "type": "account-key"
  },
  "body": "AcbBTQRWhcGAARAAz3IjWYRYq3BG3MqrnkC+EoECzpha7yIlSh3FQFvOpCXolPVPmGwxoBcTsq+I\nGNYIKgMTjIxpnOtY+oPz6FNHXnoX5t6VnQiiutrTMTjiHP/PROQupnkRfNLu+e+TbvScYdPwUepa\nlYKOHe+pmrX3l/QswTYPV9wh3u/qsqTedpZzuSUQ9oi4MzfAO4S18Wlm5hvHdqbfJTiAH/gBGmnY\nxa0XmsxkqHC/CDKXggSPbsW9WFfAMBc3H6ta3kLd4ea9qFJ9mU8Xg3Uo12YRp6CgZiqSvcEgKTL1\nd5tK9vx7EsBWGuL6pu4U55iyAO+FG7U1ekn0hlhoeP4ofJTIQb3KHMFo0X0xQ3cf/U7qq6+EG75n\nc2XW1kvqLCkOex5J8bpn3+QuuLAnKPiR+zC6WVOg3xAFvbmbBoi/1LOgaWRWC8UH/JGiWJWTjqD1\ngS517reGkYCiEp67w287wDjK5kSJ+XKbI+SZi3rp26JE1ve8PwL1ErvMNfPOwMLvowDAwcX5O4q1\nf6zaUUKM5D/VyQBlFTwTykZLNNpN4WbEiM/fIY8WF1yxEinH7oZYEPxh5G5hbDBnTx7w1ewmK52n\n0d1jR9KfWpfJohUrO4NuX9VU26BwGX9jD+TziE/rSHz4KzrYX8sj/N7gYGDiZNAzQCnMAuDsWBgs\nEFZlfFuKRX9wXnMAEQEAAQ=="
}

It was registered on 2018-02-15T09:59:55Z. It looks like you are not using the same ~/snap/gnupg directory, otherwise snapcraft would not try to register it again.

Can you please paste the output of snapcraft list-keys ?

@cprov

i changed my development setup/login(ubuntu 16.04)
.
vinaysimha@inforce-desktop:~$ snapcraft list-keys
Name SHA3-384 fingerprint

  • inforce-key lQ3Gy7A5jv-L6Vo-D2AYyTqhukX7dGRqDaEWgi6YXlrSzs2ilYNth8x3wNSSAx3P (not registered)
  • inf-key FOBq_SyLHjor8l0Ic2SIbO9pVN5JLqRc4Y6xiICSUGcWBivMWP4FiZQmVSRLZ95N (not registered)

i tried even on different machine (ubuntu 18.04) still the issue persists.
vinaysimha@vinaysimha-inf-03-62:~ $ snapcraft list-keys
Name SHA3-384 fingerprint

  • inf-key QxMqBbLaJSm_R5BQA1TjSid8tt1KXWUTAZQ3JtCoUVdpeUKlp17JE6QHmUU1c_lj (not registered)
    vinaysimha@vinaysimha-inf-03-62:~ $ cat /etc/issue
    Ubuntu 18.04.1 LTS \n \l

@vinaysimha, thanks for the information.

As mentioned earlier, the key setup is dependent of the local filesystem where it was initially set up (~/.snap/gnupg). Your private keys never leave your disk, the store is only informed of the corresponding names and public parts.

Since you have probably lost your original private keys (named inforce-key, inf-key and inf2-key) and the store doesn’t yet support key revocation (see the bug1800825), my suggestion to move forward is to create and register new keys with new names (identifiers) and ensure you have (safe) backups of ~/.snap for future recovering.

@cprov
i registered a new key , it worked. Now i had backedup the ~/.snap for future recovery.
thanks

As a developer I use multiple machines, at work, home and abroad. I’d like to work on the same snap project but on different filesystems (machines). The key arrangement seems inconvenient to say the least. I must be missing something.

Thoughts?

How do you manage your SSH keys across those multiple machines? Use that as a starting point for managing your snap keys.