Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.5] No keyring error with --export #730

Closed
heitorPB opened this issue Mar 25, 2022 · 5 comments · Fixed by #760
Closed

[1.5] No keyring error with --export #730

heitorPB opened this issue Mar 25, 2022 · 5 comments · Fixed by #760

Comments

@heitorPB
Copy link
Contributor

Hello,

I am trying to export a limited auth token to use with Github actions, but I had no success so far:

$ CHARMCRAFT_AUTH="" charmcraft login --export=gh.auth --charm slurmd --charm slurmdbd --charm slurmctld --charm slurmrestd --permission package-manage
No keyring found to store or retrieve credentials from.
Full execution log: '/home/h/snap/charmcraft/common/cache/charmcraft/log/charmcraft-20220325-145605.991757.log'

$ cat /home/h/snap/charmcraft/common/cache/charmcraft/log/charmcraft-20220325-145605.991757.log
2022-03-25 14:56:05.992 Starting charmcraft version 1.5.0
2022-03-25 14:56:05.992 Raw pre-parsed sysargs: args={'help': False, 'verbose': False, 'quiet': False, 'trace': False, 'project_dir': None} filtered=['login', '--export=gh.auth', '--charm', 'slurmd', '--charm', 'slurmdbd', '--charm', 'slurmctld', '--charm', 'slurmrestd', '--permission', 'package-manage']
2022-03-25 14:56:05.992 General parsed sysargs: command='login' args=['--export=gh.auth', '--charm', 'slurmd', '--charm', 'slurmdbd', '--charm', 'slurmctld', '--charm', 'slurmrestd', '--permission', 'package-manage']
2022-03-25 14:56:05.992 Couldn't find config file '/home/h/projects/slurm-charms/.github/workflows/charmcraft.yaml'
2022-03-25 14:56:05.993 Command parsed sysargs: Namespace(bundle=None, channel=None, charm=['slurmd', 'slurmdbd', 'slurmctld', 'slurmrestd'], export=PosixPath('gh.auth'), permission=['package-manage'], ttl=None)
2022-03-25 14:56:05.993 System details: OSPlatform(system='ubuntu', release='20.04', machine='x86_64'); Environment: None
2022-03-25 14:56:06.069 No keyring found to store or retrieve credentials from.
2022-03-25 14:56:06.071 Traceback (most recent call last):
2022-03-25 14:56:06.071   File "/snap/charmcraft/834/lib/charmcraft/commands/store/store.py", line 179, in __init__
2022-03-25 14:56:06.071     self._client = Client(charmhub_config.api_url, charmhub_config.storage_url)
2022-03-25 14:56:06.071   File "/snap/charmcraft/834/lib/charmcraft/commands/store/client.py", line 57, in __init__
2022-03-25 14:56:06.071     super().__init__(
2022-03-25 14:56:06.071   File "/snap/charmcraft/834/lib/craft_store/store_client.py", line 84, in __init__
2022-03-25 14:56:06.071     super().__init__(
2022-03-25 14:56:06.071   File "/snap/charmcraft/834/lib/craft_store/base_client.py", line 65, in __init__
2022-03-25 14:56:06.071     self._auth = Auth(
2022-03-25 14:56:06.071   File "/snap/charmcraft/834/lib/craft_store/auth.py", line 103, in __init__
2022-03-25 14:56:06.071     raise errors.NoKeyringError()
2022-03-25 14:56:06.071 craft_store.errors.NoKeyringError: No keyring found to store or retrieve credentials from.
2022-03-25 14:56:06.071 Full execution log: '/home/h/snap/charmcraft/common/cache/charmcraft/log/charmcraft-20220325-145605.991757.log'

I am using Ubuntu LTS server 20.04, headless. Charmcraft from latest/candidate (version 1.5.0, rev 834).

I thougth the --export flag would cause Charmcraft to not use a keyring?

@sergiusens
Copy link
Collaborator

This is indeed not the case today, I will discuss with @facundobatista

@heitorPB
Copy link
Contributor Author

This is similar to #719, but not exactly a duplicate?

@facundobatista
Copy link
Contributor

@sergiusens it looks like Craft Store is always expecting a keyring to be available when not having a CHARMCRAFT_AUTH set (and of course will not allow to use the login command when having that environment variable).

@sergiusens
Copy link
Collaborator

@facundobatista correct, this is what you asked for, you wanted login to always login and potentially show the credentials.
I brought it up, we need a new key to say that we don't want to record this, either by not passing in the environment variable on init or the ephemeral argument I proposed.

@facundobatista
Copy link
Contributor

Fixed by #760.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants