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

JujuAPIError: permission denied from juju FullStatus API call #1092

Closed
yanksyoon opened this issue Aug 26, 2024 · 2 comments
Closed

JujuAPIError: permission denied from juju FullStatus API call #1092

yanksyoon opened this issue Aug 26, 2024 · 2 comments

Comments

@yanksyoon
Copy link
Contributor

Description

This is a follow-up ticket report from https://matrix.to/#/!xzmWHtGpPfVCXKivIh:ubuntu.com/$5-Tq8RLBv0TZI4z-49_0HdGMU0th_O417NNJXBiAVuY?via=ubuntu.com&via=matrix.org&via=matrix.debian.social.

I've got an integration test that is able to deploy application, integration applications and all but as soon as I try to wait for the application, Juju will throw a juju.errors.JujuAPIError: permission denied. The applications are Active and working fine.
For context, this is using a private-endpoint connection method to connect to the model (see https://github.com/canonical/github-runner-operator/blob/713efe6f59e7c0bfeb97bce7f42860692d6ff5bc/tests/integration/setup_private_endpoint_model.sh).

Full integration test error log/stacktrace: https://pastebin.canonical.com/p/3RCbKwB4kQ/

2024-08-25T10:47:58.8648346Z   File "/home/ubuntu/actions-runner/_work/github-runner-operator/github-runner-operator/.tox/integration-juju3.2/lib/python3.10/site-packages/juju/model.py", line 2736, in wait_for_idle
2024-08-25T10:47:58.8650200Z     app_status = await app.get_status()
2024-08-25T10:47:58.8652154Z   File "/home/ubuntu/actions-runner/_work/github-runner-operator/github-runner-operator/.tox/integration-juju3.2/lib/python3.10/site-packages/juju/application.py", line 476, in get_status
2024-08-25T10:47:58.8654158Z     full_status = await client_facade.FullStatus(patterns=None)
2024-08-25T10:47:58.8656398Z   File "/home/ubuntu/actions-runner/_work/github-runner-operator/github-runner-operator/.tox/integration-juju3.2/lib/python3.10/site-packages/juju/client/facade.py", line 486, in wrapper
2024-08-25T10:47:58.8658123Z     reply = await f(*args, **kwargs)
2024-08-25T10:47:58.8660114Z   File "/home/ubuntu/actions-runner/_work/github-runner-operator/github-runner-operator/.tox/integration-juju3.2/lib/python3.10/site-packages/juju/client/_client6.py", line 1340, in FullStatus
2024-08-25T10:47:58.8661868Z     reply = await self.rpc(msg)
2024-08-25T10:47:58.8663783Z   File "/home/ubuntu/actions-runner/_work/github-runner-operator/github-runner-operator/.tox/integration-juju3.2/lib/python3.10/site-packages/juju/client/facade.py", line 659, in rpc
2024-08-25T10:47:58.8665625Z     result = await self.connection.rpc(msg, encoder=TypeEncoder)
2024-08-25T10:47:58.8668106Z   File "/home/ubuntu/actions-runner/_work/github-runner-operator/github-runner-operator/.tox/integration-juju3.2/lib/python3.10/site-packages/juju/client/connection.py", line 677, in rpc
2024-08-25T10:47:58.8669950Z     raise errors.JujuAPIError(result)
2024-08-25T10:47:58.8670641Z juju.errors.JujuAPIError: permission denied

Urgency

Annoying bug in our test suite

Python-libjuju version

3.2.3.0

Juju version

3.5.3

Reproduce / Test

1. Setup appropriate credentials for juju controller, model and account in `/.local/share/juju` dir.
2. Using Juju.Model, connect to the model.

from juju.model import Model
import pytest_asyncio

@pytest_asyncio.fixture(name="model")
async def model_fixture():
    model = Model()
    await model.connect()
    yield model
    await model.disconnect()

async def test_connection(model:Model):
    app = await model.deploy("ubuntu")
    await model.wait_for_idle(apps=[app.name])
    # should raise an error here
@juju juju deleted a comment Aug 26, 2024
@juju juju deleted a comment Aug 26, 2024
@juju juju deleted a comment Aug 26, 2024
@juju juju deleted a comment Aug 26, 2024
@yanksyoon
Copy link
Contributor Author

An update - i've matched the controller version to the lib version and i'm now getting:

"TypeError: expected string or bytes-like object" (full stacktrace: https://pastebin.canonical.com/p/McGNJyB9n6/) for storage options.

https://github.com/juju/python-libjuju/blob/main/juju/model.py#L1693

it does say the storage parameter should be a dict, i'm passing in {"runner": {"pool": "rootfs", "size": 11}} as the value for storage parameter in model.deploy.
It has been working for other versions of libjuju but not for 3.5.x. This is not critically blocking our production but just some integration tests which would be nice to have to secure our deployments for ARM.

@Aflynn50
Copy link
Contributor

Aflynn50 commented Sep 5, 2024

This seems to be the same issue as #1093

Closing as this is a duplicate.

@Aflynn50 Aflynn50 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@Aflynn50 @yanksyoon and others