JEG on Windows Server 2019 - Kernels starting and timing out (Config Question)
Hi,
i try to setup JEG on my Windows Server 2019 Machine, it should just spawn Local Kernels so i can use them remote with my Laptop.
I setup JEG and the Kernels, i can see the Kernels in my Jupyterlab, they also seems to start as postman returns the kernel with "starting" status.
I can connect manually to the spawned kernel with Postman but my Jupyterlab can't
Here is what i see in the JEG Console Window:
D 2024-11-17 18:54:53.267 EnterpriseGatewayApp] Launching kernel: 'Python 3 (ETL)' with command: ['C:\Users\\venvs\etl-env\scripts\python.exe', '-Xfrozen_modules=off', '-m', 'ipykernel_launcher', '-f', 'C:\Users\\AppData\Roaming\jupyter\runtime\kernel-c66b786d-403c-493f-84f4-458b61a41541.json']
[D 2024-11-17 18:54:53.267 EnterpriseGatewayApp] BaseProcessProxy.launch_process() env: {'KERNEL_LAUNCH_TIMEOUT': '', 'KERNEL_WORKING_DIR': '', 'KERNEL_USERNAME': '', 'KERNEL_GATEWAY': '', 'KERNEL_ID': '', 'KERNEL_LANGUAGE': '', 'EG_IMPERSONATION_ENABLED': ''}
[I 2024-11-17 18:54:53.273 EnterpriseGatewayApp] Local kernel launched on 'ip', pid: 16132, pgid: 0, KernelID: c66b786d-403c-493f-84f4-458b61a41541, cmd: '['C:\Users\\venvs\etl-env\scripts\python.exe', '-Xfrozen_modules=off', '-m', 'ipykernel_launcher', '-f', 'C:\Users\\AppData\Roaming\jupyter\runtime\kernel-c66b786d-403c-493f-84f4-458b61a41541.json']'
[D 2024-11-17 18:54:53.274 EnterpriseGatewayApp] Connecting to: tcp://127.0.0.1:61198
[D 2024-11-17 18:54:53.281 EnterpriseGatewayApp] Connecting to: tcp://127.0.0.1:61195
[I 2024-11-17 18:54:53.284 EnterpriseGatewayApp] Kernel started: c66b786d-403c-493f-84f4-458b61a41541
[D 2024-11-17 18:54:53.284 EnterpriseGatewayApp] Kernel args: {'env': {'KERNEL_LAUNCH_TIMEOUT': '40', 'KERNEL_WORKING_DIR': 'a path on my laptop', 'KERNEL_USERNAME': 'Laptop username'}, 'kernel_headers': {}, 'kernel_name': 'etl-env'}
[I 241117 18:54:53 web:2348] 201 POST /api/kernels (ip) 29.00ms
[D 2024-11-17 18:54:53.344 EnterpriseGatewayApp] Initializing websocket connection /api/kernels/c66b786d-403c-493f-84f4-458b61a41541/channels
[D 2024-11-17 18:54:53.344 EnterpriseGatewayApp] Requesting kernel info from c66b786d-403c-493f-84f4-458b61a41541
[D 2024-11-17 18:54:53.346 EnterpriseGatewayApp] Connecting to: tcp://127.0.0.1:61194
[I 241117 18:54:53 web:2348] 200 GET /api/kernels (ip) 0.00ms
[D 2024-11-17 18:54:53.367 EnterpriseGatewayApp] Initializing websocket connection /api/kernels/c66b786d-403c-493f-84f4-458b61a41541/channels
[D 2024-11-17 18:54:53.368 EnterpriseGatewayApp] Waiting for pending kernel_info request
[D 2024-11-17 18:54:53.378 EnterpriseGatewayApp] Initializing websocket connection /api/kernels/c66b786d-403c-493f-84f4-458b61a41541/channels
[W 2024-11-17 18:54:53.379 EnterpriseGatewayApp] Replacing stale connection: c66b786d-403c-493f-84f4-458b61a41541:66351527-a8ee-422a-9305-f3b432ee58df
[D 2024-11-17 18:54:53.380 EnterpriseGatewayApp] Found kernel ds-env in C:\Users*\AppData\Roaming\jupyter\kernels
[D 2024-11-17 18:54:53.380 EnterpriseGatewayApp] Found kernel etl-env in C:\Users*\AppData\Roaming\jupyter\kernels
[W 2024-11-17 18:54:53.381 EnterpriseGatewayApp] Native kernel (python3) is not available
[I 241117 18:54:53 web:2348] 200 GET /api/kernelspecs (ip) 3.00ms
Traceback (most recent call last):
File "C:\ProgramData\Python\Python311\Lib\runpy.py", line 198, in _run_module_as_main
return _run_code(code, main_globals, None,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\Python\Python311\Lib\runpy.py", line 88, in _run_code
exec(code, run_globals)
File "C:\Users*\venvs\etl-env\Lib\site-packages\ipykernel_launcher.py", line 16, in
after some time JEG just try to nudge the Kernel.
Any idea what I'm missing here?
thanks!
See the following -> https://github.com/jupyter-server/enterprise_gateway/issues/907#issuecomment-737335153
See the following -> #907 (comment)
Thanks for the Info, so it seems that JEG isn't offical supported on Windows, bad for me.
I will try to investigate the Errors a bit futher, i guess there is no windows alternative? Didn't found anything in my research
BR
So i fixed most of the issues with configuring the Env Variables correctly with JEG.
There is just one issue left as far as i notice, the Interrupt Event is missing in LocalProcessProxy Class.
I tried to add it myself using the Jupyter_Client.win_interrupt.create_interrupt_event(), but i guess thats not the correct way to do it, as the error message is gone but the interrupt is not working.
a bit sketchy from testing:
Maybe someone here could point me to an example how I could handle the win32 interrupt event in the LocalProcessProxy?
Thank you very much!
I would provide a pull request so others could help.