jupyter-server-proxy: NoneType can't be used in 'await' expression - May be harmless
Ran into the following traceback when using dask-labextension with jupyter-server-proxy. This occurred with Tornado 6, but went away with Tornado 5. Am using JupyterLab 0.35.4, dask-labextension 0.3.1, Bokeh 1.0.4, and jupyter-server-proxy 1.0.0.
LabApp - ERROR - Uncaught exception GET /proxy/9100/status (10.110.73.60)
HTTPServerRequest(protocol='http', host='10.31.241.45:9999', method='GET', uri='/proxy/9100/status', version='HTTP/1.1', remote_ip='10.110.73.60')
Traceback (most recent call last):
File "/home/nfs/jkirkham/miniconda/envs/rapidsdev37/lib/python3.7/site-packages/tornado/web.py", line 1699, in _execute
result = await result
File "/home/nfs/jkirkham/miniconda/envs/rapidsdev37/lib/python3.7/site-packages/jupyter_server_proxy/websocket.py", line 87, in get
return await self.http_get(*args, **kwargs)
File "/home/nfs/jkirkham/miniconda/envs/rapidsdev37/lib/python3.7/site-packages/jupyter_server_proxy/handlers.py", line 247, in http_get
return await self.proxy(port, proxy_path)
TypeError: object NoneType can't be used in 'await' expression
LabApp - ERROR - Uncaught exception GET /proxy/9100/status (10.110.73.60)
HTTPServerRequest(protocol='http', host='10.31.241.45:9999', method='GET', uri='/proxy/9100/status', version='HTTP/1.1', remote_ip='10.110.73.60')
Traceback (most recent call last):
File "/home/nfs/jkirkham/miniconda/envs/rapidsdev37/lib/python3.7/site-packages/tornado/web.py", line 1699, in _execute
result = await result
File "/home/nfs/jkirkham/miniconda/envs/rapidsdev37/lib/python3.7/site-packages/jupyter_server_proxy/websocket.py", line 87, in get
return await self.http_get(*args, **kwargs)
File "/home/nfs/jkirkham/miniconda/envs/rapidsdev37/lib/python3.7/site-packages/jupyter_server_proxy/handlers.py", line 247, in http_get
return await self.proxy(port, proxy_path)
TypeError: object NoneType can't be used in 'await' expression
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 15 (9 by maintainers)
Running
code-serverwithtornado==6.0.4,jupyter-server-proxy==1.5.0,jupyterlab==2.1.1, andjupyterlab_server==1.1.1I periodically encounter the following, which refers to this line ofhandlers.py:I considered bundling a fix in https://github.com/jupyterhub/jupyter-server-proxy/pull/209 but it was way too complicated already.
I haven’t understood #239 yet but, ignoring testing issues, and if I remember correctly, to solve this issue one simply needs to add checks to all await statements that one isn’t awaiting
None. My solution was to write a helper function, something along the lines ofand then replace most
awaitcalls with this. (Disclaimer: I’m writing from memory and that’s not tested.)However, I’m not an
asyncioexpert (yet), and I don’t know if there’s a more elegant way.Okay, nevermind- this works! I realized my dask-yarn was starting in remote mode instead of local mode and I think that was the issue.