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

Created on 1 Mar 2019  路  11Comments  路  Source: jupyter/notebook

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.

Most helpful comment

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

All 11 comments

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.

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

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 |

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
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. :smile:

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

a good way锛乿alid

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

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

Merging with #4439

This command worked for me:

pip install 'tornado<6'

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jonatanblue picture jonatanblue  路  3Comments

ehossain1982 picture ehossain1982  路  3Comments

mikepqr picture mikepqr  路  3Comments

md-jamal picture md-jamal  路  3Comments

arbaazsama picture arbaazsama  路  3Comments