Jupyterhub service unavailable error and http :403 forbidden

10.6k views Asked by At

I installed the jupyterhub server with use of Github account username and secret id. but i got service unavailable when I run jupyterhub service ( https://my system ip:8000). I have python3.6 installed. How to solve this problem??

root@johnjesus-HCL-Desktop:~# jupyterhub
[W 2018-05-15 14:38:10.001 JupyterHub app:366] JupyterHub.proxy_cmd is deprecated in JupyterHub 0.8, use ConfigurableHTTPProxy.command
[I 2018-05-15 14:38:10.002 JupyterHub app:834] Loading cookie_secret from /home/johnjesus/jupyterhub_cookie_secret
[I 2018-05-15 14:38:10.077 JupyterHub app:1528] Hub API listening on http://127.0.0.1:8081/hub/
[W 2018-05-15 14:38:10.079 JupyterHub proxy:415] 
    Generating CONFIGPROXY_AUTH_TOKEN. Restarting the Hub will require restarting the proxy.
    Set CONFIGPROXY_AUTH_TOKEN env or JupyterHub.proxy_auth_token config to avoid this message.

[I 2018-05-15 14:38:10.079 JupyterHub proxy:458] Starting proxy @ https://*:8000/
[E 2018-05-15 14:38:10.094 JupyterHub app:1623]
    Traceback (most recent call last):
      File "/usr/local/lib/python3.6/dist-packages/jupyterhub/app.py", line 1621, in launch_instance_async
        yield self.start()
      File "/usr/local/lib/python3.6/dist-packages/jupyterhub/app.py", line 1569, in start
        yield self.proxy.check_routes(self.users, self._service_map)
      File "/usr/local/lib/python3.6/dist-packages/jupyterhub/proxy.py", line 294, in check_routes
        routes = yield self.get_all_routes()
      File "/usr/local/lib/python3.6/dist-packages/jupyterhub/proxy.py", line 589, in get_all_routes
        resp = yield self.api_request('', client=client)
    tornado.httpclient.HTTPError: HTTP 403: Forbidden

root@johnjesus-HCL-Desktop:~# 14:38:10.592 - info: [ConfigProxy] Proxying https://*:8000 to (no default)
14:38:10.595 - info: [ConfigProxy] Proxy API at http://127.0.0.1:8001/api/routes
14:38:10.597 - error: [ConfigProxy] Uncaught Exception Error: listen EADDRINUSE :::8000
    at Object._errnoException (util.js:1022:11)
    at _exceptionWithHostPort (util.js:1044:20)
    at Server.setupListenHandle [as _listen2] (net.js:1367:14)
    at listenInCluster (net.js:1408:12)
    at Server.listen (net.js:1492:7)
    at Object.<anonymous> (/usr/local/lib/node_modules/configurable-http-proxy/bin/configurable-http-proxy:253:19)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
14:38:10.598 - error: [ConfigProxy] Uncaught Exception Error: listen EADDRINUSE 127.0.0.1:8001
    at Object._errnoException (util.js:1022:11)
    at _exceptionWithHostPort (util.js:1044:20)
    at Server.setupListenHandle [as _listen2] (net.js:1367:14)
    at listenInCluster (net.js:1408:12)
    at doListen (net.js:1517:7)
    at _combinedTickCallback (internal/process/next_tick.js:141:11)
    at Immediate._tickCallback [as _onImmediate] (internal/process/next_tick.js:180:9)
    at runCallback (timers.js:794:20)
    at tryOnImmediate (timers.js:752:5)
    at processImmediate [as _immediateCallback] (timers.js:729:5)





c.JupyterHub.authenticator_class = 'oauthenticator.GitHubOAuthenticator'
c.GitHubOAuthenticator.oauth_callback_url = 'https://172.16.8.174:8000/hub/oauth_callback'
c.GitHubOAuthenticator.client_id = 'id'
c.GitHubOAuthenticator.client_secret = 'secret'
# This is an application.
# create system users that don't exist yet
c.LocalAuthenticator.create_system_users = True
c.Authenticator.whitelist = {'ajohnpaulantony', 'bhuvana', 'arun'}
c.Authenticator.admin_users = {'ajohnpaulantony', 'bhuvana'}
c.Spawner.notebook_dir = '~/notebooks'
c.JupyterHub.ssl_cert = 'mycert.pem'
c.JupyterHub.ssl_key = 'mykey.key'
c.JupyterHub.cookie_secret_file = '/home/johnjesus/jupyterhub_cookie_secret'
c.JupyterHub.proxy_cmd = ['/usr/local/bin/configurable-http-proxy']
# Let the Systemctl aware of all the environment path
import os
for var in os.environ:
    c.Spawner.env_keep.append(var)

ajohnpaulantony -----> github username johnjesus --------> root username

4

There are 4 answers

0
Scorpioooooon21 On

Try unset the proxy, if your server is behind corporate proxy unset http_proxy

2
Joost Döbken On

The answer found here worked for me; you can find the running configurable-http-proxy instances with:

ps aux | grep configurable-http-proxy

and stop them:

kill -9 <pid>
0
coding On

Deleting jupyterhub.pid and jupyterhub.sqlite resolved my problem with this error, together with stoping jupyterhub process and configurable-http-proxy (using pkill command), and then starting jupyterhub again.

0
elia368 On

Stopping the JuyterHub service and deleting the jupyterhub.pid file has helped me. in this case, disabling jupyterhub on system startup with systemctl disable jupyterhub is a permanent solution.