Ask Your Question
1

Kernel error with 9.2 Windows installer 0.6.2

asked 2021-03-16 05:00:53 +0100

Road gravatar image

Here's the error message I get in SageMath 9.2 Notebook server console when I just open an empty Jupyter notebook:

[E 23:52:03.742 NotebookApp] Uncaught exception POST /api/sessions (127.0.0.1)
HTTPServerRequest(protocol='http', host='localhost:8888', method='POST', uri='/api/sessions', version='HTTP/1.1', remote_ip='127.0.0.1')
Traceback (most recent call last):
  File "/opt/sagemath-9.2/local/lib/python3.7/site-packages/tornado/web.py", line 1703, in _execute
    result = await result
  File "/opt/sagemath-9.2/local/lib/python3.7/site-packages/tornado/gen.py", line 742, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "/opt/sagemath-9.2/local/lib/python3.7/site-packages/notebook/services/sessions/handlers.py", line 72, in post
    type=mtype))
  File "/opt/sagemath-9.2/local/lib/python3.7/site-packages/tornado/gen.py", line 735, in run
    value = future.result()
  File "/opt/sagemath-9.2/local/lib/python3.7/site-packages/tornado/gen.py", line 742, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "/opt/sagemath-9.2/local/lib/python3.7/site-packages/notebook/services/sessions/sessionmanager.py", line 88, in create_session
    kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
  File "/opt/sagemath-9.2/local/lib/python3.7/site-packages/tornado/gen.py", line 735, in run
    value = future.result()
  File "/opt/sagemath-9.2/local/lib/python3.7/site-packages/tornado/gen.py", line 742, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "/opt/sagemath-9.2/local/lib/python3.7/site-packages/notebook/services/sessions/sessionmanager.py", line 101, in start_kernel_for_session
    self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
  File "/opt/sagemath-9.2/local/lib/python3.7/site-packages/tornado/gen.py", line 735, in run
    value = future.result()
  File "/opt/sagemath-9.2/local/lib/python3.7/site-packages/notebook/services/kernels/kernelmanager.py", line 176, in start_kernel
    kernel_id = await maybe_future(self.pinned_superclass.start_kernel(self, **kwargs))
  File "/opt/sagemath-9.2/local/lib/python3.7/site-packages/jupyter_client/multikernelmanager.py", line 186, in start_kernel
    km.start_kernel(**kwargs)
  File "/opt/sagemath-9.2/local/lib/python3.7/site-packages/jupyter_client/manager.py", line 304, in start_kernel
    kernel_cmd, kw = self.pre_start_kernel(**kw)
  File "/opt/sagemath-9.2/local/lib/python3.7/site-packages/jupyter_client/manager.py", line 251, in pre_start_kernel
    self.write_connection_file()
  File "/opt/sagemath-9.2/local/lib/python3.7/site-packages/jupyter_client/connect.py", line 474, in write_connection_file
    kernel_name=self.kernel_name
  File "/opt/sagemath-9.2/local/lib/python3.7/site-packages/jupyter_client/connect.py", line 138, in write_connection_file
    with secure_write(fname) as f:
  File "/usr/lib/python3.7/contextlib.py", line 112, in __enter__
    return next(self.gen)
  File "/opt/sagemath-9.2/local/lib/python3.7/site-packages/jupyter_core/paths.py", line 447, in secure_write
    .format(file=fname, permissions=oct(file_mode)))
RuntimeError: Permissions assignment failed for secure file: '/home/sage/.local/share/jupyter/runtime/kernel-5ecbbfc0-978c-428b-bf7b-3ae1eadf2539.json'. Got '0o644' instead of '0o0600'.
[W 23:52:03.749 NotebookApp] Unhandled error
[E 23:52:03.750 NotebookApp] {
  "Host": "localhost:8888",
  "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0",
  "Accept": "application/json, text/javascript, */*; q=0.01",
  "Accept-Language": "en-US,en;q=0.5",
  "Accept-Encoding": "gzip, deflate",
  "Content-Type": "application/json",
  "X-Xsrftoken": "2|c76e4f22|0cebf84dc6b5cb852f3878b5a6f02816|1615866062",
  "X-Requested-With": "XMLHttpRequest",
  "Content-Length": "84",
  "Origin": "http://localhost:8888",
  "Connection": "keep-alive",
  "Referer": "http://localhost:8888/notebooks/notebooks/Untitled.ipynb",
  "Cookie": "username-localhost-8888=\"2|1:0|10:1615866721|23:username-localhost-8888|44:ZDE5MTYwYWQzMTk3NDlmNTkzOGRlMDYxMzdhMDM2NTc=|2ea52166afb14e6831b4349df7eea58fe65ab4e4de70181b2aaba715ab04df0d\"; _xsrf=2|c76e4f22|0cebf84dc6b5cb852f3878b5a6f02816|1615866062"
}
[E 23:52:03.750 NotebookApp] 500 POST /api/sessions (127.0.0.1) 290.02ms referer=http://localhost:8888/notebooks/notebooks/Untitled.ipynb
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-03-16 08:47:41 +0100

Road gravatar image

The error stems from Jupyter insisting on certain permissions for a file:

RuntimeError: Permissions assignment failed for secure file: '/home/sage/.local/share/jupyter/runtime/kernel-5ecbbfc0-978c-428b-bf7b-3ae1eadf2539.json'. Got '0o644' instead of '0o0600'.

I resolved this issue by creating an environment variable JUPYTER_ALLOW_INSECURE_WRITES with value true.

This was addressed in https://discourse.jupyter.org/t/jupyt....

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-03-16 05:00:53 +0100

Seen: 354 times

Last updated: Mar 16 '21