Craft-store error: Credentials found for 'snapcraft' on 'dashboard.snapcraft.io'

I’m about to release NetBeans 17-rc1 to our edge channel, when realized that the login --with is not supported any more. I’ve crated a Snapcraft 7.x style credentials (the base64 encoded one), uploaded that to our Apache Jenkins credential store, updated our build steps, but can’t get the login working with the error above. The base64 credential is now passed as a build environment variable ``` SNAPCRAFT_STORE_CREDENTIALS


The logs are available at: https://ci-builds.apache.org/job/Netbeans/job/netbeans-snap-release/57/console

Unfortunately those do not tell too much.

Well, I’ve checked the code of the craft-store. I might read the python code wrong, but it seem it misinterprets the absence of keystores so say that it already found the credentials stored.

If your flow first does a snapcraft login (which used to persist the login info somewhere) and then tries to do other operations like push, release and so on, you will likely need to change it.

With snapcraft 7.x you either log in or set the variable, but not both. If you are setting the variable, all commands use that information and don’t require the explicit login before.

Export the variable before running any other snapcraft commands and with the variable set, they should all behave as if they were logged in.

Well, after several tests. It seems even if I supply the SNAPCRAFT_STORE_CREDENTIALS environment vatiable, Snapcraft still tests the available keychains. If there is no suitable keychain available. it simply exits instead of going with the provided environment variable.

I thik if the environment variable is provided Snapcraft shall not do anything with the keychanis.

Well, after several tests. It seems even if I supply the SNAPCRAFT_STORE_CREDENTIALS environment vatiable, Snapcraft still tests the available keychains. If there is no suitable keychain available. it simply exits instead of going with the provided environment variable.

I thik if the environment variable is provided Snapcraft shall not do anything with the keychanis.

I have started receiving this error within the last day. I initially noticed that my “update edge” cronjob was failing (which used exported credentials via environment variable). Historically, that has meant I need to refresh them, but I cannot snapcraft login using my Ubuntu One account either. Browser logins work fine.

This is with Snapcraft version 7.4.3.

Found a solution to my own problem. I had to snapcraft logout before doing snapcraft login. UX could definitely be better here.

Checked with Snapcraft 8.0. This is still an issue.

The build is actually running on a headless probably container somewhere in Apache build infrastructure, so login/logout is not a real option.