Charmcraft login on remote device has unhelpful error message
Metadata
Current evaluation
Superseded by canonical/craft-store#58 and fixed there through PR #390 (d87f1bd), which converts keyring initialization failures into KeyringUnlockError.
Resolution: closed superseded
Reason: The maintainer explicitly moved responsibility for the unhelpful error to craft-store#58 because Charmcraft exposed the underlying library failure. That linked issue was resolved by craft-store PR #390, commit d87f1bd, which added clearer keyring error translation.
Evaluated by: mr-cal-bot
No scores available.
Issue body
## Problem
When attempting to login to charmcraft on a remote machine, it is necessary to provide auth (since you cannot login via the web gui). However many users don't know this and will receive the following error message:
```
ubuntu@mongo-dev:~/mongodb-operator$ charmcraft login
charmcraft internal error: InitError('Failed to create the collection: Prompt dismissed..')
Full execution log: '/home/ubuntu/snap/charmcraft/common/cache/charmcraft/log/charmcraft-20221010-142838.674769.log'
ubuntu@mongo-dev:~/mongodb-operator$ sudo cat /home/ubuntu/snap/charmcraft/common/cache/charmcraft/log/charmcraft-20221010-142838.674769.log
2022-10-10 14:28:38.676 Starting charmcraft version 2.0.0
2022-10-10 14:28:38.680 System details: OSPlatform(system='ubuntu', release='20.04', machine='x86_64'); Environment: None
2022-10-10 14:28:38.881 charmcraft internal error: InitError('Failed to create the collection: Prompt dismissed..')
2022-10-10 14:28:38.884 Traceback (most recent call last):
2022-10-10 14:28:38.884 File "/snap/charmcraft/1033/lib/secretstorage/util.py", line 48, in send_and_get_reply
2022-10-10 14:28:38.884 raise DBusErrorResponse(resp_msg)
2022-10-10 14:28:38.884 jeepney.wrappers.DBusErrorResponse: [org.freedesktop.DBus.Error.UnknownMethod] ('No such interface “org.freedesktop.DBus.Properties” on object at path /org/freedesktop/secrets/collection/login',)
2022-10-10 14:28:38.884
2022-10-10 14:28:38.884 The above exception was the direct cause of the following exception:
2022-10-10 14:28:38.884 Traceback (most recent call last):
2022-10-10 14:28:38.884 File "/snap/charmcraft/1033/lib/secretstorage/collection.py", line 161, in get_default_collection
2022-10-10 14:28:38.884 return Collection(connection)
2022-10-10 14:28:38.884 File "/snap/charmcraft/1033/lib/secretstorage/collection.py", line 44, in __init__
2022-10-10 14:28:38.884 self._collection.get_property('Label')
2022-10-10 14:28:38.884 File "/snap/charmcraft/1033/lib/secretstorage/util.py", line 67, in get_property
2022-10-10 14:28:38.884 (signature, value), = self.send_and_get_reply(msg)
2022-10-10 14:28:38.884 File "/snap/charmcraft/1033/lib/secretstorage/util.py", line 52, in send_and_get_reply
2022-10-10 14:28:38.884 raise ItemNotFoundException('Item does not exist!') from resp
2022-10-10 14:28:38.884 secretstorage.exceptions.ItemNotFoundException: Item does not exist!
2022-10-10 14:28:38.884
2022-10-10 14:28:38.884 During handling of the above exception, another exception occurred:
2022-10-10 14:28:38.884 Traceback (most recent call last):
2022-10-10 14:28:38.884 File "/snap/charmcraft/1033/lib/keyring/backends/SecretService.py", line 61, in get_preferred_collection
2022-10-10 14:28:38.884 collection = secretstorage.get_default_collection(bus)
2022-10-10 14:28:38.884 File "/snap/charmcraft/1033/lib/secretstorage/collection.py", line 163, in get_default_collection
2022-10-10 14:28:38.884 return create_collection(connection, 'Default',
2022-10-10 14:28:38.884 File "/snap/charmcraft/1033/lib/secretstorage/collection.py", line 145, in create_collection
2022-10-10 14:28:38.884 raise PromptDismissedException('Prompt dismissed.')
2022-10-10 14:28:38.884 secretstorage.exceptions.PromptDismissedException: Prompt dismissed.
2022-10-10 14:28:38.884
2022-10-10 14:28:38.884 During handling of the above exception, another exception occurred:
2022-10-10 14:28:38.884 Traceback (most recent call last):
2022-10-10 14:28:38.884 File "/snap/charmcraft/1033/lib/charmcraft/main.py", line 180, in main
2022-10-10 14:28:38.884 retcode = dispatcher.run()
2022-10-10 14:28:38.884 File "/snap/charmcraft/1033/lib/craft_cli/dispatcher.py", line 419, in run
2022-10-10 14:28:38.884 return self._loaded_command.run(self._parsed_command_args)
2022-10-10 14:28:38.884 File "/snap/charmcraft/1033/lib/charmcraft/commands/store/__init__.py", line 199, in run
2022-10-10 14:28:38.884 credentials = store.login(**kwargs)
2022-10-10 14:28:38.884 File "/snap/charmcraft/1033/lib/charmcraft/commands/store/store.py", line 210, in login
2022-10-10 14:28:38.884 return self._client.login(**kwargs)
2022-10-10 14:28:38.884 File "/snap/charmcraft/1033/lib/charmcraft/commands/store/client.py", line 74, in login
2022-10-10 14:28:38.884 return super().login(*args, **kwargs)
2022-10-10 14:28:38.884 File "/snap/charmcraft/1033/lib/craft_store/base_client.py", line 130, in login
2022-10-10 14:28:38.884 self._auth.ensure_no_credentials()
2022-10-10 14:28:38.884 File "/snap/charmcraft/1033/lib/craft_store/auth.py", line 131, in ensure_no_credentials
2022-10-10 14:28:38.884 if self._keyring.get_password(self.application_name, self.host) is not None:
2022-10-10 14:28:38.884 File "/snap/charmcraft/1033/lib/keyring/backends/SecretService.py", line 78, in get_password
2022-10-10 14:28:38.884 collection = self.get_preferred_collection()
2022-10-10 14:28:38.884 File "/snap/charmcraft/1033/lib/keyring/backends/SecretService.py", line 63, in get_preferred_collection
2022-10-10 14:28:38.884 raise InitError("Failed to create the collection: %s." % e)
2022-10-10 14:28:38.884 keyring.errors.InitError: Failed to create the collection: Prompt dismissed..
2022-10-10 14:28:38.884 Full execution log: '/home/ubuntu/snap/charmcraft/common/cache/charmcraft/log/charmcraft-20221010-142838.674769.log'
```
This error message is un-intuitive and it isn't obvious what needs to be fixed
## Suggestion
Perhaps in the code it would be possible to handle the associated error with not being able to pull up a browser and output something to the user like:
```
Charmcraft login failed!
It looks like you are on a remote machine, using charmcraft remotely requires a CHARMCRAFT_AUTH environment variable. See here for more info: https://juju.is/docs/sdk/remote-env-auth
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed superseded | Superseded by canonical/craft-store#58 and fixed there through PR #390 (d87f1bd), which converts keyring initialization failures into KeyringUnlockError. | |
| stealth/space-bunny-alpha | — | closed superseded | Remote-login error reporting was moved to craft-store#58, then superseded by internal CRAFT-5223/CRAFT-5224; no Charmcraft fix was merged in #901. | |
| stealth/space-bunny-alpha | — | closed superseded | Transferred upstream to canonical/craft-store#58; it was closed there as superseded by internal CRAFT-5223/CRAFT-5224, with no Charmcraft fix recorded. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed. The unhelpful remote login error is tracked upstream in craft-store issue #58, as the fix requires changes to the underlying authentication library rather than Charmcraft itself. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed as upstream. Maintainers confirmed the unhelpful error message requires improvement but noted it originates in the underlying craft-store library. Tracking continues at canonical/craft-store#58. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed. The unhelpful remote login error originates in the upstream craft-store library. Charmcraft will not implement a fix; resolution is deferred to canonical/craft-store#58. |
Update history
No update history recorded yet.
Related work
-
Superseded By:
canonical/craft-store#58
(confidence 99%)
The Charmcraft maintainer linked this issue as the upstream tracking item.
-
Likely Fixed By:
canonical/craft-store#390
(confidence 98%)
PR #390, commit d87f1bd, translated keyring initialization failures into KeyringUnlockError.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #672 charmcraft 1.4.0: impossible to login to charmhub | charmcraft | closed | Closed as intended behavior: the headless remote host had no local keyring, so Charmcraft could not persist credentials; exporting credentials was the supported workaround. | |
| #719 [1.5.0] Charmcraft login not finding keyring | charmcraft | closed | Closed as a headless keyring/session configuration issue; running Charmcraft in dbus-run-session with gnome-keyring unlocked made login succeed. No code fix was recorded. | |
| #725 craft-store error when using `charmcraft login` command | charmcraft | closed | Confusing craft-store "Credentials found" error on `charmcraft login` (double login). Closed by facundobatista as tracked in the more specific #833, whose improved error landed via PR #916. | |
| #58 Keyring failures give bad error messages | craft-store | closed | Keyring failures now raise craft-store's KeyringUnlockError with clearer messaging, fixed by PR #390 (commit d87f1bd). | |
| #844 Cannot use charmcraft login | charmcraft | closed | Login failed over SSH ('Prompt dismissed'). Maintainer closed it pointing to Charmhub discourse instructions for authenticating in remote environments; no code change. | |
| #843 Better User facing message when credentials not found | charmcraft | closed | Closed by facundobatista as out of scope for charmcraft: the "Prompt dismissed" InitError comes from a keyring crash in Craft Store, not missing credentials. Tracked upstream in canonical/craft-store#58. | |
| #759 charmcraft login produces an error | charmcraft | closed | Closed as superseded by #833, which improved the double-login error and recommended `charmcraft logout`; the follow-up was resolved by merged PR #916. |