Closed AlexCatarino closed 6 years ago
From @AlexCatarino investigation:
Error received:
[E 21:38:19.522 LabApp] Exception restarting kernel
Traceback (most recent call last):
File "C:\Users\Alex\Anaconda3\lib\site-packages\notebook\services\kernels\handlers.py", line 85, in post
yield gen.maybe_future(km.restart_kernel(kernel_id))
File "C:\Users\Alex\Anaconda3\lib\site-packages\tornado\gen.py", line 1099, in run
value = future.result()
tornado.util.TimeoutError: Timeout waiting for restart
[W 21:57:52.013 LabApp] '_xsrf' argument missing from POST
[W 21:57:52.017 LabApp] 403 PUT /api/contents/iPythonNotebook/iCSharp%20Sample.ipynb?1533243472011 (::1) 6.00ms referer=http://localhost:8888/lab
I compiled icsharp under latest mono.
Mono JIT compiler version 5.12.0.301 (tarball Wed Jul 25 15:47:18 UTC 2018)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
Interpreter: yes
LLVM: supported, not enabled.
GC: sgen (concurrent by default)
with following kernel file kernel.json
in ~/.local/share/jupyter/kernels/csharp/
{
"display_name": "C#",
"argv": [
"mono",
"<path_to_Release_Folder>/iCSharp.Kernel.exe",
"{connection_file}"
],
"language": "csharp"
}
I was able to run kernel, but it is unstable.
Kernel periodically hangs, unable to reconnect. It seams that kernel_info_reply
message is not handled correctly.
[I 12:17:46.143 LabApp] Accepting one-time-token-authenticated connection from 127.0.0.1
[I 12:17:54.312 LabApp] Kernel started: fcd0baab-1ed8-4ffd-8fc8-5b662b1f9b83
[I 12:17:54.314 LabApp] Build is up to date
2018/08/03 12:17:54:302 [DEBUG] Hello2
2018/08/03 12:17:54:326 [DEBUG] /run/user/1000/jupyter/kernel-fcd0baab-1ed8-4ffd-8fc8-5b662b1f9b83.json
2018/08/03 12:17:54:326 [INFO] Opening file /run/user/1000/jupyter/kernel-fcd0baab-1ed8-4ffd-8fc8-5b662b1f9b83.json
2018/08/03 12:17:54:327 [DEBUG] {
"stdin_port": 54048,
"ip": "127.0.0.1",
"control_port": 47078,
"hb_port": 45019,
"signature_scheme": "hmac-sha256",
"key": "ee7f261b-8cafbf6d50ce0dfecf693883",
"kernel_name": "csharp",
"shell_port": 50832,
"transport": "tcp",
"iopub_port": 60213
}
2018/08/03 12:17:54:949 [INFO] Shell Started
2018/08/03 12:17:54:972 [INFO] Binded the Shell server to address tcp://127.0.0.1:50832
2018/08/03 12:17:54:972 [INFO] Binded the IOPub to address tcp://127.0.0.1:60213
2018/08/03 12:17:55:075 [INFO] f745d2c09b3ffeda02576fa8a4589774500d174d3e34699778d3352a983a6f20
2018/08/03 12:17:55:075 [INFO] {"username":"art","msg_type":"kernel_info_request","msg_id":"3a62be81-76fe0ed482eb3e8726633a28","version":"5.3","session":"f90fb7b2-cb3d-42e7-9b76-8bc1f3394da3","date":"2018-08-03T16:17:54.363366Z"}
2018/08/03 12:17:55:083 [INFO] {}
2018/08/03 12:17:55:083 [INFO] {}
2018/08/03 12:17:55:090 [INFO] {}
2018/08/03 12:17:55:112 [INFO] {"identifiers":["ANA6qSc="],"uuid":"","hmac":"f745d2c09b3ffeda02576fa8a4589774500d174d3e34699778d3352a983a6f20","header":{"msg_id":"3a62be81-76fe0ed482eb3e8726633a28","username":"art","session":"f90fb7b2-cb3d-42e7-9b76-8bc1f3394da3","msg_type":"kernel_info_request","version":"5.3"},"parent_header":{"msg_id":null,"username":null,"session":null,"msg_type":null,"version":null},"metadata":{},"content":"{}"}
2018/08/03 12:17:55:112 [INFO] Sending message to handler kernel_info_request
2018/08/03 12:17:55:115 [INFO] Sending kernel_info_reply
2018/08/03 12:17:55:117 [INFO] Message handling complete
[W 12:18:54.363 LabApp] Timeout waiting for kernel_info reply from fcd0baab-1ed8-4ffd-8fc8-5b662b1f9b83
2018/08/03 12:18:54:387 [INFO] 98f4eafb2a53f911f0ffe0f06c8ad826142a577e4a2bb0437d9abbb0758e7317
2018/08/03 12:18:54:387 [INFO] {"username":"","version":"5.2","msg_id":"adac1b58-0a3a-4057-a275-c19831120394","msg_type":"kernel_info_request","session":"e3328245-71ef-44ce-ad59-634ce395a1b4"}
2018/08/03 12:18:54:387 [INFO] {}
2018/08/03 12:18:54:387 [INFO] {}
2018/08/03 12:18:54:387 [INFO] {}
2018/08/03 12:18:54:387 [INFO] {"identifiers":["ZTMzMjgyNDUtNzFlZi00NGNlLWFkNTktNjM0Y2UzOTVhMWI0"],"uuid":"","hmac":"98f4eafb2a53f911f0ffe0f06c8ad826142a577e4a2bb0437d9abbb0758e7317","header":{"msg_id":"adac1b58-0a3a-4057-a275-c19831120394","username":"","session":"e3328245-71ef-44ce-ad59-634ce395a1b4","msg_type":"kernel_info_request","version":"5.2"},"parent_header":{"msg_id":null,"username":null,"session":null,"msg_type":null,"version":null},"metadata":{},"content":"{}"}
2018/08/03 12:18:54:387 [INFO] Sending message to handler kernel_info_request
2018/08/03 12:18:54:387 [INFO] Sending kernel_info_reply
2018/08/03 12:18:54:388 [INFO] Message handling complete
2018/08/03 12:18:54:395 [INFO] ff858168a56eb8afd7a417a4701bc3b56dfe8bb6913fd379a732b637a001dc8d
2018/08/03 12:18:54:395 [INFO] {"username":"","version":"5.2","msg_id":"4c9ca95c-fe85-4769-b0f9-9794030fd5e2","msg_type":"kernel_info_request","session":"f90fb7b2-cb3d-42e7-9b76-8bc1f3394da3"}
2018/08/03 12:18:54:395 [INFO] {}
2018/08/03 12:18:54:395 [INFO] {}
2018/08/03 12:18:54:395 [INFO] {}
2018/08/03 12:18:54:395 [INFO] {"identifiers":["ZjkwZmI3YjItY2IzZC00MmU3LTliNzYtOGJjMWYzMzk0ZGEz"],"uuid":"","hmac":"ff858168a56eb8afd7a417a4701bc3b56dfe8bb6913fd379a732b637a001dc8d","header":{"msg_id":"4c9ca95c-fe85-4769-b0f9-9794030fd5e2","username":"","session":"f90fb7b2-cb3d-42e7-9b76-8bc1f3394da3","msg_type":"kernel_info_request","version":"5.2"},"parent_header":{"msg_id":null,"username":null,"session":null,"msg_type":null,"version":null},"metadata":{},"content":"{}"}
2018/08/03 12:18:54:395 [INFO] Sending message to handler kernel_info_request
2018/08/03 12:18:54:396 [INFO] Sending kernel_info_reply
2018/08/03 12:18:54:396 [INFO] Message handling complete
2018/08/03 12:18:54:397 [INFO] 4aa0360f571fa806b6794c8cf44f9395079812bcea80da0dd9a2ae11acd6804d
2018/08/03 12:18:54:397 [INFO] {"username":"","version":"5.2","msg_id":"26cbf3b4-b6ce-46c1-a3ed-67f8c2f212ee","msg_type":"kernel_info_request","session":"431f27c0-b5fb-4f05-902b-34363d65ae09"}
2018/08/03 12:18:54:397 [INFO] {}
2018/08/03 12:18:54:397 [INFO] {}
2018/08/03 12:18:54:397 [INFO] {}
2018/08/03 12:18:54:397 [INFO] {"identifiers":["NDMxZjI3YzAtYjVmYi00ZjA1LTkwMmItMzQzNjNkNjVhZTA5"],"uuid":"","hmac":"4aa0360f571fa806b6794c8cf44f9395079812bcea80da0dd9a2ae11acd6804d","header":{"msg_id":"26cbf3b4-b6ce-46c1-a3ed-67f8c2f212ee","username":"","session":"431f27c0-b5fb-4f05-902b-34363d65ae09","msg_type":"kernel_info_request","version":"5.2"},"parent_header":{"msg_id":null,"username":null,"session":null,"msg_type":null,"version":null},"metadata":{},"content":"{}"}
2018/08/03 12:18:54:397 [INFO] Sending message to handler kernel_info_request
2018/08/03 12:18:54:397 [INFO] Sending kernel_info_reply
2018/08/03 12:18:54:397 [INFO] Message handling complete
Current version of Jupyter moved to new message protocol specification - v5. In particular Jupyter Lab handles kernel_info_request
message a bit differently from the Notebook implementation. In particular, Lab requires to set busy status prior sending kernel_info_reply
. Without setting status, Lab continuously sends kernel_info_request
after timeout.
I made a PR #49 to solve this issue along with update to v5 protocol.
I could successfully install ICSharp in Jupyter notebook in both Windows 10 Home and Linux docker container and able to run the sample notebook (iCSharp Sample.ipynb).
After I installed Jupyter Lab, I can see that it somehow recognizes the kernel, because there is an option to start a notebook with C# kernel. When I select that option, the kernel json file content is display in the console:
What changes should we make so that jupyter lab cell evaluate C# code?