sessionmanager KeyError when restarting kernel
- Dominant language
- Jupyter Notebook
- Stars
- 13.3k
- Forks
- 5.8k
- Avg merge
- 6d 11h
- Merged PRs (30d)
- 7
Description
One of our internal users received the following traceback when restarting a metakernel based kernel via the Kernel -> Restart menu item. The traceback appeared in a popup dialog over the notebook page.
Notebook 5.1.0 final running in Python 3.6.
```
Traceback (most recent call last):
File "/opt/jupyterhub/envs/notebook-1506165706/lib/python3.6/site-packages/notebook/base/handlers.py", line 540, in wrapper
result = yield gen.maybe_future(method(self, *args, **kwargs))
File "/opt/jupyterhub/envs/notebook-1506165706/lib/python3.6/site-packages/tornado/gen.py", line 1055, in run
value = future.result()
File "/opt/jupyterhub/envs/notebook-1506165706/lib/python3.6/site-packages/tornado/concurrent.py", line 238, in result
raise_exc_info(self._exc_info)
File "", line 4, in raise_exc_info
File "/opt/jupyterhub/envs/notebook-1506165706/lib/python3.6/site-packages/tornado/gen.py", line 1069, in run
yielded = self.gen.send(value)
File "/opt/jupyterhub/envs/notebook-1506165706/lib/python3.6/site-packages/notebook/services/sessions/handlers.py", line 69, in post
model = yield gen.maybe_future(sm.get_session(path=path))
File "/opt/jupyterhub/envs/notebook-1506165706/lib/python3.6/site-packages/notebook/services/sessions/sessionmanager.py", line 170, in get_session
return self.row_to_model(row)
File "/opt/jupyterhub/envs/notebook-1506165706/lib/python3.6/site-packages/notebook/services/sessions/sessionmanager.py", line 209, in row_to_model
raise KeyError
KeyError
```
Contributor guide
Research direction
Start with notebook/services/sessions/sessionmanager.py, especially get_session and row_to_model, then review the request path in notebook/services/sessions/handlers.py. Reproduce the failure by restarting a metakernel-based kernel from the Kernel → Restart menu; done means the restart no longer produces the reported KeyError popup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- jupyter-notebook, python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100