← Back to issue list

Charmcraft login on remote device has unhelpful error message

View original Github issue

Metadata

Project
charmcraft
Number
#901
Type
issue
State
closed
Author
MiaAltieri
Labels
Created
Updated
Closed

Current evaluation

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.

Suggested action:

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
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.
qwen3.6-35b-a3b-mtp-q6 Closed as deferred to upstream. The unhelpful remote login error requires changes in the underlying craft-store library, now tracked at canonical/craft-store#58.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#844 Cannot use charmcraft login charmcraft closed Closed as a support request. The SSH login failure was resolved by directing the user to official documentation for remote authentication. No code changes were required.
79%
#672 charmcraft 1.4.0: impossible to login to charmhub charmcraft closed Closed as expected behavior. Charmcraft falls back to a non-persistent memory ring on headless systems lacking a keyring, preventing credential persistence. Maintainers advised exporting credentials via environment variables instead of implementing a code fix.
75%
#725 craft-store error when using `charmcraft login` command charmcraft closed Closed as superseded by #833. The error triggers when charmhub credentials already exist. Maintainers acknowledged the confusing UX and planned a craft-store fix, but redirected tracking to the dedicated ticket.
73%
#810 Confusing output from `charmcraft login` charmcraft closed Reported confusing charmcraft login error when credentials already exist. Team agreed to improve messaging to prompt users to logout first. Issue closed and superseded by tracking issue #833 to implement the fix.
72%
#668 `charmcraft status` should work without needing to log in charmcraft closed Closed as rejected. Maintainer confirmed all Charmhub operations require authentication, making the requested unauthenticated status check impossible to implement within charmcraft.
71%