Open ajs6f opened 1 year ago
Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:
This appears to be the same issue dealt with in https://github.com/jupyterhub/yarnspawner/pull/23. I have not tried the fix there, and it's not obvious to me why it was never merged?
@ajs6f have you tested it with Jupyterhub 5.1.0?
I'm encountering a runtime warning and unable to access the provided URLs after the server starts. The warning and logs are as follows
[I 2024-09-16 14:32:17.212 YarnSingleUserLabApp manager:348] notebook_shim | extension was successfully linked. [W 2024-09-16 14:32:17.216 YarnSingleUserLabApp serverapp:2108] Customizing authentication via ServerApp.login_handler_class=<class 'jupyterhub.singleuser.mixins.make_singleuser_app.
.JupyterHubLoginHandler'> is deprecated in Jupyter Server 2.0. Use ServerApp.identity_provider_class. Falling back on legacy authentication. [I 2024-09-16 14:32:17.267 YarnSingleUserLabApp manager:368] notebook_shim | extension was successfully loaded. [I 2024-09-16 14:32:17.272 YarnSingleUserLabApp manager:368] jupyter_lsp | extension was successfully loaded. [I 2024-09-16 14:32:17.274 YarnSingleUserLabApp manager:368] jupyter_server_terminals | extension was successfully loaded. [I 2024-09-16 14:32:17.277 LabApp] JupyterLab extension loaded from /opt/jupyterhub/miniconda/envs/yarnpy/lib/python3.10/site-packages/jupyterlab [I 2024-09-16 14:32:17.277 LabApp] JupyterLab application directory is /opt/jupyterhub/miniconda/envs/yarnpy/share/jupyter/lab [I 2024-09-16 14:32:17.278 LabApp] Extension Manager is 'pypi'. [I 2024-09-16 14:32:17.312 YarnSingleUserLabApp manager:368] jupyterlab | extension was successfully loaded. [I 2024-09-16 14:32:17.321 YarnSingleUserLabApp manager:368] notebook | extension was successfully loaded. /opt/jupyterhub/miniconda/envs/yarnpy/lib/python3.10/site-packages/yarnspawner/jupyter_labhub.py:18: RuntimeWarning: coroutine 'HubAuth._api_request' was never awaited self.hub_auth._api_request(method='POST', RuntimeWarning: Enable tracemalloc to get the object allocation traceback [I 2024-09-16 14:32:17.340 YarnSingleUserLabApp mixins:636] Starting jupyterhub-singleuser server version 5.1.0 [I 2024-09-16 14:32:17.393 YarnSingleUserLabApp serverapp:3005] Serving notebooks from local directory: /tmp/hadoop-hadoop/nm-local-dir/usercache/hadoop/appcache/application_1726492361358_0007/container_1726492361358_0007_01_000001 [I 2024-09-16 14:32:17.393 YarnSingleUserLabApp serverapp:3005] Jupyter Server 2.14.2 is running at: [I 2024-09-16 14:32:17.393 YarnSingleUserLabApp serverapp:3005] http://node2:53601/user/hadoop/lab?token=2606dbaa48f2042c36a24f6ce344bc135b7bbfeec999be4f [I 2024-09-16 14:32:17.394 YarnSingleUserLabApp serverapp:3005] http://127.0.0.1:53601/user/hadoop/lab?token=2606dbaa48f2042c36a24f6ce344bc135b7bbfeec999be4f [I 2024-09-16 14:32:17.394 YarnSingleUserLabApp serverapp:3006] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [C 2024-09-16 14:32:17.406 YarnSingleUserLabApp serverapp:3068] To access the server, open this file in a browser: file:///.jupyter/jpserver-26397-open.html Or copy and paste one of these URLs: http://node2:53601/user/hadoop/lab?token=2606dbaa48f2042c36a24f6ce344bc135b7bbfeec999be4f http://127.0.0.1:53601/user/hadoop/lab?token=2606dbaa48f2042c36a24f6ce344bc135b7bbfeec999be4f
Even though the server appears to start and the URLs are generated, I am unable to access the JupyterLab interface via the provided URLs (e.g., http://node2:53601/user/hadoop/lab?token=...).
Afterward, the skein application running on Yarn is killed, and the user fails to spawn. The user cannot access their environment or run JupyterLab.
What could be causing this runtime warning, and could it be related to the access issue?
Any guidance would be greatly appreciated.
Thank you!
I'm sorry to say that we gave up on this mode of deployment, @raibrahim. We are moving on to using Kubernetes for resource management.
Thanks to much help from @mahendrapaipuri at this issue I was able to fix this bug. I can prepare a PR if that is desired.
Bug description
There is an error in
YarnSpawner
's https://github.com/jupyterhub/yarnspawner/blob/1c40f529ddf9fd6217e9b8ae954fd669e4276c92/yarnspawner/singleuser.py#L15-L19After v3 of JupyterHub, HubAuth._api_request() is now an
async
method.A corrected
YarnSingleUserNotebookApp.start(self)
looks like:Expected behaviour
I thought the hub would correctly wait for the single-user notebook to be spawned and then communicate therewith.
Actual behaviour
The single-user notebook spawns, the hub and notebook exchange activity messages, but the hub never correctly returns from the notebook spawn and eventually kills the notebook, even though it was running perfectly well.
How to reproduce
Install and configure YarnSpawner. This will happen every time.
Your personal set up
CentOS Linux release 7.9.2009 (Core)
Full environment
Configuration
```python [sorokaa@dl-test-02 miniconda]$ cat /etc/jupyterhub/jupyterhub_config.py c.JupyterHub.hub_ip = '' c.Application.log_level='DEBUG' c.JupyterHub.bind_url = 'http://:9090' c.JupyterHub.cookie_secret_file = '/etc/jupyterhub/jupyterhub_cookie_secret' c.JupyterHub.db_url = 'sqlite:////var/jupyterhub/jupyterhub.sqlite' c.JupyterHub.hub_bind_url = 'http://dl-test-02.cm.cluster:9091' c.JupyterHub.ssl_cert = '/etc/jupyterhub/cert-bundle.pem' c.JupyterHub.ssl_key = '/etc/jupyterhub/server.key' c.Application.logging_config = { 'handlers': { 'file': { 'class': 'logging.FileHandler', 'level': 'DEBUG', 'filename': '/var/log/jupyterhub/jupyterhub.log', } }, 'loggers': { '