jupyterhub / jupyter-server-proxy

Jupyter notebook server extension to proxy web services.
https://jupyter-server-proxy.readthedocs.io
BSD 3-Clause "New" or "Revised" License
354 stars 147 forks source link

Bokeh 2.0 issue persisting #194

Open thvasilo opened 4 years ago

thvasilo commented 4 years ago

Related to PR #180, issue #179

Hello @xhochy , I just tried serving a panel application through jupyter-server-proxy on a SageMaker instance (Tornado 6.0.4, jupyter-server-proxy 1.3.2, panel 0.9.5, bokeh 2.0.2) but I got the same error that the linked PR was fixing:

sh-4.2$ panel serve gallery/simple/iris_kmeans.ipynb
2020-05-04 23:30:38,708 Starting Bokeh server version 2.0.2 (running on Tornado 6.0.4)
2020-05-04 23:30:38,709 User authentication hooks NOT provided (default user enabled)
2020-05-04 23:30:38,712 Bokeh app running at: http://localhost:5006/iris_kmeans
2020-05-04 23:30:38,712 Starting Bokeh server with process id: 5175
2020-05-04 23:30:51,541 WebSocket connection opened
2020-05-04 23:30:51,542 Uncaught exception GET /iris_kmeans/ws (127.0.0.1)
HTTPServerRequest(protocol='http', host='<IP.REDACTED>:8443', method='GET', uri='/iris_kmeans/ws', version='HTTP/1.1', remote_ip='127.0.0.1')
Traceback (most recent call last):
  File "/home/ec2-user/anaconda3/envs/python3/lib/python3.6/site-packages/tornado/websocket.py", line 956, in _accept_connection
    open_result = handler.open(*handler.open_args, **handler.open_kwargs)
  File "/home/ec2-user/anaconda3/envs/python3/lib/python3.6/site-packages/bokeh/server/views/ws.py", line 123, in open
    raise ProtocolError("Subprotocol header is not 'bokeh'")
bokeh.protocol.exceptions.ProtocolError: Subprotocol header is not 'bokeh'

Any ideas on what the cause might be and how to fix?

thvasilo commented 4 years ago

Note that serving the same exact notebook through Voila works, but the interactive aspect of the webapp breaks (i.e. changing values/sliders in the interface has no effect on the output).

So I'm curious as to why Bokeh Server insists on the subprotocol header being bokeh, maybe I should report over there?

xhochy commented 4 years ago

Can you try running this locally without SageMaker? It could be that SageMaker itself does some proxying that breaks this too.

thvasilo commented 4 years ago

Locally this seems to work.

What I did:

Any ideas on what I could look into for SageMaker. What could be interfering in such a particular way, changing the subprotocol header?

evanfwelch commented 4 years ago

Also having this exact issue still in SageMaker notebooks despite the fixes to jupyter-server-proxy... any ideas for debugging?