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

Kernel not available not captured -> Error 500 #261

Closed
wolfv opened this issue Jun 19, 2019 · 5 comments
Closed

Kernel not available not captured -> Error 500 #261

wolfv opened this issue Jun 19, 2019 · 5 comments

Comments

@wolfv
Copy link
Member

wolfv commented Jun 19, 2019

I just accidentally pressed the voila button on a Python 2 notebook and don't have a Python 2 Kernel installed. That resulted in a ugly 500.
Maybe we can catch the exception and report something nicer?

[E 02:25:44.467 LabApp] Uncaught exception GET /voila/render/examples/notebooks/ROS%203D%20Grid.ipynb (172.17.0.1)
    HTTPServerRequest(protocol='http', host='localhost:1234', method='GET', uri='/voila/render/examples/notebooks/ROS%203D%20Grid.ipynb', version='HTTP/1.1', remote_ip='172.17.0.1')
    Traceback (most recent call last):
      File "/usr/local/lib/python3.5/dist-packages/tornado/web.py", line 1699, in _execute
        result = await result
      File "/usr/lib/python3.5/asyncio/futures.py", line 363, in __iter__
        return self.result()  # May raise too.
      File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
        raise self._exception
      File "/usr/local/lib/python3.5/dist-packages/tornado/gen.py", line 736, in run
        yielded = self.gen.throw(*exc_info)  # type: ignore
      File "/usr/local/lib/python3.5/dist-packages/voila/handler.py", line 56, in get
        kernel_id = yield tornado.gen.maybe_future(self.kernel_manager.start_kernel(kernel_name=kernel_name, path=cwd))
      File "/usr/local/lib/python3.5/dist-packages/tornado/gen.py", line 729, in run
        value = future.result()
      File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
        raise self._exception
      File "/usr/local/lib/python3.5/dist-packages/tornado/gen.py", line 209, in wrapper
        yielded = next(result)
      File "/usr/local/lib/python3.5/dist-packages/notebook/services/kernels/kernelmanager.py", line 160, in start_kernel
        super(MappingKernelManager, self).start_kernel(**kwargs)
      File "/usr/local/lib/python3.5/dist-packages/jupyter_client/multikernelmanager.py", line 110, in start_kernel
        km.start_kernel(**kwargs)
      File "/usr/local/lib/python3.5/dist-packages/jupyter_client/manager.py", line 246, in start_kernel
        kernel_cmd = self.format_kernel_cmd(extra_arguments=extra_arguments)
      File "/usr/local/lib/python3.5/dist-packages/jupyter_client/manager.py", line 170, in format_kernel_cmd
        cmd = self.kernel_spec.argv + extra_arguments
      File "/usr/local/lib/python3.5/dist-packages/jupyter_client/manager.py", line 82, in kernel_spec
        self._kernel_spec = self.kernel_spec_manager.get_kernel_spec(self.kernel_name)
      File "/usr/local/lib/python3.5/dist-packages/jupyter_client/kernelspec.py", line 236, in get_kernel_spec
        raise NoSuchKernel(kernel_name)
    jupyter_client.kernelspec.NoSuchKernel: No such kernel named python2
[E 02:25:44.589 LabApp] {
      "Accept-Language": "en,en-US;q=0.9,de;q=0.8,es;q=0.7,fr;q=0.6",
      "Upgrade-Insecure-Requests": "1",
      "Dnt": "1",
      "Connection": "keep-alive",
      "Accept-Encoding": "gzip, deflate, br",
      "User-Agent": "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.90 Safari/537.36",
      "Cookie": "_xsrf=2|e3d48a54|9df6b536dd80ab997fdfcb68cfaf1597|1516263768; org.cups.sid=3987dbf3d88f88015acc753740791e03; _ga=GA1.1.375891167.1516910868; host=.butterfly; TWISTED_SESSION=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2luZm8iOnsiYW5vbnltb3VzIjp0cnVlfSwiZXhwIjoxNTI3NzAzNDAxfQ.MLpNPRrGKOREpEx8-tiVDMuDWpYJ_gvLIL1QjzD5LG0; username-localhost-8890=\"2|1:0|10:1559647541|23:username-localhost-8890|44:N2ZmODc1OWQ1YzIxNGI3ZGE0YzdmMzlkOTUzYmIxNjQ=|05c989f0917e21e7d152e977c335ed2c3a43f182514be38b767c086d9d309975\"; username-localhost-8889=\"2|1:0|10:1560354246|23:username-localhost-8889|44:ODBmYTFkOWQ1ZGVkNGU1MGEwYjM2OThiM2NiYjI2MTM=|910b7e34253f71a316be8292c75c9c1110b27783760348fbc29670b58d233ce6\"; username-localhost-8888=\"2|1:0|10:1560417646|23:username-localhost-8888|44:ZTQ5ODAwYjU1YWMxNDAxODg4NGQ3ZTBmZjE0NjE3YTM=|18752bc255147a1b40c54bddf3d7af7fae56f6c4f9bafc6c917c56b4bd83d951\"; mjx.latest=2.7.5",
      "Referer": "http://localhost:1234/lab/workspaces/shsh",
      "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3",
      "Host": "localhost:1234"
    }
@wolfv
Copy link
Member Author

wolfv commented Jun 19, 2019

also this wouldn't have happened if the voila button automatically saves the notebook :)

@SylvainCorlay
Copy link
Member

Thanks! I think I should close as a duplicate of #259

@wolfv
Copy link
Member Author

wolfv commented Jun 19, 2019

Sure

@maartenbreddels
Copy link
Member

also this wouldn't have happened if the voila button automatically saves the notebook :)

indeed, totally agree #257

@jtpio
Copy link
Member

jtpio commented Jun 19, 2019

also this wouldn't have happened if the voila button automatically saves the notebook :)

Will be fixed in #262 :)

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

4 participants