Snapcraft login fails

I am a newbie here, just setup the account, followed the steps from forum topic 30473.

I exported creds, snapcraft whoami works as expected. Not sure if I need to do both but I did try the following as well:

" Using a keyring on a headless Linux system" steps:

It just hangs here: gnome-keyring-daemon --unlock

Nothing gets displayed – no errors or anything.

I CntrlC-ed it and then tried snapcraft login and here is the complete log I am seeing:

2022-06-19 13:50:49.505 Starting Snapcraft 7.0.7 2022-06-19 13:50:49.505 Raw pre-parsed sysargs: args={‘help’: False, ‘verbose’: False, ‘quiet’: False, ‘trace’: False, ‘version’: False} filtered=[‘login’] 2022-06-19 13:50:49.505 General parsed sysargs: command=‘login’ args=[] 2022-06-19 13:50:49.506 Command parsed sysargs: Namespace(experimental_login=False, login_with=None) 2022-06-19 13:50:49.506 Storing credentials for ‘snapcraft’ on dashboard.snapcraft.io in keyring ‘auth MemoryKeyring’. 2022-06-19 13:50:49.506 Enter your Ubuntu One e-mail address and password. 2022-06-19 13:50:49.507 If you do not have an Ubuntu One account, you can create one at https://snapcraft.io/account 2022-06-19 13:50:49.507 Emitter: Pausing control of the terminal 2022-06-19 13:50:55.887 Emitter: Resuming control of the terminal 2022-06-19 13:50:55.888 Emitter: Pausing control of the terminal 2022-06-19 13:51:05.766 Emitter: Resuming control of the terminal 2022-06-19 13:51:05.766 craft-store error: Credentials found for ‘snapcraft’ on dashboard.snapcraft.io.

BTW, I am running this from ubuntu 18.04.

Would appreciate your help, thanks much.

When you run gnome-keyring-daemon --unlocktype in the passphrase (to create one most likely) and then press ctrl+d

I am not sure I understand. This passphrase is for what? I did type in my passphrase and CntrlD, it came out, with no errors. Even I don’t type a passphrase and press CntrlD it comes out with no errors. So, what is happening? I assumed this was fine, and went ahead with creating a key. Key was created and then when I am trying to register the key: lab@lab-Latitude-E7270:~/ubuntu-core$ snapcraft register-key st1-xu5-key Storing credentials for ‘snapcraft’ on ‘dashboard.snapcraft.io’ in keyring ‘auth MemoryKeyring’. Enter your Ubuntu One e-mail address and password. If you do not have an Ubuntu One account, you can create one at https://snapcraft.io/account Email: xxx@yyy.com [my real email id was here] Password: craft-store error: Credentials found for ‘snapcraft’ on ‘dashboard.snapcraft.io’. Full execution log: ‘/home/lab/.cache/snapcraft/log/snapcraft-20220620-101953.925928.log’

What does that mean ? What is the error? How do I fix it?

Thanks much.

Hey man, I have the same problem right now, cannot get the login to work on Multipass (headless ubuntu 22.04). Would really appreciate some help with this as I am not sure what I am doing wrong, I feel like I followed the instructions to the letter.

Did something change with 22.04?

“craft-store error: Credentials found for ‘snapcraft’ on ‘dashboard.snapcraft.io’” – someone with the expertise, please tell me why this is an error? And how we can avoid that?

Why unlock is trying to store the creds? Why register-key trying to store the creds? My login already works after doing ‘export-login’, then why is it trying to store creds everytime I run a command and errors out saying "Credentials found…’

Please help.

From the error, looks like it was not supposed to be found on dashboard.snapcraft.io, then what? Should I delete it somehow? The error is confusing to say the least unless I am missing something really basic. Thanks much.

Thanks for the hint on register-key, that is actually a different code path (it’s an ephemeral login with a short time to live), let me try and reproduce.

This should be fixed in 7.0.8 now on latest/candidate and 7.x/candidate

I have 7.0.7, it seems there is no command to update that to 7.0.8? Could you please let me know how I can update it? Thanks much.

lab@lab-Latitude-E7270:~/ubuntu-core$ sudo snap install snapcraft --candidate --classic

snap “snapcraft” is already installed, see ‘snap help refresh’

lab@lab-Latitude-E7270:~/ubuntu-core$ snapcraft -V

snapcraft 7.0.7

I was able to remove and install the latest version, now I am hitting a different problem:

lab@lab-Latitude-E7270:~/ubuntu-core$ snapcraft register-key st1-xu5-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://snapcraft.io/account

Email: myemail@mydomain.com Password: Store operation failed:

  • invalid-credentials: Provided email/password is not correct.

I am pretty sure, I am typing correct credentials.

I also tried:

lab@lab-Latitude-E7270:~/ubuntu-core$ snapcraft export-login creds.login

Enter your Ubuntu One e-mail address and password. If you do not have an Ubuntu One account, you can create one at https://snapcraft.io/account Email: xxx@yyy.com [my actual email id] Password:

craft-store error: Store operation failed:

  • invalid-credentials: Provided email/password is not correct.

Full execution log: ‘/home/lab/.cache/snapcraft/log/snapcraft-20220624-093901.428047.log’

Before the upgrade, I was able to run the export-login command successfully. Now I can’t.

I faced this error recently and was able to solve it by first clearing my snapcraft credentials

snapcraft logout

and then re-logging into snapcraft using

snapcraft login
1 Like

Hello, I am trying to log in to snapcraft just so that I can export credentials for automation purposes. But I’ve been stuck trying to get a successful snapcraft login execution. I am using a multipass VM (similar to @kihaki) and I’ve followed the documentation for headless authentication on Linux. However, gnome-keyring-daemon --unlock hangs for me as well. I’ve not had much luck trying to get it to work. I even tried to relaunch gnome-keyring-daemon with the -r flag that is meant to replace any existing daemons and that resulted in a hint: couldn't connect to dbus session bus: Cannot autolaunch D-Bus without X11 $DISPLAY which led me to a post on SO. Exporting the variable as suggested in that post helped in getting rid of that specific error but still gnome-keyring-daemon --unlock still hangs.

Note that all of the commands I am running are inside a dbus session that I start by first by running dbus-run-session -- sh just like the Snapcraft auth doc states.

Is there anything else I could do to make snapcraft login to work on a multipass VM? Is there any other way I could generate exported credentials for automation purposes?

I realized that snapcraft is available for macOS too. Fortunately, I have access to a Mac so I went that route and was able to get exported credentials. To be honest, it seems silly to have to install the CLI just so I can export credentials from it for use in automation. I hope that this workflow is made easier in the future.