Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JEG on Windows Server 2019 - Kernels starting and timing out (Config Question) #1394

Open
HighKeys opened this issue Nov 17, 2024 · 4 comments
Labels

Comments

@HighKeys
Copy link

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
from ipykernel import kernelapp as app
File "C:\Users*\venvs\etl-env\Lib\site-packages\ipykernel_init_.py", line 7, in
from .connect import * # noqa: F403
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users*
\venvs\etl-env\Lib\site-packages\ipykernel\connect.py", line 12, in
import jupyter_client
File "C:\Users*\venvs\etl-env\Lib\site-packages\jupyter_client_init_.py", line 4, in
from .connect import *
File "C:\Users*
\venvs\etl-env\Lib\site-packages\jupyter_client\connect.py", line 28, in
from jupyter_core.paths import jupyter_data_dir, jupyter_runtime_dir, secure_write
File "C:\Users*\venvs\etl-env\Lib\site-packages\jupyter_core\paths.py", line 24, in
from .utils import deprecation
File "C:\Users*
\venvs\etl-env\Lib\site-packages\jupyter_core\utils_init_.py", line 5, in
import asyncio
File "C:\ProgramData\Python\Python311\Lib\asyncio_init_.py", line 42, in
from .windows_events import *
File "C:\ProgramData\Python\Python311\Lib\asyncio\windows_events.py", line 8, in
import _overlapped
OSError: [WinError 10106] The requested service provider could not be loaded or initialized

after some time JEG just try to nudge the Kernel.

Any idea what I'm missing here?

thanks!

@HighKeys HighKeys added the bug label Nov 17, 2024
@lresende
Copy link
Member

See the following -> #907 (comment)

@HighKeys
Copy link
Author

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

@HighKeys
Copy link
Author

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:
grafik

Maybe someone here could point me to an example how I could handle the win32 interrupt event in the LocalProcessProxy?

Thank you very much!

@lresende
Copy link
Member

I would provide a pull request so others could help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants