Question about creating a session via REST API
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 13.3k
- Forks
- 5.8k
- Avg merge
- 6d 11h
- Merged PRs (30d)
- 7
Description
Hello Group,
I'm trying to create a kernel session with the REST API. My sessions created with the API seem to perpetually be in in the 'starting' state (and do not list on the UI either). Jupyter logs however suggest the kernel was created. Is this a known issue of the API reporting incorrect status or am I submitting the request incorrectly?
Create Session request
# Create python session
curl --silent -k -XPOST https://HOST:9443/user/user1/api/sessions \
-H "Authorization: token $token" \
-d "{\"id\":\"737341b4-4dc2-4f05-8d8f-1b8f39ea3b1g\",\"name\":\"\",\"path\":\"Untitled12.ipynb\",\"type\":\"notebook\",\"kernel\":{\"name\":\"python3\"}}"
List Sessions response
{
"id": "544b5385-21f4-4cb4-b8f1-62a688134427",
"path": "Untitled12.ipynb",
"name": "",
"type": "notebook",
"kernel": {
"id": "d2174027-4d95-4317-9f79-bca047d833f1",
"name": "python3",
"last_activity": "2018-05-11T19:27:27.490052Z",
"execution_state": "starting",
"connections": 0
},
"notebook": {
"path": "Untitled12.ipynb",
"name": ""
}
}
Kernel instance info
$ curl --silent -k -XGET https://$HOST:9443/user/user1/api/kernels/d2174027-4d95-4317-9f79-bca047d833f1 \
> -H "Authorization: token $token" | jq
{
"id": "d2174027-4d95-4317-9f79-bca047d833f1",
"name": "python3",
"last_activity": "2018-05-11T19:27:27.490052Z",
"execution_state": "starting",
"connections": 0
}
Jupyter Logs
hadoop@ip-10-0-0-78 ~]$ cat /var/log/jupyter/jupyter.log | grep "d2174027-4d95-4317-9f79-bca047d833f1"
[D 2018-05-11 19:27:26.871 SingleUserNotebookApp manager:256] Starting kernel: ['/opt/conda/bin/python', '-m', 'ipykernel_launcher', '-f', '/home/user1/.local/share/jupyter/runtime/kernel-d2174027-4d95-4317-9f79-bca047d833f1.json']
[I 2018-05-11 19:27:26.882 SingleUserNotebookApp kernelmanager:145] Kernel started: d2174027-4d95-4317-9f79-bca047d833f1
[D 2018-05-11 19:27:27.490 SingleUserNotebookApp kernelmanager:371] activity on d2174027-4d95-4317-9f79-bca047d833f1: status
[I 2018-05-11 19:28:41.812 SingleUserNotebookApp log:122] 200 GET /user/user1/api/kernels/d2174027-4d95-4317-9f79-bca047d833f1 (jovyan@::ffff:10.0.0.78) 1.36ms
Mahalo and Cheers
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the POST to /api/sessions and comparing the /api/sessions and /api/kernels/{id} responses with the Jupyter log entries shown. Trace the session and kernel status handling; done means identifying whether the request is malformed or the API incorrectly leaves the kernel in starting and omits it from the UI.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- jupyter-notebook, python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100