canonical / charmcraft

Collaborate, build and publish charmed operators for Kubernetes, Linux and Windows.
Apache License 2.0
64 stars 66 forks source link

Getting an internal error for fetch-libs #1717

Open jdkandersson opened 3 days ago

jdkandersson commented 3 days ago

Bug Description

I'm getting an internal error when running the fetch-libs command:

charmcraft fetch-libs
charmcraft internal error: NoKeyringError('No keyring found to store or retrieve credentials from.')

To Reproduce

Environment

Ubuntu 22.04 charmcraft --version: charmcraft 3.0.0.post59+g775a0fc

charmcraft.yaml

# This file configures Charmcraft.
# See https://juju.is/docs/sdk/charmcraft-config for guidance.

name: flask-hello-world

type: charm

bases:
  - build-on:
    - name: ubuntu
      channel: "22.04"
    run-on:
    - name: ubuntu
      channel: "22.04"

# (Required)
summary: A very short one-line summary of the Flask application.

# (Required)
description: |
  A comprehensive overview of your Flask application.

extensions:
  - flask-framework

# Uncomment the integrations used by your application
# Integrations set to "optional: false" will block the charm
# until the applications are integrated.
# requires:
#   mysql:
#     interface: mysql_client
#     optional: false
#     limit: 1
#   postgresql:
#     interface: postgresql_client
#     optional: false
#     limit: 1
#   mongodb:
#     interface: mongodb_client
#     optional: false
#     limit: 1
#   redis:
#     interface: redis
#     optional: false
#     limit: 1
#   s3:
#     interface: s3
#     optional: false
#     limit: 1
#   saml:
#     interface: saml
#     optional: false
#     limit: 1

Relevant log output

2024-07-04 16:41:26.914 Starting charmcraft, version 3.0.0.post59+g775a0fc
2024-07-04 16:41:26.914 Log verbosity level set to BRIEF
2024-07-04 16:41:26.914 Configuring application...
2024-07-04 16:41:26.914 Preparing application...
2024-07-04 16:41:26.914 Build plan: platform=None, build_for=None
2024-07-04 16:41:26.915 Loading project file '/home/ubuntu/flask-hello-world/charm/charmcraft.yaml'
2024-07-04 16:41:26.917 Processing grammar (on amd64 for amd64)
2024-07-04 16:41:26.917 Processing grammar for plugin: charm
2024-07-04 16:41:26.917 Processing grammar for source: .
2024-07-04 16:41:26.918 Running charmcraft fetch-libs on host
2024-07-04 16:41:26.922 Setting up StoreService
2024-07-04 16:41:26.969 charmcraft internal error: NoKeyringError('No keyring found to store or retrieve credentials from.')
2024-07-04 16:41:26.982 Traceback (most recent call last):
2024-07-04 16:41:26.982   File "/snap/charmcraft/4025/lib/python3.10/site-packages/craft_application/application.py", line 517, in run
2024-07-04 16:41:26.982     return_code = dispatcher.run() or 0
2024-07-04 16:41:26.982   File "/snap/charmcraft/4025/lib/python3.10/site-packages/craft_cli/dispatcher.py", line 487, in run
2024-07-04 16:41:26.982     return self._loaded_command.run(self._parsed_command_args)
2024-07-04 16:41:26.982   File "/snap/charmcraft/4025/lib/python3.10/site-packages/charmcraft/application/commands/store.py", line 1672, in run
2024-07-04 16:41:26.982     store = self._services.store
2024-07-04 16:41:26.982   File "/snap/charmcraft/4025/lib/python3.10/site-packages/craft_application/services/service_factory.py", line 95, in __getattr__
2024-07-04 16:41:26.982     instance.setup()
2024-07-04 16:41:26.982   File "/snap/charmcraft/4025/lib/python3.10/site-packages/charmcraft/services/store.py", line 173, in setup
2024-07-04 16:41:26.982     super().setup()
2024-07-04 16:41:26.982   File "/snap/charmcraft/4025/lib/python3.10/site-packages/charmcraft/services/store.py", line 80, in setup
2024-07-04 16:41:26.982     self.client = self.ClientClass(
2024-07-04 16:41:26.982   File "/snap/charmcraft/4025/lib/python3.10/site-packages/charmcraft/store/client.py", line 139, in __init__
2024-07-04 16:41:26.982     super().__init__(
2024-07-04 16:41:26.982   File "/snap/charmcraft/4025/lib/python3.10/site-packages/craft_store/store_client.py", line 93, in __init__
2024-07-04 16:41:26.982     super().__init__(
2024-07-04 16:41:26.982   File "/snap/charmcraft/4025/lib/python3.10/site-packages/craft_store/base_client.py", line 77, in __init__
2024-07-04 16:41:26.982     self._auth = Auth(
2024-07-04 16:41:26.982   File "/snap/charmcraft/4025/lib/python3.10/site-packages/craft_store/auth.py", line 201, in __init__
2024-07-04 16:41:26.982     raise errors.NoKeyringError
2024-07-04 16:41:26.982 craft_store.errors.NoKeyringError: No keyring found to store or retrieve credentials from.
2024-07-04 16:41:26.982 Full execution log: '/home/ubuntu/.local/state/charmcraft/log/charmcraft-20240704-164126.909389.log'
jdkandersson commented 3 days ago

Also can't login:

charmcraft login
charmcraft internal error: NoKeyringError('No keyring found to store or retrieve credentials from.') 
jdkandersson commented 3 days ago

Also can't login using a token:

charmcraft login --export ~/charmcraft_auth
charmcraft internal error: NoKeyringError('No keyring found to store or retrieve credentials from.')