Hi Bryan,
Again, thanks for your message!
Below I describe how to reproduce it using conda environment:
conda create -n jup-bokeh python=3.7 jupyter bokeh
conda activate jup-bokeh
pip install nest_asyncio
jupyter notebook no_plot_until_end_of_cell.ipynb
no_plot_until_end_of_cell.ipynb is the same notebook as I posted in my first message, but with the necessary changes to run the bokeh server on a dedicated event loop.
As on today this installs:
- bokeh 2.2.3
- jupyter core 4.6.3
- jupyter-notebook 6.1.4
- ipykernel 5.3.4
- tornado 6.0.4
When you execute cells of the notebook, after cell 3, when you use the “Wheel zoom” then the error is triggered. Fo example now I got another message:
ERROR:bokeh.server.views.ws:Handler or its work threw an exception: AssertionError(): Message 'PATCH-DOC' content: {'events': [{'kind': 'ModelChanged', 'model': {'id': '1006'}, 'attr': 'start', 'new': 0.10513336017804716}, {'kind': 'ModelChanged', 'model': {'id': '1006'}, 'attr': 'end', 'new': 1.9336328046224913}], 'references': []}
Traceback (most recent call last):
File "/home/zreszela/miniconda/envs/jup-bokeh/lib/python3.7/site-packages/bokeh/server/views/ws.py", line 236, in on_message
await self._schedule(work)
File "/home/zreszela/miniconda/envs/jup-bokeh/lib/python3.7/site-packages/bokeh/server/views/ws.py", line 308, in _schedule
await self.send_message(work)
File "/home/zreszela/miniconda/envs/jup-bokeh/lib/python3.7/site-packages/bokeh/server/views/ws.py", line 263, in send_message
await message.send(self)
File "/home/zreszela/miniconda/envs/jup-bokeh/lib/python3.7/site-packages/bokeh/protocol/message.py", line 259, in send
await conn.write_message(self.header_json, locked=False)
File "/home/zreszela/miniconda/envs/jup-bokeh/lib/python3.7/site-packages/bokeh/server/views/ws.py", line 278, in write_message
await super().write_message(message, binary)
File "/home/zreszela/miniconda/envs/jup-bokeh/lib/python3.7/site-packages/tornado/websocket.py", line 342, in write_message
return self.ws_connection.write_message(message, binary=binary)
File "/home/zreszela/miniconda/envs/jup-bokeh/lib/python3.7/site-packages/tornado/websocket.py", line 1098, in write_message
fut = self._write_frame(True, opcode, message, flags=flags)
File "/home/zreszela/miniconda/envs/jup-bokeh/lib/python3.7/site-packages/tornado/websocket.py", line 1075, in _write_frame
return self.stream.write(frame)
File "/home/zreszela/miniconda/envs/jup-bokeh/lib/python3.7/site-packages/tornado/iostream.py", line 559, in write
self._handle_write()
File "/home/zreszela/miniconda/envs/jup-bokeh/lib/python3.7/site-packages/tornado/iostream.py", line 991, in _handle_write
self._write_buffer.advance(num_bytes)
File "/home/zreszela/miniconda/envs/jup-bokeh/lib/python3.7/site-packages/tornado/iostream.py", line 202, in advance
assert 0 < size <= self._size
AssertionError
ERROR:bokeh.server.views.ws:Bokeh Server internal error: server failed to handle a message, closing connection
It would be great if you could try it as well.
Cheers!