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

Delete Terminal Not Working with Tornado version 6.0.1 #62

Closed
cpranav opened this issue Mar 14, 2019 · 2 comments
Closed

Delete Terminal Not Working with Tornado version 6.0.1 #62

cpranav opened this issue Mar 14, 2019 · 2 comments

Comments

@cpranav
Copy link

cpranav commented Mar 14, 2019

Delete Terminal call is throwing 500 from Jupyter Server. Below is the stacktrace,

[E 21:50:25.879 NotebookApp] Uncaught exception DELETE /api/terminals/1 (10.0.1.74)
    HTTPServerRequest(protocol='https', host='10.0.94.86:8443', method='DELETE', uri='/api/terminals/1', version='HTTP/1.1', remote_ip='10.0.1.74')
    Traceback (most recent call last):
      File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/tornado/web.py", line 1699, in _execute
        result = await result
      File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/tornado/gen.py", line 736, in run
        yielded = self.gen.throw(*exc_info)  # type: ignore
      File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/notebook/terminal/api_handlers.py",line 36, in delete
        yield tm.terminate(name, force=True)
      File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/tornado/gen.py", line 729, in run
        value = future.result()
      File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/tornado/gen.py", line 736, in run
        yielded = self.gen.throw(*exc_info)  # type: ignore
      File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/terminado/management.py", line 333,in terminate
        yield term.terminate(force=force)
      File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/tornado/gen.py", line 729, in run
        value = future.result()
      File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/tornado/gen.py", line 209, in wrapper
        yielded = next(result)
      File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/terminado/management.py", line 96, in terminate
        yield sleep()
      File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/terminado/management.py", line 89, in <lambda>
        sleep = lambda : gen.Task(loop.add_timeout, loop.time() + self.ptyproc.delayafterterminate)
    AttributeError: module 'tornado.gen' has no attribute 'Task'
[W 21:50:26.118 NotebookApp] Unhandled error
[E 21:50:26.118 NotebookApp] {

After browsing through Jupyter issues directory I could find similar issue with Tornado related to Jupyter and was addressed in jupyter/notebook#4439 though it doesn't address Terminal issue. PR for the Jupyter fix for reference, jupyter/notebook@d17caf9

I think we need to make a similar fix in
https://github.com/jupyter/terminado/blob/master/terminado/management.py#L89

cpranav pushed a commit to cpranav/terminado that referenced this issue Mar 15, 2019
Jupyter brings in latest tornado version 6.0.1 and it breaks Jupyter Terminal due to removing
of gen.Task in earlier version, https://www.tornadoweb.org/en/stable/releases/v6.0.0.html
takluyver added a commit that referenced this issue Mar 18, 2019
@cpranav
Copy link
Author

cpranav commented Mar 18, 2019

Thanks @takluyver . Do you know when would be the new version of terminado plan to be release which would pick up the fix for this bug?

@blink1073
Copy link
Member

0.8.2 is released with the fix.

clrpackages pushed a commit to clearlinux-pkgs/terminado that referenced this issue Apr 5, 2019
Chiplunkar (1):
      Fix for jupyter/terminado#62

Hugo (3):
      Add python_requires to help pip, and version classifers
      Remove x.y classifiers
      Correct field name

Steven Silvester (2):
      Run only the basic test on Appveyor
      Bump to 0.8.2

Thomas Kluyver (1):
      Set websocket.terminal to None when the child exits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants