Jupyterhub服务不可用错误和http:403禁止

时间:2018-05-15 09:24:46

标签: python-3.x jupyter-notebook jupyterhub httpforbiddenhandler

我使用Github帐户用户名和密码id安装了jupyterhub服务器。但是当我运行jupyterhub服务(https://my system ip:8000)时,我的服务不可用。 我安装了python3.6。 如何解决这个问题??

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 -----&gt; github用户名 johnjesus --------&gt; root用户名

1 个答案:

答案 0 :(得分:1)

答案发现here对我有用;您可以使用以下命令查找正在运行的configurable-http-proxy实例

ps aux | grep configurable-http-proxy

并阻止他们:

kill -9 <pid>