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

(zmqhandlers.py) RuntimeWarning: coroutine 'WebSocketHandler.get' was never awaited #4437

Closed
convoliution opened this issue Mar 1, 2019 · 11 comments · Fixed by #4449
Closed

Comments

@convoliution
Copy link

convoliution commented Mar 1, 2019

Attempting to connect to a kernel results in this error being thrown, in a fresh install of the jupyter pip package.

Based on this StackOverflow post and the fact that Tornado released a new major version two hours ago, I believe this is a compatibility issue with Tornado v6.0

Manually reverting to Tornado v5.1.1 resolved this issue, but Jupyter should be updated or its dependency requirement changed.

@convoliution convoliution changed the title zmqhandlers.py: RuntimeWarning: coroutine 'WebSocketHandler.get' was never awaited (zmqhandlers.py) RuntimeWarning: coroutine 'WebSocketHandler.get' was never awaited Mar 1, 2019
@kevin-bates
Copy link
Member

Could you please provide Traceback information relative to this issue? The message implies it would be something the caller failed to do. So I think we need to drill down a bit.

This sounds more sinister than the previous incompatibility introduced by a Tornado release.

@convoliution
Copy link
Author

Not sure if this is what you mean, but this is the Notebook server's entire output in my terminal:

[I 09:11:05.940 NotebookApp] Serving notebooks from local directory: [REDACTED]
[I 09:11:05.940 NotebookApp] The Jupyter Notebook is running at:
[I 09:11:05.940 NotebookApp] http://localhost:8888/
[I 09:11:05.940 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 09:11:49.436 NotebookApp] Kernel started: 6c8f3e7c-fcb1-48e4-be95-91baa14f99d3
[I 09:11:50.886 NotebookApp] Adapting to protocol v5.1 for kernel 6c8f3e7c-fcb1-48e4-be95-91baa14f99d3
[REDACTED]/venv/lib/python3.6/site-packages/notebook/base/zmqhandlers.py:284: RuntimeWarning: coroutine 'WebSocketHandler.get' was never awaited
  super(AuthenticatedZMQStreamHandler, self).get(*args, **kwargs)
[W 09:11:51.924 NotebookApp] Replacing stale connection: 6c8f3e7c-fcb1-48e4-be95-91baa14f99d3:ad37ee996ad749368d8745648c8af729
^C[I 09:12:29.162 NotebookApp] interrupted

@zlargon
Copy link

zlargon commented Mar 1, 2019

I run the command pip install "tornado<6" to fix the issue.

I also meet the same issue. My jupyter notebook could work yesterday but doesn't work this morning.
I use the virtualenv as package manager, and here is the difference between the package dependencies:

  • jsonschema: 3.0.0 -> 3.0.1
  • tornado: 5.1.1 -> 6.0
packages work fine not work
appnope 0.1.0 0.1.0
attrs 18.2.0 18.2.0
backcall 0.1.0 0.1.0
bleach 3.1.0 3.1.0
certifi 2018.11.29 2018.11.29
chardet 3.0.4 3.0.4
decorator 4.3.2 4.3.2
defusedxml 0.5.0 0.5.0
entrypoints 0.3 0.3
facebook-sdk 3.1.0 3.1.0
idna 2.8 2.8
ipykernel 5.1.0 5.1.0
ipython 7.3.0 7.3.0
ipython-genutils 0.2.0 0.2.0
ipywidgets 7.4.2 7.4.2
jedi 0.13.3 0.13.3
Jinja2 2.10 2.10
* jsonschema * 3.0.0 * 3.0.1
jupyter 1.0.0 1.0.0
jupyter-client 5.2.4 5.2.4
jupyter-console 6.0.0 6.0.0
jupyter-core 4.4.0 4.4.0
MarkupSafe 1.1.1 1.1.1
mistune 0.8.4 0.8.4
nbconvert 5.4.1 5.4.1
nbformat 4.4.0 4.4.0
notebook 5.7.4 5.7.4
pandocfilters 1.4.2 1.4.2
parso 0.3.4 0.3.4
pexpect 4.6.0 4.6.0
pickleshare 0.7.5 0.7.5
pip 19.0.3 19.0.3
prometheus-client 0.6.0 0.6.0
prompt-toolkit 2.0.9 2.0.9
ptyprocess 0.6.0 0.6.0
Pygments 2.3.1 2.3.1
pyrsistent 0.14.11 0.14.11
python-dateutil 2.8.0 2.8.0
pyzmq 18.0.0 18.0.0
qtconsole 4.4.3 4.4.3
requests 2.21.0 2.21.0
Send2Trash 1.5.0 1.5.0
setuptools 40.8.0 40.8.0
six 1.12.0 1.12.0
terminado 0.8.1 0.8.1
testpath 0.4.2 0.4.2
* tornado * 5.1.1 * 6.0
traitlets 4.3.2 4.3.2
urllib3 1.24.1 1.24.1
wcwidth 0.1.7 0.1.7
webencodings 0.5.1 0.5.1
wheel 0.33.1 0.33.1
widgetsnbextension 3.4.2 3.4.2

@mars-f
Copy link

mars-f commented Mar 1, 2019

I got my notebook to connect by downgrading tornado from 6.0.0 to 5.1.1:

$ pipenv install "tornado<6"
$ pipenv run pip freeze |grep tornado
tornado==5.1.1

@kevin-bates
Copy link
Member

RuntimeWarning: coroutine 'WebSocketHandler.get' was never awaited
 super(AuthenticatedZMQStreamHandler, self).get(*args, **kwargs)

@convoliution - yes this is helpful. I believe the call to the superclass needs an await. I can take a peek at this.

However, I suspect this is one of those tip of the iceberg things - and we might be better off capping tornado < 6.0 if it turns into a slippery slope. Sorry, I can't refuse a cliche when it's there. 😄

@kevin-bates
Copy link
Member

I should have looked at the code prior to my response. Turns out @takluyver added a yield via #4392. In addition, Thomas capped tornado < 6 in early January.

That said, when I run the master tip with tornado 6, I still see issues - different from above.

Since it doesn't appear these changes are in any releases, I suspect it would be good to build a release that caps tornado.

cc: @minrk

@chansen2000
Copy link

a good way!valid

I run the command pip install 'tornado<6' to fix the issue.

@zxh126
Copy link

zxh126 commented Mar 4, 2019

I run the command pip install tornado==5.1.1 to fix the issue.
but who kowns why?

@minrk
Copy link
Member

minrk commented Mar 5, 2019

Merging with #4439

@minrk minrk closed this as completed Mar 5, 2019
michaellass added a commit to michaellass/macports-ports that referenced this issue Mar 7, 2019
This fixes compatibility with py-tornado 6. See:
jupyter/notebook#4439
jupyter/notebook#4437
stromnov pushed a commit to macports/macports-ports that referenced this issue Mar 7, 2019
This fixes compatibility with py-tornado 6. See:
jupyter/notebook#4439
jupyter/notebook#4437
@drishyamlabs
Copy link

This command worked for me:

pip install 'tornado<6'

@verata-veritatis
Copy link

Unfortunately, I use packages that require the most up-to-date tornado. Jupyter should consider updating.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants