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

fetch-libs crashes with an internal error #1681

Open
jdkandersson opened this issue May 9, 2024 · 2 comments
Open

fetch-libs crashes with an internal error #1681

jdkandersson opened this issue May 9, 2024 · 2 comments
Assignees
Labels
Bug Something isn't working

Comments

@jdkandersson
Copy link
Contributor

Bug Description

After logging in and running fetch-libs, there is an internal error charmcraft internal error: StoreServerError("Store operation failed:\n- None: Items need to include 'library_id' or 'package_id'")

To Reproduce

  1. Create a multipass VM
  2. Install latest/edge of charmcraft
  3. Include a charm-libs entry such as:
charm-libs:
  - lib: observability_libs.juju_topology
    version: 0
  1. run fetch-libs

Environment

arm64 ubuntu jammy, charmcraft on latest/edge

charmcraft.yaml

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

name: sample-flask

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

charm-libs:
  - lib: observability_libs.juju_topology
    version: 0

# Uncomment the integrations used by your application
# requires:
#   mysql:
#     interface: mysql_client
#     limit: 1
#   postgresql:
#     interface: postgresql_client
#     limit: 1

Relevant log output

cat /home/ubuntu/.local/state/charmcraft/log/charmcraft-20240509-174417.997582.log
2024-05-09 17:44:17.998 Starting charmcraft, version 3.0.0.post39+ge2ad204
2024-05-09 17:44:17.998 Log verbosity level set to BRIEF
2024-05-09 17:44:17.998 Configuring application...
2024-05-09 17:44:17.998 Preparing application...
2024-05-09 17:44:17.998 Build plan: platform=None, build_for=None
2024-05-09 17:44:17.998 Loading project file '/home/ubuntu/src/sample-flask/charm/charmcraft.yaml'
2024-05-09 17:44:18.000 Processing grammar (on arm64 for arm64)
2024-05-09 17:44:18.000 Processing grammar for plugin: charm
2024-05-09 17:44:18.000 Processing grammar for source: .
2024-05-09 17:44:18.000 Running charmcraft fetch-libs on host
2024-05-09 17:44:18.000 Setting up StoreService
2024-05-09 17:44:18.074 Falling back to file based storage
2024-05-09 17:44:18.074 Getting library metadata from charmhub
2024-05-09 17:44:18.074 Retrieving credentials for 'charmcraft' on 'api.charmhub.io' from keyring 'auth FileKeyring'.
2024-05-09 17:44:18.074 HTTP 'POST' for 'https://api.charmhub.io/v1/charm/libraries/bulk' with params None and headers {'Authorization': '<macaroon>', 'User-Agent': 'Charmcraft/3.0.0.post39+ge2ad204 (Linux 5.15.0-106-generic; aarch64; CPython 3.10.12; Ubuntu 22.04)'}
2024-05-09 17:44:18.258 charmcraft internal error: StoreServerError("Store operation failed:\n- None: Items need to include 'library_id' or 'package_id'")
2024-05-09 17:44:18.265 Traceback (most recent call last):
2024-05-09 17:44:18.265   File "/snap/charmcraft/3739/lib/python3.10/site-packages/craft_application/application.py", line 517, in run
2024-05-09 17:44:18.265     return_code = dispatcher.run() or 0
2024-05-09 17:44:18.265   File "/snap/charmcraft/3739/lib/python3.10/site-packages/craft_cli/dispatcher.py", line 487, in run
2024-05-09 17:44:18.265     return self._loaded_command.run(self._parsed_command_args)
2024-05-09 17:44:18.265   File "/snap/charmcraft/3739/lib/python3.10/site-packages/charmcraft/application/commands/store.py", line 1679, in run
2024-05-09 17:44:18.265     libs_metadata = store.get_libraries_metadata_by_name(charm_libs)
2024-05-09 17:44:18.265   File "/snap/charmcraft/3739/lib/python3.10/site-packages/charmcraft/services/store.py", line 220, in get_libraries_metadata_by_name
2024-05-09 17:44:18.265     for lib in self.get_libraries_metadata(libraries)
2024-05-09 17:44:18.265   File "/snap/charmcraft/3739/lib/python3.10/site-packages/charmcraft/services/store.py", line 212, in get_libraries_metadata
2024-05-09 17:44:18.265     return self.client.fetch_libraries_metadata(store_libs)
2024-05-09 17:44:18.265   File "/snap/charmcraft/3739/lib/python3.10/site-packages/charmcraft/store/client.py", line 202, in fetch_libraries_metadata
2024-05-09 17:44:18.265     response = self.request_urlpath_json("POST", "/v1/charm/libraries/bulk", json=libs)
2024-05-09 17:44:18.265   File "/snap/charmcraft/3739/lib/python3.10/site-packages/charmcraft/store/client.py", line 134, in request_urlpath_json
2024-05-09 17:44:18.265     response = super().request(method, self.api_base_url + urlpath, *args, **kwargs)
2024-05-09 17:44:18.265   File "/snap/charmcraft/3739/lib/python3.10/site-packages/craft_store/base_client.py", line 186, in request
2024-05-09 17:44:18.265     return self.http_client.request(
2024-05-09 17:44:18.265   File "/snap/charmcraft/3739/lib/python3.10/site-packages/craft_store/http_client.py", line 166, in request
2024-05-09 17:44:18.265     raise errors.StoreServerError(response)
2024-05-09 17:44:18.265 craft_store.errors.StoreServerError: Store operation failed:
2024-05-09 17:44:18.265 - None: Items need to include 'library_id' or 'package_id'
2024-05-09 17:44:18.265 Full execution log: '/home/ubuntu/.local/state/charmcraft/log/charmcraft-20240509-174417.997582.log'
@jdkandersson jdkandersson added the Bug Something isn't working label May 9, 2024
Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-2903.

This message was autogenerated

@gregory-schiano
Copy link
Contributor

This issue is related to my comment here:
#1671 (comment)

@lengau lengau self-assigned this May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants