Skip to content

libjuju failure when trying to raise a websocket connection closed exception #1252

Open
@gboutry

Description

Description

When a disconnection happens, a libjuju fails to raise a websocket connection closed failure.

Line emanating failure:

raise websockets.ConnectionClosed(1006, "no reason")

This seems linked to this commit of websockets:
python-websockets/websockets@5638611
https://github.com/python-websockets/websockets/blob/5638611169aa763ec84cdc8d2a967b0533401129/src/websockets/exceptions.py#L100

It introduced an assert that always fails in how python libjuju instantiates the exception.

Urgency

Blocker for our release

Python-libjuju version

3.6.1.0

Juju version

3.6.1

Reproduce / Test

This is a coding failure, just need to instantiate (not raise) the exception, and the assertion will fail:

python3
>>> import websockets
>>> websockets.ConnectionClosed(1006, "no reason")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/gboutry/Documents/canonical/projects/python-libjuju/.venv/lib/python3.12/site-packages/websockets/exceptions.py", line 96, in __init__
    assert (self.rcvd_then_sent is None) == (self.rcvd is None or self.sent is None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugindicates a bug in the project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions