Unable to restart the jhub

We are using HDP 3.0 cluster and Jhub was working fine.
I removed py2 kernal, restarted Jhub and it is fine there. I could not see py2 in jhub. It worked as expected.
Also I was asked to uninstall pycrypto python package. I could not uninstall using pip or conda so I removed only the pycrypto related packages from site-packages path.

I do not face any issues with python but when I tried to restart jupyterhub I am stuck. It is not restarting. I also reverted back and added my py2 kernel also did pip install pycrypto but still it is not restarting. I am not sure whether this issue is happened due to the above two actions or not.

P.S: I just removed these links* from Log trace as I could post more than 2 links.

Log trace:

 /usr/share/miniconda2/envs/py36/bin/jupyterhub --debug
[D 2021-03-13 21:25:09.182 JupyterHub application:555] Looking for jupyterhub_config in /root
[I 2021-03-13 21:25:09.183 JupyterHub app:2120] Using Authenticator: jupyterhub.auth.PAMAuthenticator-1.0.0
[I 2021-03-13 21:25:09.183 JupyterHub app:2120] Using Spawner: jupyterhub.spawner.LocalProcessSpawner-1.0.0
[I 2021-03-13 21:25:09.188 JupyterHub app:1257] Loading cookie_secret from /root/jupyterhub_cookie_secret
[D 2021-03-13 21:25:09.189 JupyterHub app:1424] Connecting to db: sqlite:///jupyterhub.sqlite
[D 2021-03-13 21:25:09.211 JupyterHub orm:749] database schema version found: 4dc2d5a8c53c
[I 2021-03-13 21:25:09.216 JupyterHub proxy:460] Generating new CONFIGPROXY_AUTH_TOKEN
[W 2021-03-13 21:25:09.217 JupyterHub app:1532] No admin users, admin interface will be unavailable.
[W 2021-03-13 21:25:09.217 JupyterHub app:1534] Add any administrative users to `c.Authenticator.admin_users` in config.
[I 2021-03-13 21:25:09.218 JupyterHub app:1563] Not using whitelist. Any authenticated user will be allowed.
[D 2021-03-13 21:25:09.248 JupyterHub app:1926] Loaded users:

[I 2021-03-13 21:25:09.255 JupyterHub app:2337] Hub API listening on
[W 2021-03-13 21:25:09.256 JupyterHub proxy:642] Running JupyterHub without SSL.  I hope there is SSL termination happening somewhere else...
[I 2021-03-13 21:25:09.256 JupyterHub proxy:645] Starting proxy @ http://:8000
[D 2021-03-13 21:25:09.257 JupyterHub proxy:646] Proxy cmd: ['configurable-http-proxy', '--ip', '', '--port', '8000', '--api-ip', '', '--api-port', '8001', '--error-target', '']
[D 2021-03-13 21:25:09.260 JupyterHub proxy:561] Writing proxy pid file: jupyterhub-proxy.pid
21:25:09.444 [ConfigProxy] info: Proxying http://*:8000 to (no default)
21:25:09.447 [ConfigProxy] info: Proxy API at
[D 2021-03-13 21:25:09.582 JupyterHub proxy:681] Proxy started and appears to be up
[D 2021-03-13 21:25:09.583 JupyterHub proxy:314] Fetching routes to check
[D 2021-03-13 21:25:09.584 JupyterHub proxy:765] Proxy: Fetching GET
21:25:09.592 [ConfigProxy] info: 200 GET /api/routes
[I 2021-03-13 21:25:09.593 JupyterHub proxy:319] Checking routes
[I 2021-03-13 21:25:09.593 JupyterHub proxy:399] Adding default route for Hub: / =>
[D 2021-03-13 21:25:09.593 JupyterHub proxy:765] Proxy: Fetching POST
21:25:09.595 [ConfigProxy] info: Adding route / ->
21:25:09.596 [ConfigProxy] info: Route added / ->
21:25:09.597 [ConfigProxy] info: 201 POST /api/routes/
[I 2021-03-13 21:25:09.597 JupyterHub app:2422] JupyterHub is now running at http://:8000
[D 2021-03-13 21:30:09.598 JupyterHub proxy:765] Proxy: Fetching GET
21:30:09.600 [ConfigProxy] info: 200 GET /api/routes
[I 2021-03-13 21:30:09.601 JupyterHub proxy:319] Checking routes
[D 2021-03-13 21:35:09.598 JupyterHub proxy:765] Proxy: Fetching GET
21:35:09.600 [ConfigProxy] info: 200 GET /api/routes
[I 2021-03-13 21:35:09.600 JupyterHub proxy:319] Checking routes
[D 2021-03-13 21:40:09.599 JupyterHub proxy:765] Proxy: Fetching GET
21:40:09.601 [ConfigProxy] info: 200 GET /api/routes
[I 2021-03-13 21:40:09.601 JupyterHub proxy:319] Checking routes
[D 2021-03-13 21:45:09.599 JupyterHub proxy:765] Proxy: Fetching GET
21:45:09.600 [ConfigProxy] info: 200 GET /api/routes

Jupyter troubleshoot



2.7.15 |Anaconda, Inc.| (default, May 1 2018, 23:32:55)
[GCC 7.2.0]


which -a jupyter:

Can any one please look into this assist to resolve this?

According to your logs JupyterHub is running:

Could you give us more information about what isn’t working?

In future you can format your logs by using triple backticks: Creating and highlighting code blocks - GitHub Docs

Thanks @manics. The issue is Jhub web UI is not working. I am getting " This site can’t be reached" error message. Also sometimes when I restart jupyterHub I am getting the following error message
“ERROR:asyncio:Task exception was never retrieved
future: <Task finished coro=<JupyterHub.launch_instance_async() done, defined at /usr/share/miniconda2/envs/py36/lib/python3.6/site-packages/jupyterhub/app.py:2477> exception=SystemExit(1,)>
Traceback (most recent call last):
File “/usr/share/miniconda2/envs/py36/lib/python3.6/site-packages/jupyterhub/app.py”, line 2480, in launch_instance_async
await self.start()
File “/usr/share/miniconda2/envs/py36/lib/python3.6/site-packages/jupyterhub/app.py”, line 2336, in start
self.http_server.listen(port, address=ip)
File “/usr/share/miniconda2/envs/py36/lib/python3.6/site-packages/tornado/tcpserver.py”, line 151, in listen
sockets = bind_sockets(port, address=address)
File “/usr/share/miniconda2/envs/py36/lib/python3.6/site-packages/tornado/netutil.py”, line 174, in bind_sockets
OSError: [Errno 98] Address already in use”

In both the cases the jupyterhub web UI is not working.

P.S: I updated the log properly with ```

When I restart Jhub I kill the pids that uses the ports 8000/8001 where node runs and also kill 8081 pid (sudo kill -9 pid) . Then usually Jhub starts.
But now even after I kill the pids it is not working when I check the 8000 port I see this error message
dev env(not working)

ps -ef | grep 8000
root      4864  3519  5 13:00 ?        00:00:00 node /bin/configurable-http-proxy --ip  --port 8000 --api-ip --api-port 8001 --error-target

still getting " This site can’t be reached" error in the browser.

This issue is happening in Dev env. In Non prod Jhub is working fine. I just compared non prod 8000 port process status

non prod env(working fine)

ps -ef | grep 8000
root      8870  8855  0 09:52 ?        00:00:06 node /bin/configurable-http-proxy --ip  --port 8000 --api-ip --api-port 8001 --error-target --log-level debug --ssl-key /etc/security/certs/<host>_private.key --ssl-cert /etc/security/certs/<host>_p01eaedl_manulife_com_cert.cer

So the ssl-key and ssl-cert is missing in the dev env. is this the root cause of this issue? I can see these values are set correctly in jupyterhub_config.py in both the env.

Kindly check this issue once

It sounds like it’s working in one environment but not the other? Can you give us full details of how you installed JupyterHub, including your configuration files with secrets redacted, and as much information as you can about how the two systems differ?

@manics , I was able to fix the issue. The root cause of the issue is that the ssl certificate and key file access was not given correctly. Changing that using chmod command with appropriate rights fixed the issue. Now the Jhub is running fine.
Thank you !!!