canonical / juju-lint

Run checks against a juju model
GNU General Public License v3.0
0 stars 3 forks source link

Juju-lint is incompatible with juju 3.1 #66

Closed zxhdaze closed 5 months ago

zxhdaze commented 5 months ago

During the release testing of juju 3.1 we found out that juju-lint is incompatible with juju 3.1. In the logs we see:

2023-01-30 14:37:51 ERROR unit.juju-lint/0.juju-log server.go:325 auto_lint.py timeout with this output:
 ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-13' coro=<Model._watch.<locals>._all_watcher() done, defined at /var/lib/juju/agents/unit-juju-lint-0/charm/venv/juju/model.py:1189> exception=JujuAPIError('client incompatible with server 3.1-rc1')>
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-juju-lint-0/charm/venv/juju/model.py", line 1192, in _all_watcher
    model_config = await self.get_config()
  File "/var/lib/juju/agents/unit-juju-lint-0/charm/venv/juju/model.py", line 2182, in get_config
    result = await config_facade.ModelGet()
  File "/var/lib/juju/agents/unit-juju-lint-0/charm/venv/juju/client/facade.py", line 481, in wrapper
    reply = await f(*args, **kwargs)
  File "/var/lib/juju/agents/unit-juju-lint-0/charm/venv/juju/client/_client3.py", line 2142, in ModelGet
    reply = await self.rpc(msg)
  File "/var/lib/juju/agents/unit-juju-lint-0/charm/venv/juju/client/facade.py", line 654, in rpc
    result = await self.connection.rpc(msg, encoder=TypeEncoder)
  File "/var/lib/juju/agents/unit-juju-lint-0/charm/venv/juju/client/connection.py", line 638, in rpc
    raise errors.JujuAPIError(result)
juju.errors.JujuAPIError: client incompatible with server 3.1-rc1

2023-01-30 14:37:51 ERROR unit.juju-lint/0.juju-log server.go:325 Uncaught exception while in charm code:
Traceback (most recent call last):
  File "./src/charm.py", line 125, in <module>
    main(JujuLintCharm)
  File "/var/lib/juju/agents/unit-juju-lint-0/charm/venv/ops/main.py", line 438, in main
    _emit_charm_event(charm, dispatcher.event_name)
  File "/var/lib/juju/agents/unit-juju-lint-0/charm/venv/ops/main.py", line 150, in _emit_charm_event
    event_to_emit.emit(*args, **kwargs)
  File "/var/lib/juju/agents/unit-juju-lint-0/charm/venv/ops/framework.py", line 355, in emit
    framework._emit(event)  # noqa
  File "/var/lib/juju/agents/unit-juju-lint-0/charm/venv/ops/framework.py", line 856, in _emit
    self._reemit(event_path)
  File "/var/lib/juju/agents/unit-juju-lint-0/charm/venv/ops/framework.py", line 931, in _reemit
    custom_handler(event)
  File "./src/charm.py", line 91, in on_config_changed
    self.helper.run_auto_lint()
  File "/var/lib/juju/agents/unit-juju-lint-0/charm/lib/lib_jujulint.py", line 189, in run_auto_lint
    raise error
  File "/var/lib/juju/agents/unit-juju-lint-0/charm/lib/lib_jujulint.py", line 174, in run_auto_lint
    subprocess.check_output(
  File "/usr/lib/python3.8/subprocess.py", line 415, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.8/subprocess.py", line 495, in run
    stdout, stderr = process.communicate(input, timeout=timeout)
  File "/usr/lib/python3.8/subprocess.py", line 1028, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
  File "/usr/lib/python3.8/subprocess.py", line 1869, in _communicate
    self._check_timeout(endtime, orig_timeout, stdout, stderr)
  File "/usr/lib/python3.8/subprocess.py", line 1072, in _check_timeout
    raise TimeoutExpired(
subprocess.TimeoutExpired: Command '['/usr/local/bin/auto_lint.py']' timed out after 60 seconds

According to the juju team, python-libjuju currently has no releases that are compatible with juju 3.1, but the master branch is. When juju 3.1 is released, python -libjuju will release as well. At that point the juju-lint charm can be rebuild and it should work again.


Imported from Launchpad using lp2gh.

zxhdaze commented 5 months ago

(by aieri) tentatively adding this to the juju-lint project as we are planning to shift all libjuju code to the snap

zxhdaze commented 5 months ago

(by martin-kalcok) I think that this issue was associated with wrong PR.

We chose to maintain compatibility with older Juju controllers (<3.0) and in the linked PR we pinned libjuju to reflect this fact. Going forward we'll have to figure an approach to ideally support both 2.X and 3.X controllers.

Bottom line is that this issue is not solved.