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

mopidy iris websocket connection closes due to uncaught exception #932

Open
2 of 10 tasks
mgoltzsche opened this issue Nov 12, 2023 · 2 comments
Open
2 of 10 tasks
Labels

Comments

@mgoltzsche
Copy link

mgoltzsche commented Nov 12, 2023

Iris version

3.68.0

Operating system(s) affected

  • Windows
  • MacOS
  • iOS
  • Android
  • Linux
  • Other

Browser(s) affected

  • Firefox
  • Chrome
  • Edge
  • Other

What happened?

I have an Iris installation running on my raspberry pi that I didn't update for some time since it was working fine. Now, since a while, Iris permanently shows error notifications saying something about the websocket being closed and is apparently unsuccessfully retrying.
mopidy logs a corresponding error every 5 seconds.

Fortunately, mopidy is still playing music.

After clearing my browser cache and storage as suggested within another issue, the error logs and notifications disappeared.

Now I wonder: Did the problem exist since the last Iris update? Did the Iris update broke my mopidy installation (which I didn't update myself explicitly)? Is it possible that Iris is dynamically loading something from the newer version in the web into the older installation that resulted in compatibility problems? If so, I wonder whether that could be prevented?
A mopidy Iris installation should not change, unless I install an update explicitly.

Logs

ERROR    2023-11-12 00:27:38,455 [14:HttpServer] tornado.application
  Uncaught exception GET /iris/ws/ (10.42.0.1)
HTTPServerRequest(protocol='http', host='kubemate-a33a', method='GET', uri='/iris/ws/', version='HTTP/1.1', remote_ip='10.42.0.1')
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/tornado/websocket.py", line 937, in _accept_connection
    open_result = handler.open(*handler.open_args, **handler.open_kwargs)
  File "/usr/lib/python3.10/site-packages/mopidy_iris/handlers.py", line 48, in open
    iris.add_connection(connection=self, client=client)
  File "/usr/lib/python3.10/site-packages/mopidy_iris/core.py", line 282, in add_connection
    self.broadcast(
  File "/usr/lib/python3.10/site-packages/mopidy_iris/core.py", line 236, in broadcast
    connection["connection"].write_message(json_encode(message))
  File "/usr/lib/python3.10/site-packages/tornado/websocket.py", line 331, in write_message
    raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError

Relates to #405, #410

@mgoltzsche mgoltzsche added the bug label Nov 12, 2023
@jaedb
Copy link
Owner

jaedb commented Nov 16, 2023

Can you please try a hard refresh on all open browsers? I suspect you have one or more browsers using the older version of Iris frontend, which may be using a deprecated websocket connection structure. As a result, the up-to-date Iris backend rejects it.

If this resolves the issue then we will know the initial connection request is the culprit.

@mgoltzsche
Copy link
Author

mgoltzsche commented Nov 18, 2023

Since I refreshed my browser already and deleted browser storage the problem disappeared. Though, I created this issue to get to the bottom of this: Why is Iris breaking although I did not update my mopidy/Iris installation? (In fact it is running within a custom docker container that I didn't update for a while.)

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

No branches or pull requests

2 participants