libjuju crashes when the shared state watcher was stopped, libjuju tries to handle and fails with the following error: AttributeError: 'NoneType' object has no attribute 'exception'
Error: -20 13:19:12 [ERROR] Exception in callback create_task_with_handler.<locals>._task_result_exp_handler(task_name='tmp', logger=None)(<Task finishe...was stopped')>) at /home/runner/work/zaza/zaza/.tox/func-target/lib/python3.10/site-packages/juju/jasyncio.py:53
handle: <Handle create_task_with_handler.<locals>._task_result_exp_handler(task_name='tmp', logger=None)(<Task finishe...was stopped')>) at /home/runner/work/zaza/zaza/.tox/func-target/lib/python3.10/site-packages/juju/jasyncio.py:53>
Traceback (most recent call last):
File "/home/runner/work/zaza/zaza/.tox/func-target/lib/python3.10/site-packages/juju/jasyncio.py", line 55, in _task_result_exp_handler
task.result()
File "/home/runner/work/zaza/zaza/.tox/func-target/lib/python3.10/site-packages/juju/client/facade.py", line 486, in wrapper
reply = await f(*args, **kwargs)
File "/home/runner/work/zaza/zaza/.tox/func-target/lib/python3.10/site-packages/juju/client/_client1.py", line 315, in Next
reply = await self.rpc(msg)
File "/home/runner/work/zaza/zaza/.tox/func-target/lib/python3.10/site-packages/juju/client/overrides.py", line 113, in rpc
result = await self.connection.rpc(msg, encoder=TypeEncoder)
File "/home/runner/work/zaza/zaza/.tox/func-target/lib/python3.10/site-packages/juju/client/connection.py", line 635, in rpc
raise errors.JujuAPIError(result)
juju.errors.JujuAPIError: shared state watcher was stopped
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "/home/runner/work/zaza/zaza/.tox/func-target/lib/python3.10/site-packages/juju/jasyncio.py", line 67, in _task_result_exp_handler
logger.exception("Task %s raised an exception: %s" % (task_name, e))
AttributeError: 'NoneType' object has no attribute 'exception'
Description
libjuju crashes when the shared state watcher was stopped, libjuju tries to handle and fails with the following error:
AttributeError: 'NoneType' object has no attribute 'exception'We are seeing this issue in our CI - https://github.com/openstack-charmers/zaza/actions/runs/7907308186/job/21769045812?pr=608
The full stacktrace is:
Urgency
Casually reporting
Python-libjuju version
2.9.46.1
Juju version
2.9.46
Reproduce / Test