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

Ch. 7 - Visualization - Error in Jupyter Notebook when executing Cells #126

Closed
justb4 opened this issue Jun 5, 2023 · 2 comments
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@justb4
Copy link
Member

justb4 commented Jun 5, 2023

Happens after upgrade to Jammy.

  • follow Container output: docker logs --follow geopython-workshop-jupyter
  • load Ch. 7
  • Execute All Cells
  • view log output as below
========== Ch 7 ===========
[I 11:38:11.111 NotebookApp] Saving file at /07-visualization.ipynb
[I 11:38:11.445 NotebookApp] Starting buffering for 755bdda5-d4ec-4dff-ad57-05d7e813439d:f3639f2fdd414a3e8dc71f37258c625e
[I 11:38:13.168 NotebookApp] 302 GET /notebooks/images/bokeh-example1.jpg (172.19.0.1) 3.370000ms
[I 11:38:14.065 NotebookApp] Discarding 40 buffered messages for 755bdda5-d4ec-4dff-ad57-05d7e813439d:f3639f2fdd414a3e8dc71f37258c625e
[E 11:38:14.514 NotebookApp] Uncaught exception in ZMQStream callback
    Traceback (most recent call last):
      File "/usr/local/lib/python3.10/dist-packages/zmq/eventloop/zmqstream.py", line 584, in _run_callback
        f = callback(*args, **kwargs)
      File "/usr/local/lib/python3.10/dist-packages/zmq/eventloop/zmqstream.py", line 308, in stream_callback
        return callback(self, msg)
      File "/usr/local/lib/python3.10/dist-packages/notebook/services/kernels/handlers.py", line 572, in _on_zmq_reply
        super()._on_zmq_reply(stream, msg)
      File "/usr/local/lib/python3.10/dist-packages/notebook/base/zmqhandlers.py", line 256, in _on_zmq_reply
        self.write_message(msg, binary=isinstance(msg, bytes))
      File "/usr/local/lib/python3.10/dist-packages/tornado/websocket.py", line 334, in write_message
        return self.ws_connection.write_message(message, binary=binary)
      File "/usr/local/lib/python3.10/dist-packages/tornado/websocket.py", line 1081, in write_message
        fut = self._write_frame(True, opcode, message, flags=flags)
      File "/usr/local/lib/python3.10/dist-packages/tornado/websocket.py", line 1056, in _write_frame
        return self.stream.write(frame)
      File "/usr/local/lib/python3.10/dist-packages/tornado/iostream.py", line 539, in write
        self._handle_write()
      File "/usr/local/lib/python3.10/dist-packages/tornado/iostream.py", line 965, in _handle_write
        self._write_buffer.advance(num_bytes)
      File "/usr/local/lib/python3.10/dist-packages/tornado/iostream.py", line 182, in advance
        assert 0 < size <= self._size
    AssertionError
[E 11:38:14.517 NotebookApp] Uncaught exception in zmqstream callback
    Traceback (most recent call last):
      File "/usr/local/lib/python3.10/dist-packages/zmq/eventloop/zmqstream.py", line 634, in _handle_events
        self._handle_recv()
      File "/usr/local/lib/python3.10/dist-packages/zmq/eventloop/zmqstream.py", line 663, in _handle_recv
        self._run_callback(callback, msg)
      File "/usr/local/lib/python3.10/dist-packages/zmq/eventloop/zmqstream.py", line 584, in _run_callback
        f = callback(*args, **kwargs)
      File "/usr/local/lib/python3.10/dist-packages/zmq/eventloop/zmqstream.py", line 308, in stream_callback
        return callback(self, msg)
      File "/usr/local/lib/python3.10/dist-packages/notebook/services/kernels/handlers.py", line 572, in _on_zmq_reply
        super()._on_zmq_reply(stream, msg)
      File "/usr/local/lib/python3.10/dist-packages/notebook/base/zmqhandlers.py", line 256, in _on_zmq_reply
        self.write_message(msg, binary=isinstance(msg, bytes))
      File "/usr/local/lib/python3.10/dist-packages/tornado/websocket.py", line 334, in write_message
        return self.ws_connection.write_message(message, binary=binary)
      File "/usr/local/lib/python3.10/dist-packages/tornado/websocket.py", line 1081, in write_message
        fut = self._write_frame(True, opcode, message, flags=flags)
      File "/usr/local/lib/python3.10/dist-packages/tornado/websocket.py", line 1056, in _write_frame
        return self.stream.write(frame)
      File "/usr/local/lib/python3.10/dist-packages/tornado/iostream.py", line 539, in write
        self._handle_write()
      File "/usr/local/lib/python3.10/dist-packages/tornado/iostream.py", line 965, in _handle_write
        self._write_buffer.advance(num_bytes)
      File "/usr/local/lib/python3.10/dist-packages/tornado/iostream.py", line 182, in advance
        assert 0 < size <= self._size
    AssertionError
[E 11:38:14.519 NotebookApp] Exception in callback functools.partial(<function ZMQStream._update_handler.<locals>.<lambda> at 0x7fdf5a30e7a0>)
    Traceback (most recent call last):
      File "/usr/local/lib/python3.10/dist-packages/tornado/ioloop.py", line 738, in _run_callback
        ret = callback()
      File "/usr/local/lib/python3.10/dist-packages/zmq/eventloop/zmqstream.py", line 718, in <lambda>
        self.io_loop.add_callback(lambda: self._handle_events(self.socket, 0))
      File "/usr/local/lib/python3.10/dist-packages/zmq/eventloop/zmqstream.py", line 634, in _handle_events
        self._handle_recv()
      File "/usr/local/lib/python3.10/dist-packages/zmq/eventloop/zmqstream.py", line 663, in _handle_recv
        self._run_callback(callback, msg)
      File "/usr/local/lib/python3.10/dist-packages/zmq/eventloop/zmqstream.py", line 584, in _run_callback
        f = callback(*args, **kwargs)
      File "/usr/local/lib/python3.10/dist-packages/zmq/eventloop/zmqstream.py", line 308, in stream_callback
        return callback(self, msg)
      File "/usr/local/lib/python3.10/dist-packages/notebook/services/kernels/handlers.py", line 572, in _on_zmq_reply
        super()._on_zmq_reply(stream, msg)
      File "/usr/local/lib/python3.10/dist-packages/notebook/base/zmqhandlers.py", line 256, in _on_zmq_reply
        self.write_message(msg, binary=isinstance(msg, bytes))
      File "/usr/local/lib/python3.10/dist-packages/tornado/websocket.py", line 334, in write_message
        return self.ws_connection.write_message(message, binary=binary)
      File "/usr/local/lib/python3.10/dist-packages/tornado/websocket.py", line 1081, in write_message
        fut = self._write_frame(True, opcode, message, flags=flags)
      File "/usr/local/lib/python3.10/dist-packages/tornado/websocket.py", line 1056, in _write_frame
        return self.stream.write(frame)
      File "/usr/local/lib/python3.10/dist-packages/tornado/iostream.py", line 539, in write
        self._handle_write()
      File "/usr/local/lib/python3.10/dist-packages/tornado/iostream.py", line 965, in _handle_write
        self._write_buffer.advance(num_bytes)
      File "/usr/local/lib/python3.10/dist-packages/tornado/iostream.py", line 182, in advance
        assert 0 < size <= self._size
    AssertionError

Happens first time with Strava map draw. No Bokeh plots are shown as well.
Looks similar to this issue: https://youtrack.jetbrains.com/issue/DS-4883

@justb4 justb4 added the bug Something isn't working label Jun 5, 2023
@justb4 justb4 added this to the FOSS4G 2023 milestone Jun 5, 2023
@justb4
Copy link
Member Author

justb4 commented Jun 5, 2023

And similar to this:
https://discourse.jupyter.org/t/jupyter-notebook-zmq-message-arrived-on-closed-channel-error/17869/27
Seems to occur when plotting, e.g. Matplotlib.

@justb4 justb4 self-assigned this Jun 5, 2023
@justb4
Copy link
Member Author

justb4 commented Jun 5, 2023

Solved by updating the requirements.txt and the Dockerfile (all pip install moved to requirements.txt as well) as in issue #124.

tornado==6.2
jupyter-client==7.4.8
jupyter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Development

No branches or pull requests

1 participant