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

Jupyter Terminal Crashing by Itself #5363

Open
saurabhheda opened this issue Apr 10, 2020 · 8 comments
Open

Jupyter Terminal Crashing by Itself #5363

saurabhheda opened this issue Apr 10, 2020 · 8 comments

Comments

@saurabhheda
Copy link

Hi,
To Launch Jupyter Notebook I simply start the server by clicking on Jupyter Notebook app. This starts the server which is listening on http://localhost:888 port.

Uptill here everything is fine but my problem is that my terminal gets closed abruptly in some time and there is no finite behavior or time duration within it gets terminated.

Sometimes it does not terminate so early and sometimes in an hour or so.

@kevin-bates
Copy link
Member

Hi @saurabhheda - this sounds frustrating.

I simply start the server by clicking on Jupyter Notebook app

Is this a Windows platform?
Could you please provide the output of jupyter --version?

Is there any correlation between the notebook server console terminating and what you might be doing within a given notebook?

You might try opening a terminal, then manually enter jupyter notebook. If the notebook server is crashing, perhaps the window/console will remain open despite the process's termination. If this occurs, it would be great if you couple capture the contents of that console window.

Thanks.

@saurabhheda
Copy link
Author

@kevin-bates Thanks for your response.
Yes this is windows platform.

Output of jupyter --version
jupyter core : 4.6.3
jupyter-notebook : 6.0.3
qtconsole : not installed
ipython : 7.13.0
ipykernel : 5.2.0
jupyter client : 6.1.2
jupyter lab : not installed
nbconvert : 5.6.1
ipywidgets : 7.5.1
nbformat : 5.0.5
traitlets : 4.3.3

Once the console windows gets terminated I get disconnected from the kernel and everything I work on the notebook lost (executable code)

@kevin-bates
Copy link
Member

@saurabhheda - thank you for the response - it looks like you're using current versions - good.

The behavior you are experiencing is precisely the expected behavior when the notebook server is terminated - all active kernels are shutdown, etc. So we need to figure out why that is happening.

Could you answer this question...

Is there any correlation between the notebook server console terminating and what you might be doing within a given notebook?

And perhaps try this experiment...

You might try opening a terminal, then manually enter jupyter notebook --debug. If the notebook server is crashing, perhaps the window/console will remain open despite the process's termination. If this occurs, it would be great if you could capture the contents of that console window.

@maffei2443
Copy link

@kevin-bates

I guess I have the same problem. Here goes the output as you asked

PS C:\Users\myuser> jupyter notebook --debug
[D 11:10:13.437 NotebookApp] Searching ['C:\\Users\\myuser', 'C:\\Users\\myuser\\.jupyter', 'C:\\Users\\myuser\\AppData\\Roaming\\Python\\etc\\jupyter', 'C:\\Users\\myuser\\AppData\\Local\\Programs\\Python\\Python310\\etc\\jupyter', 'C:\\ProgramData\\jupyter'] for config files
[D 11:10:13.442 NotebookApp] Looking for jupyter_config in C:\ProgramData\jupyter
[D 11:10:13.442 NotebookApp] Looking for jupyter_config in C:\Users\myuser\AppData\Local\Programs\Python\Python310\etc\jupyter
[D 11:10:13.442 NotebookApp] Looking for jupyter_config in C:\Users\myuser\AppData\Roaming\Python\etc\jupyter
[D 11:10:13.442 NotebookApp] Looking for jupyter_config in C:\Users\myuser\.jupyter
[D 11:10:13.442 NotebookApp] Looking for jupyter_config in C:\Users\myuser
[D 11:10:13.442 NotebookApp] Looking for jupyter_notebook_config in C:\ProgramData\jupyter
[D 11:10:13.442 NotebookApp] Looking for jupyter_notebook_config in C:\Users\myuser\AppData\Local\Programs\Python\Python310\etc\jupyter
[D 11:10:13.442 NotebookApp] Looking for jupyter_notebook_config in C:\Users\myuser\AppData\Roaming\Python\etc\jupyter
[D 11:10:13.442 NotebookApp] Looking for jupyter_notebook_config in C:\Users\myuser\.jupyter
[D 11:10:13.442 NotebookApp] Looking for jupyter_notebook_config in C:\Users\myuser
[D 11:10:13.442 NotebookApp] Ignoring min_open_files_limit because the limit cannot be adjusted (for example, on Windows)
[D 11:10:13.447 NotebookApp] Paths used for configuration of jupyter_notebook_config:
        C:\ProgramData\jupyter\jupyter_notebook_config.json
[D 11:10:13.447 NotebookApp] Paths used for configuration of jupyter_notebook_config:
        C:\Users\myuser\AppData\Local\Programs\Python\Python310\etc\jupyter\jupyter_notebook_config.json
[D 11:10:13.447 NotebookApp] Paths used for configuration of jupyter_notebook_config:
        C:\Users\myuser\AppData\Roaming\Python\etc\jupyter\jupyter_notebook_config.json
[D 11:10:13.447 NotebookApp] Paths used for configuration of jupyter_notebook_config:
        C:\Users\myuser\.jupyter\jupyter_notebook_config.json
[I 11:10:14.052 NotebookApp] Serving notebooks from local directory: C:\Users\myuser
[I 11:10:14.052 NotebookApp] Jupyter Notebook 6.4.11 is running at:
[I 11:10:14.052 NotebookApp] http://localhost:8888/?token=cc8c299ea1c9c1673ee0616bbccf9753d98f8425573a03a1
[I 11:10:14.052 NotebookApp]  or http://127.0.0.1:8888/?token=cc8c299ea1c9c1673ee0616bbccf9753d98f8425573a03a1
[I 11:10:14.052 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 11:10:14.133 NotebookApp]

    To access the notebook, open this file in a browser:
        file:///C:/Users/myuser/AppData/Roaming/jupyter/runtime/nbserver-18344-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=cc8c299ea1c9c1673ee0616bbccf9753d98f8425573a03a1
     or http://127.0.0.1:8888/?token=cc8c299ea1c9c1673ee0616bbccf9753d98f8425573a03a1
[D 11:10:15.540 NotebookApp] Accepting token-authenticated connection from ::1
[D 11:10:15.548 NotebookApp] Using contents: services/contents
[D 11:10:15.621 NotebookApp] Path base/images/favicon.ico served from C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\static\base\images\favicon.ico
[D 11:10:15.621 NotebookApp] Path components/jquery-ui/themes/smoothness/jquery-ui.min.css served from C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\static\components\jquery-ui\themes\smoothness\jquery-ui.min.css
[D 11:10:15.622 NotebookApp] Path components/jquery-typeahead/dist/jquery.typeahead.min.css served from C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\static\components\jquery-typeahead\dist\jquery.typeahead.min.css
[D 11:10:15.626 NotebookApp] Path style/style.min.css served from C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\static\style\style.min.css
[D 11:10:15.627 NotebookApp] Path components/es6-promise/promise.min.js served from C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\static\components\es6-promise\promise.min.js
[D 11:10:15.627 NotebookApp] Path components/react/react.production.min.js served from C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\static\components\react\react.production.min.js
[D 11:10:15.628 NotebookApp] Path components/react/react-dom.production.min.js served from C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\static\components\react\react-dom.production.min.js
[D 11:10:15.629 NotebookApp] Path components/create-react-class/index.js served from C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\static\components\create-react-class\index.js
[D 11:10:15.629 NotebookApp] Path components/requirejs/require.js served from C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\static\components\requirejs\require.js
[D 11:10:15.630 NotebookApp] Path base/images/logo.png served from C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\static\base\images\logo.png
[D 11:10:15.632 NotebookApp] Path tree/js/main.min.js served from C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\static\tree\js\main.min.js
[D 11:10:15.635 NotebookApp] 200 GET /tree?token=cc8c299ea1c9c1673ee0616bbccf9753d98f8425573a03a1 (::1) 95.940000ms
[D 11:10:15.692 NotebookApp] Path custom.css served from C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\static\custom\custom.css
[D 11:10:15.695 NotebookApp] 304 GET /custom/custom.css (::1) 4.550000ms
[D 11:10:15.771 NotebookApp] Path services\contents.js served from C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\static\services\contents.js
[D 11:10:15.772 NotebookApp] 200 GET /static/services/contents.js?v=20220520111013 (::1) 2.010000ms
[D 11:10:15.807 NotebookApp] Paths used for configuration of tree:
        C:\ProgramData\jupyter\nbconfig\tree.json
[D 11:10:15.810 NotebookApp] Paths used for configuration of tree:
        C:\Users\myuser\AppData\Local\Programs\Python\Python310\etc\jupyter\nbconfig\tree.json
[D 11:10:15.814 NotebookApp] Paths used for configuration of tree:
        C:\Users\myuser\AppData\Roaming\Python\etc\jupyter\nbconfig\tree.json
[D 11:10:15.817 NotebookApp] Paths used for configuration of tree:
        C:\Users\myuser\.jupyter\nbconfig\tree.json
[D 11:10:15.823 NotebookApp] 200 GET /api/config/tree?_=1653055815756 (::1) 17.000000ms
[D 11:10:15.832 NotebookApp] Paths used for configuration of common:
        C:\ProgramData\jupyter\nbconfig\common.json
[D 11:10:15.835 NotebookApp] Paths used for configuration of common:
        C:\Users\myuser\AppData\Local\Programs\Python\Python310\etc\jupyter\nbconfig\common.json
[D 11:10:15.837 NotebookApp] Paths used for configuration of common:
        C:\Users\myuser\AppData\Roaming\Python\etc\jupyter\nbconfig\common.json
[D 11:10:15.843 NotebookApp] Paths used for configuration of common:
        C:\Users\myuser\.jupyter\nbconfig\common.json
[D 11:10:15.850 NotebookApp] 200 GET /api/config/common?_=1653055815757 (::1) 22.000000ms
[D 11:10:15.855 NotebookApp] 200 GET /api/terminals?_=1653055815758 (::1) 4.010000ms
[D 11:10:15.860 NotebookApp] Found kernel python3 in C:\Users\myuser\AppData\Local\Programs\Python\Python310\share\jupyter\kernels
[D 11:10:16.187 NotebookApp] 304 GET /api/kernelspecs (::1) 334.830000ms
[D 11:10:16.188 NotebookApp] 200 GET /api/sessions?_=1653055815759 (::1) 333.850000ms
[D 11:10:16.190 NotebookApp] 200 GET /api/terminals?_=1653055815760 (::1) 335.850000ms
[D 11:10:16.196 NotebookApp] Path custom.js served from C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\static\custom\custom.js
[D 11:10:16.197 NotebookApp] 200 GET /custom/custom.js?v=20220520111013 (::1) 3.000000ms
[D 11:10:16.219 NotebookApp] 200 GET /api/contents?type=directory&_=1653055815761 (::1) 17.000000ms
[I 11:10:24.940 NotebookApp] Creating new notebook in
[D 11:10:24.977 NotebookApp] Saving C:\Users\myuser\Untitled1.ipynb
[D 11:10:25.177 NotebookApp] 201 POST /api/contents (::1) 238.310000ms
[D 11:10:25.188 NotebookApp] Using contents: services/contents
[D 11:10:25.228 NotebookApp] Path base/images/favicon-notebook.ico served from C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\static\base\images\favicon-notebook.ico
[D 11:10:25.229 NotebookApp] Path components/bootstrap-tour/build/css/bootstrap-tour.min.css served from C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\static\components\bootstrap-tour\build\css\bootstrap-tour.min.css
[D 11:10:25.230 NotebookApp] Path components/codemirror/lib/codemirror.css served from C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\static\components\codemirror\lib\codemirror.css
[D 11:10:25.234 NotebookApp] Path notebook/css/override.css served from C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\static\notebook\css\override.css
[D 11:10:25.884 NotebookApp] Path components/text-encoding/lib/encoding.js served from C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\static\components\text-encoding\lib\encoding.js
[D 11:10:25.886 NotebookApp] Path notebook/js/main.min.js served from C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\static\notebook\js\main.min.js
[D 11:10:25.892 NotebookApp] 200 GET /notebooks/Untitled1.ipynb?kernel_name=python3 (::1) 705.620000ms
[D 11:10:25.915 NotebookApp] Path components\MathJax\MathJax.js served from C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\static\components\MathJax\MathJax.js
[D 11:10:25.916 NotebookApp] 304 GET /static/components/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML-full,Safe&delayStartupUntil=configured (::1) 3.000000ms
[D 11:10:25.921 NotebookApp] 304 GET /custom/custom.css (::1) 1.990000ms
[D 11:10:25.979 NotebookApp] Path components\MathJax\config\TeX-AMS-MML_HTMLorMML-full.js served from C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\static\components\MathJax\config\TeX-AMS-MML_HTMLorMML-full.js
[D 11:10:25.980 NotebookApp] 304 GET /static/components/MathJax/config/TeX-AMS-MML_HTMLorMML-full.js?V=2.7.9 (::1) 2.000000ms
[D 11:10:26.048 NotebookApp] Path components\MathJax\config\Safe.js served from C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\static\components\MathJax\config\Safe.js
[D 11:10:26.050 NotebookApp] 304 GET /static/components/MathJax/config/Safe.js?V=2.7.9 (::1) 2.000000ms
[D 11:10:26.229 NotebookApp] Paths used for configuration of notebook:
        C:\ProgramData\jupyter\nbconfig\notebook.json
[D 11:10:26.231 NotebookApp] Paths used for configuration of notebook:
        C:\Users\myuser\AppData\Local\Programs\Python\Python310\etc\jupyter\nbconfig\notebook.d\widgetsnbextension.json
        C:\Users\myuser\AppData\Local\Programs\Python\Python310\etc\jupyter\nbconfig\notebook.json
[D 11:10:26.233 NotebookApp] Paths used for configuration of notebook:
        C:\Users\myuser\AppData\Roaming\Python\etc\jupyter\nbconfig\notebook.json
[D 11:10:26.236 NotebookApp] Paths used for configuration of notebook:
        C:\Users\myuser\.jupyter\nbconfig\notebook.json
[D 11:10:26.237 NotebookApp] 200 GET /api/config/notebook?_=1653055826027 (::1) 9.000000ms
[D 11:10:26.243 NotebookApp] Paths used for configuration of common:
        C:\ProgramData\jupyter\nbconfig\common.json
[D 11:10:26.246 NotebookApp] Paths used for configuration of common:
        C:\Users\myuser\AppData\Local\Programs\Python\Python310\etc\jupyter\nbconfig\common.json
[D 11:10:26.247 NotebookApp] Paths used for configuration of common:
        C:\Users\myuser\AppData\Roaming\Python\etc\jupyter\nbconfig\common.json
[D 11:10:26.250 NotebookApp] Paths used for configuration of common:
        C:\Users\myuser\.jupyter\nbconfig\common.json
[D 11:10:26.250 NotebookApp] 200 GET /api/config/common?_=1653055826028 (::1) 9.960000ms
[D 11:10:26.261 NotebookApp] Path components\MathJax\extensions\TeX\newcommand.js served from C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\static\components\MathJax\extensions\TeX\newcommand.js
[D 11:10:26.262 NotebookApp] 304 GET /static/components/MathJax/extensions/TeX/newcommand.js?V=2.7.9 (::1) 3.000000ms
[D 11:10:26.265 NotebookApp] Path components\MathJax\extensions\TeX\begingroup.js served from C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\static\components\MathJax\extensions\TeX\begingroup.js
[D 11:10:26.266 NotebookApp] 304 GET /static/components/MathJax/extensions/TeX/begingroup.js?V=2.7.9 (::1) 3.000000ms
[D 11:10:26.269 NotebookApp] Path components\MathJax\extensions\MathML\content-mathml.js served from C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\static\components\MathJax\extensions\MathML\content-mathml.js
[D 11:10:26.270 NotebookApp] 304 GET /static/components/MathJax/extensions/MathML/content-mathml.js?V=2.7.9 (::1) 3.000000ms
[D 11:10:26.308 NotebookApp] Found kernel python3 in C:\Users\myuser\AppData\Local\Programs\Python\Python310\share\jupyter\kernels
[D 11:10:26.310 NotebookApp] 304 GET /api/kernelspecs (::1) 2.990000ms
[D 11:10:26.433 NotebookApp] 200 GET /api/contents/Untitled1.ipynb?type=notebook&_=1653055826029 (::1) 58.560000ms
[D 11:10:26.442 NotebookApp] Path components\MathJax\jax\output\HTML-CSS\fonts\STIX-Web\fontdata.js served from C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\static\components\MathJax\jax\output\HTML-CSS\fonts\STIX-Web\fontdata.js
[D 11:10:26.444 NotebookApp] 304 GET /static/components/MathJax/jax/output/HTML-CSS/fonts/STIX-Web/fontdata.js?V=2.7.9 (::1) 7.020000ms
[D 11:10:26.448 NotebookApp] Path jupyter-js-widgets\extension.js served from C:\Users\myuser\AppData\Local\Programs\Python\Python310\share\jupyter\nbextensions\jupyter-js-widgets\extension.js
[D 11:10:26.455 NotebookApp] 200 GET /nbextensions/jupyter-js-widgets/extension.js?v=20220520111013 (::1) 16.000000ms
[D 11:10:26.458 NotebookApp] 304 GET /custom/custom.js?v=20220520111013 (::1) 17.990000ms
[D 11:10:26.470 NotebookApp] Path components\MathJax\extensions\Safe.js served from C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\static\components\MathJax\extensions\Safe.js
[D 11:10:26.472 NotebookApp] 304 GET /static/components/MathJax/extensions/Safe.js?V=2.7.9 (::1) 4.020000ms
[D 11:10:26.549 NotebookApp] Instantiating kernel 'Python 3 (ipykernel)' with kernel provisioner: local-provisioner
[D 11:10:26.634 NotebookApp] Starting kernel: ['C:\\Users\\myuser\\AppData\\Local\\Programs\\Python\\Python310\\python.exe', '-m', 'ipykernel_launcher', '-f', 'C:\\Users\\myuser\\AppData\\Roaming\\jupyter\\runtime\\kernel-4d3a7a9c-5e0e-47cb-990d-c42e5c573818.json']
[D 11:10:26.655 NotebookApp] 200 GET /api/contents/Untitled1.ipynb/checkpoints?_=1653055826030 (::1) 20.010000ms
[D 11:10:26.658 NotebookApp] Connecting to: tcp://127.0.0.1:51224
[D 11:10:26.667 NotebookApp] Connecting to: tcp://127.0.0.1:51221
[I 11:10:26.672 NotebookApp] Kernel started: 4d3a7a9c-5e0e-47cb-990d-c42e5c573818, name: python3
[D 11:10:26.672 NotebookApp] Kernel args: {'kernel_name': 'python3', 'cwd': 'C:\\Users\\myuser'}
[D 11:10:26.676 NotebookApp] 201 POST /api/sessions (::1) 142.020000ms
[D 11:10:26.715 NotebookApp] Initializing websocket connection /api/kernels/4d3a7a9c-5e0e-47cb-990d-c42e5c573818/channels
[D 11:10:26.720 NotebookApp] Requesting kernel info from 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:10:26.722 NotebookApp] Connecting to: tcp://127.0.0.1:51220
Exception in thread IOPub:
Traceback (most recent call last):
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1009, in _bootstrap_inner
    self.run()
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\threading.py", line 946, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\ipykernel\iostream.py", line 82, in _thread_main
    self.io_loop.start()
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\tornado\platform\asyncio.py", line 199, in start
    self.asyncio_loop.run_forever()
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 600, in run_forever
    self._run_once()
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1860, in _run_once
    event_list = self._selector.select(timeout)
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\selectors.py", line 324, in select
    r, w, _ = self._select(self._readers, self._writers, [], timeout)
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\selectors.py", line 315, in _select
    r, w, x = select.select(r, w, w, timeout)
OSError: [WinError 10038] An operation was attempted on something that is not a socket
Traceback (most recent call last):
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\ipykernel_launcher.py", line 17, in <module>
    app.launch_new_instance()
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\traitlets\config\application.py", line 846, in launch_instance
    app.start()
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\ipykernel\kernelapp.py", line 699, in start
    self.kernel.start()
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\ipykernel\ipkernel.py", line 184, in start
    super().start()
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\ipykernel\kernelbase.py", line 544, in start
    asyncio.run_coroutine_threadsafe(self.poll_control_queue(), control_loop.asyncio_loop)
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\asyncio\tasks.py", line 885, in run_coroutine_threadsafe
    loop.call_soon_threadsafe(callback)
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 795, in call_soon_threadsafe
    self._check_closed()
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 515, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
[W 11:11:26.727 NotebookApp] Timeout waiting for kernel_info reply from 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:26.729 NotebookApp] 101 GET /api/kernels/4d3a7a9c-5e0e-47cb-990d-c42e5c573818/channels?session_id=1963828bff0545ae834ff4058d318eed (::1) 60014.660000ms
[D 11:11:26.729 NotebookApp] Opening websocket /api/kernels/4d3a7a9c-5e0e-47cb-990d-c42e5c573818/channels
[D 11:11:26.729 NotebookApp] Getting buffer for 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:26.729 NotebookApp] Connecting to: tcp://127.0.0.1:51221
[D 11:11:26.732 NotebookApp] Connecting to: tcp://127.0.0.1:51220
[D 11:11:26.735 NotebookApp] Connecting to: tcp://127.0.0.1:51224
[D 11:11:26.738 NotebookApp] Connecting to: tcp://127.0.0.1:51222
[D 11:11:26.741 NotebookApp] Connecting to: tcp://127.0.0.1:51220
[D 11:11:26.743 NotebookApp] Connecting to: tcp://127.0.0.1:51224
[D 11:11:26.753 NotebookApp] Nudge: attempt 1 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:27.254 NotebookApp] Nudge: attempt 2 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:27.765 NotebookApp] Nudge: attempt 3 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:28.277 NotebookApp] Nudge: attempt 4 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:28.782 NotebookApp] Nudge: attempt 5 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:29.308 NotebookApp] Nudge: attempt 6 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:29.808 NotebookApp] Nudge: attempt 7 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:30.311 NotebookApp] Nudge: attempt 8 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:30.820 NotebookApp] Nudge: attempt 9 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[W 11:11:31.329 NotebookApp] Nudge: attempt 10 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:31.831 NotebookApp] Nudge: attempt 11 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:32.344 NotebookApp] Nudge: attempt 12 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:32.856 NotebookApp] Nudge: attempt 13 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:33.357 NotebookApp] Nudge: attempt 14 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:33.866 NotebookApp] Nudge: attempt 15 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:34.375 NotebookApp] Nudge: attempt 16 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:34.877 NotebookApp] Nudge: attempt 17 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:35.391 NotebookApp] Nudge: attempt 18 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:35.898 NotebookApp] Nudge: attempt 19 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[W 11:11:36.401 NotebookApp] Nudge: attempt 20 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:36.905 NotebookApp] Nudge: attempt 21 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:37.412 NotebookApp] Nudge: attempt 22 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:37.920 NotebookApp] Nudge: attempt 23 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:38.428 NotebookApp] Nudge: attempt 24 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:38.944 NotebookApp] Nudge: attempt 25 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:39.456 NotebookApp] Nudge: attempt 26 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:39.962 NotebookApp] Nudge: attempt 27 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:40.465 NotebookApp] Nudge: attempt 28 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:40.968 NotebookApp] Nudge: attempt 29 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[W 11:11:41.480 NotebookApp] Nudge: attempt 30 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:41.981 NotebookApp] Nudge: attempt 31 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:42.496 NotebookApp] Nudge: attempt 32 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:43.001 NotebookApp] Nudge: attempt 33 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:43.510 NotebookApp] Nudge: attempt 34 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:44.023 NotebookApp] Nudge: attempt 35 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:44.527 NotebookApp] Nudge: attempt 36 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:45.027 NotebookApp] Nudge: attempt 37 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:45.535 NotebookApp] Nudge: attempt 38 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:46.044 NotebookApp] Nudge: attempt 39 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[W 11:11:46.550 NotebookApp] Nudge: attempt 40 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:47.057 NotebookApp] Nudge: attempt 41 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:47.561 NotebookApp] Nudge: attempt 42 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:48.056 NotebookApp] Nudge: attempt 43 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:48.560 NotebookApp] Nudge: attempt 44 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:49.075 NotebookApp] Nudge: attempt 45 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:49.575 NotebookApp] Nudge: attempt 46 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:50.079 NotebookApp] Nudge: attempt 47 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:50.583 NotebookApp] Nudge: attempt 48 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:51.094 NotebookApp] Nudge: attempt 49 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[W 11:11:55.642 NotebookApp] Nudge: attempt 50 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:56.142 NotebookApp] Nudge: attempt 51 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:56.658 NotebookApp] Nudge: attempt 52 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:57.173 NotebookApp] Nudge: attempt 53 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[D 11:11:57.687 NotebookApp] Nudge: attempt 54 on kernel 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[I 11:11:58.201 NotebookApp] Interrupted...
[I 11:11:58.202 NotebookApp] Shutting down 1 kernel
[D 11:11:58.204 NotebookApp] Clearing buffer for 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
[I 11:11:58.204 NotebookApp] Kernel shutdown: 4d3a7a9c-5e0e-47cb-990d-c42e5c573818
Traceback (most recent call last):
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\Scripts\jupyter-notebook.EXE\__main__.py", line 7, in <module>
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\jupyter_core\application.py", line 269, in launch_instance
    return super().launch_instance(argv=argv, **kwargs)
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\traitlets\config\application.py", line 846, in launch_instance
    app.start()
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\notebookapp.py", line 2386, in start
    self.cleanup_kernels()
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\notebookapp.py", line 2165, in cleanup_kernels
    run_sync(self.kernel_manager.shutdown_all())
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\jupyter_client\utils.py", line 26, in wrapped
    raise e
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\jupyter_client\utils.py", line 23, in wrapped
    return loop.run_until_complete(future)
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\nest_asyncio.py", line 83, in run_until_complete
    self._run_once()
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\nest_asyncio.py", line 119, in _run_once
    handle._run()
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\nest_asyncio.py", line 195, in step
    step_orig(task, exc)
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\asyncio\tasks.py", line 232, in __step
    result = coro.send(None)
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\jupyter_client\utils.py", line 34, in ensure_async
    return await obj
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\jupyter_client\multikernelmanager.py", line 239, in _shutdown_kernel_when_ready
    await ensure_async(self.shutdown_kernel(kernel_id, now=now, restart=restart))
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 304, in shutdown_kernel
    self.pinned_superclass.shutdown_kernel(self, kernel_id, now=now, restart=restart)
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\jupyter_client\utils.py", line 26, in wrapped
    raise e
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\jupyter_client\utils.py", line 23, in wrapped
    return loop.run_until_complete(future)
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\nest_asyncio.py", line 83, in run_until_complete
    self._run_once()
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\nest_asyncio.py", line 119, in _run_once
    handle._run()
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\nest_asyncio.py", line 195, in step
    step_orig(task, exc)
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\asyncio\tasks.py", line 232, in __step
    result = coro.send(None)
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\jupyter_client\multikernelmanager.py", line 277, in _async_shutdown_kernel
    stopper = ensure_async(km.shutdown_kernel(now, restart))
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\jupyter_client\utils.py", line 26, in wrapped
    raise e
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\jupyter_client\utils.py", line 23, in wrapped
    return loop.run_until_complete(future)
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\nest_asyncio.py", line 83, in run_until_complete
    self._run_once()
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\nest_asyncio.py", line 119, in _run_once
    handle._run()
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\nest_asyncio.py", line 195, in step
    step_orig(task, exc)
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\asyncio\tasks.py", line 232, in __step
    result = coro.send(None)
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\jupyter_client\manager.py", line 71, in wrapper
    out = await method(self, *args, **kwargs)
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\jupyter_client\manager.py", line 490, in _async_shutdown_kernel
    await ensure_async(self.finish_shutdown(restart=restart))
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\jupyter_client\utils.py", line 26, in wrapped
    raise e
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\jupyter_client\utils.py", line 23, in wrapped
    return loop.run_until_complete(future)
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\nest_asyncio.py", line 83, in run_until_complete
    self._run_once()
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\site-packages\nest_asyncio.py", line 106, in _run_once
    event_list = self._selector.select(timeout)
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\selectors.py", line 324, in select
    r, w, _ = self._select(self._readers, self._writers, [], timeout)
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\selectors.py", line 315, in _select
    r, w, x = select.select(r, w, w, timeout)
KeyboardInterrupt
[IPKernelApp] WARNING | Parent appears to have exited, shutting down.

@kevin-bates
Copy link
Member

Hi @maffei2443 - I think this is a different kind of issue, but given your kernel is not starting, the results are essentially the same.

Looking at the stack, it appears ipykernel is having heartburn so I would ensure that BOTH ipython and ipykernel are up to date. Seeing that you are using Python 10 and Windows and selectors.py is involved, I suspect this could be related to a period where we had to force the use of a particular event loop "policy" to overcome some shortcomings in Tornado wrt Windows. I believe that was before Python 10 was "prevalent" so this may just be a matter of updating the aforementioned packages.

Should you find that worked, please let us know. Otherwise, including the output of jupyter --version and jupyter troubleshoot would probably be the next steps. Thanks.

@JasonChatzilias
Copy link

I also am having this issue .

@JasonChatzilias
Copy link

Traceback (most recent call last):
File "C:\Users\jason\anaconda3\Lib\site-packages\notebook\traittypes.py", line 235, in _resolve_classes
klass = self._resolve_string(klass)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\jason\AppData\Roaming\Python\Python311\site-packages\traitlets\traitlets.py", line 2018, in _resolve_string
return import_item(string)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\jason\AppData\Roaming\Python\Python311\site-packages\traitlets\utils\importstring.py", line 31, in import_item
module = import(package, fromlist=[obj])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'jupyter_server.contents'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\jason\anaconda3\Scripts\jupyter-notebook-script.py", line 10, in
sys.exit(main())
^^^^^^
File "C:\Users\jason\AppData\Roaming\Python\Python311\site-packages\jupyter_core\application.py", line 280, in launch_instance
super().launch_instance(argv=argv, **kwargs)
File "C:\Users\jason\AppData\Roaming\Python\Python311\site-packages\traitlets\config\application.py", line 1051, in launch_instance
app = cls.instance(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\jason\AppData\Roaming\Python\Python311\site-packages\traitlets\config\configurable.py", line 583, in instance
inst = cls(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\jason\AppData\Roaming\Python\Python311\site-packages\traitlets\traitlets.py", line 1294, in new
inst.setup_instance(*args, **kwargs)
File "C:\Users\jason\AppData\Roaming\Python\Python311\site-packages\traitlets\traitlets.py", line 1337, in setup_instance
super(HasTraits, self).setup_instance(*args, **kwargs)
File "C:\Users\jason\AppData\Roaming\Python\Python311\site-packages\traitlets\traitlets.py", line 1313, in setup_instance
init(self)
File "C:\Users\jason\anaconda3\Lib\site-packages\notebook\traittypes.py", line 226, in instance_init
self._resolve_classes()
File "C:\Users\jason\anaconda3\Lib\site-packages\notebook\traittypes.py", line 238, in _resolve_classes
warn(f"{klass} is not importable. Is it installed?", ImportWarning)
TypeError: warn() missing 1 required keyword-only argument: 'stacklevel'

@gauravdhiman
Copy link

I also observed something similar, but not sure if it is same issue as this or bit different. In my case, when I open a Notebook (that is on github) on github.com, it loads perfectly fine and I can interact with it, till I select some text in notebook and press Control key, when it immediately crashes and shows the message Unable to render code block.

If I just select text, move or interact with notebook, it works fine without issues. The issue only happens when some text is selected and I press Control key.

Just for info: I have Windows 10 (in case this info helps). Also not sure if this is a widespread issue (Jupyter Notebook on different platforms) or just specific to notebooks on github.com. I observed it with notebooks on github.com

Issue screen recording:
github-notebook-issue.webm

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

5 participants