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

Unable to deploy a bundle using model.deploy #116

Open
Gmerold opened this issue Oct 10, 2023 · 3 comments
Open

Unable to deploy a bundle using model.deploy #116

Gmerold opened this issue Oct 10, 2023 · 3 comments

Comments

@Gmerold
Copy link

Gmerold commented Oct 10, 2023

Hello Team,

In my integration tests, I'm not able to deploy a bundle using ops_test.model.deploy as shown in the snippet below:

with ops_test.model_context(COS_MODEL_NAME):
    await ops_test.model.deploy(  # type: ignore[union-attr]
        entity_url="https://charmhub.io/cos-lite",
        trust=True,
    )

The error I'm getting is:

File "/actions-runner/_work/sdcore-tests/sdcore-tests/tests/integration/fixtures.py", line 90, in deploy_cos_lite
    await ops_test.model.deploy(  # type: ignore[union-attr]
  File "/actions-runner/_work/sdcore-tests/sdcore-tests/.tox/integration/lib/python3.10/site-packages/juju/model.py", line 1748, in deploy
    await handler.fetch_plan(url, charm_origin, overlays=overlays)
  File "/actions-runner/_work/sdcore-tests/sdcore-tests/.tox/integration/lib/python3.10/site-packages/juju/bundle.py", line 302, in fetch_plan
    raise JujuError(self.plan.errors)
juju.errors.JujuError: ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '']

My env is:

  • Juju 3.1.6
  • Python Juju lib 3.2.2
  • pytest-operator 0.29.0
  • Microk8s 1.27.5 (1.27-strict/stable)

Workaround is of course running deployment using ops_test.run, but I'd rather use a proper way to deploy bundles.

BR,
Bartek

@addyess
Copy link
Member

addyess commented Oct 20, 2023

agreed, this is breaking in the integration tests for this plugin itself
https://github.com/charmed-kubernetes/pytest-operator/actions/runs/6582862153?pr=118

@cderici i believe this is an issue with python-libjuju. Do you agree?

@cderici
Copy link

cderici commented Oct 20, 2023

@cderici i believe this is an issue with python-libjuju. Do you agree?

Yeah that output looks very weird. I'm not quite sure if it's the pylibjuju client in particular, but definitely something seems to be going on on the Juju side. I'll try to reproduce this today and see what might be happening 👍

@cderici
Copy link

cderici commented Oct 20, 2023

@addyess looks like it might be something else, I was able to deploy with the following settings just fine:

pylibjuju master branch tip (basically the same with 3.2.2), juju 3.1.6 on microk8s 1.27.6

python -m asyncio
asyncio REPL 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] on linux
Use "await" directly instead of "asyncio.run()".
Type "help", "copyright", "credits" or "license" for more information.
>>> import asyncio
>>> from juju import model;m=model.Model();await m.connect()
>>> await m.deploy(entity_url="https://charmhub.io/cos-lite", trust=True)
[<Application entity_id="alertmanager">, <Application entity_id="loki">, <Application entity_id="prometheus">, <Application entity_id="traefik">, <Application entity_id="catalogue">, <Application entity_id="grafana">]
>>>

But as I was writing this, I just realized I saw that weird error from bundles before, and sure enough, looks like I fixed it in a run-by not so long ago in juju/python-libjuju#949, you can see a similar error message in the description.

So basically this issue will go away when we make a new latest release on libjuju, which should be pretty soon 👍

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

No branches or pull requests

3 participants