juju / python-libjuju

Python library for the Juju API
Apache License 2.0
59 stars 99 forks source link

deploy bundle -> theblues.errors.EntityNotFound #511

Closed rgildein closed 2 years ago

rgildein commented 3 years ago

While trying to deploy the bundle in integration tests, I get the following error message:

Traceback (most recent call last):                          
  File "/home/ubuntu/mlflow-operator/.tox/integration/lib/python3.8/site-packages/theblues/charmstore.py", line 78, in _get
    response.raise_for_status()                         
  File "/home/ubuntu/mlflow-operator/.tox/integration/lib/python3.8/site-packages/requests/models.py", line 943, in raise_for_status                                                                                                                                                      
    raise HTTPError(http_error_msg, response=self)                                                                                                                                                                                                                                        
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.jujucharms.com/charmstore/v5/nginx-ingress-integrator/meta/any?channel=stable                                                                                                                             

During handling of the above exception, another exception occurred:                                                                                                                                                                                                                       

Traceback (most recent call last): 
  File "/home/ubuntu/mlflow-operator/tests/integration/test_mlflow_integration.py", line 58, in test_build_and_deploy
    await ops_test.model.deploy(ops_test.render_bundle(
  File "/home/ubuntu/mlflow-operator/.tox/integration/lib/python3.8/site-packages/juju/model.py", line 1446, in deploy
    await handler.execute_plan()
  File "/home/ubuntu/mlflow-operator/.tox/integration/lib/python3.8/site-packages/juju/bundle.py", line 167, in execute_plan
    self.references[step.id_] = await change.run(self)
  File "/home/ubuntu/mlflow-operator/.tox/integration/lib/python3.8/site-packages/juju/bundle.py", line 437, in run
    entity_id = await context.charmstore.entityId(self.charm, channel=self.channel)
  File "/home/ubuntu/mlflow-operator/.tox/integration/lib/python3.8/site-packages/juju/charmstore.py", line 30, in coro
    return await self.loop.run_in_executor(None, method)
  File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/ubuntu/mlflow-operator/.tox/integration/lib/python3.8/site-packages/theblues/charmstore.py", line 337, in entityId
    data = self._get(_add_channel(url, channel))
  File "/home/ubuntu/mlflow-operator/.tox/integration/lib/python3.8/site-packages/theblues/charmstore.py", line 82, in _get
    raise EntityNotFound(url)
theblues.errors.EntityNotFound: https://api.jujucharms.com/charmstore/v5/nginx-ingress-integrator/meta/any?channel=stable

However, the juju deploy ./bundle.yaml command works fine.

bundle: kubernetes
applications:
  mariadb-k8s:
    charm: cs:~charmed-osm/mariadb-k8s-35
    channel: stable
    series: kubernetes
    scale: 1
  minio:
    charm: cs:minio-55
    channel: stable
    series: kubernetes
    scale: 1
  ingress:
    charm: nginx-ingress-integrator
    channel: stable
    series: kubernetes
    scale: 1
  mlflow:
    charm: mlflow
    channel: beta
    series: kubernetes
    scale: 1
relations:
- - ingress:ingress
  - mlflow:ingress
johnsca commented 3 years ago

It looks like the nginx-ingress-integrator charm was only uploaded to CharmHub and not to the old charm store so it seems that the bundle handling logic needs to be updated to use the CharmHub API rather than the CharmStore API.

SimonRichardson commented 3 years ago

Yeah this is coming soon, we're finishing off resources, before we can land it. Alternatively, you could attempt to use the branch that @johnsca linked and see how far you get.

SimonRichardson commented 2 years ago

Fixed in the 2.9.4 release.