Description
Hi,
I have been trying to use jupyterhub for a while now but I am struggling with a 403 error which I cannot sort out.
I am using jupyterhub version 0.8.0.b2 on fedora 25. I have installed all dependencies as described in the the installation instructions and configured jupyterhub to run on port 443. Apart from the IP of my server and the user admin name, all other options are set to the default ones in the jupyterhub_config.py file.
I can connect to the server through ssh and there is a webpage working at port 80. I have set selinux as permissive and all relevant ports should be properly set up in the firewall.
Now, whenever I run jupyterhub I get the following messages:
[root@psat jupyterhub]# jupyterhub -f jupyterhub_config.py --debug
[D 2017-08-29 17:27:42.508 JupyterHub application:555] Looking for jupyterhub_config in /etc/jupyterhub
[D 2017-08-29 17:27:42.509 JupyterHub application:577] Loaded config file: /etc/jupyterhub/jupyterhub_config.py
[I 2017-08-29 17:27:42.521 JupyterHub app:843] Loading cookie_secret from /srv/jupyterhub/jupyterhub_cookie_secret
[D 2017-08-29 17:27:42.521 JupyterHub app:894] Connecting to db: sqlite:///jupyterhub.sqlite
[D 2017-08-29 17:27:42.542 JupyterHub orm:503] database schema version found: 3ec6993fe20c
[D 2017-08-29 17:27:42.600 JupyterHub app:1216] Loading state for fmilano from db
[D 2017-08-29 17:27:42.605 JupyterHub app:1244] Loaded users:
fmilano admin
[I 2017-08-29 17:27:42.611 JupyterHub app:1531] Hub API listening on http://127.0.0.1:8081/hub/
[I 2017-08-29 17:27:42.612 JupyterHub proxy:457] Starting proxy @ https://137.43.92.162:443/
[D 2017-08-29 17:27:42.612 JupyterHub proxy:458] Proxy cmd: ['configurable-http-proxy', '--ip', '137.43.92.162', '--port', '443', '--api-ip', '127.0.0.1', '--api-port', '8001', '--error-target', 'http://127.0.0.1:8081/hub/error', '--ssl-key', '/etc/letsencrypt/live/psat.ucd.ie/privkey.pem', '--ssl-cert', '/etc/letsencrypt/live/psat.ucd.ie/fullchain.pem']
17:27:42.891 - info: [ConfigProxy] Proxying https://137.43.92.162:443 to (no default)
17:27:42.894 - info: [ConfigProxy] Proxy API at http://127.0.0.1:8001/api/routes
[D 2017-08-29 17:27:43.001 JupyterHub proxy:490] Proxy started and appears to be up
[D 2017-08-29 17:27:43.003 JupyterHub proxy:551] Proxy: Fetching GET http://127.0.0.1:8001/api/routes
17:27:43.041 - warn: [ConfigProxy] 403 GET /api/routes
[E 2017-08-29 17:27:43.040 JupyterHub app:1626]
Traceback (most recent call last):
File "/home/fmilano/jupyterhub/jupyterhub/app.py", line 1624, in launch_instance_async
yield self.start()
File "/home/fmilano/jupyterhub/jupyterhub/app.py", line 1572, in start
yield self.proxy.check_routes(self.users, self._service_map)
File "/home/fmilano/jupyterhub/jupyterhub/proxy.py", line 293, in check_routes
routes = yield self.get_all_routes()
File "/home/fmilano/jupyterhub/jupyterhub/proxy.py", line 588, in get_all_routes
resp = yield self.api_request('', client=client)
tornado.httpclient.HTTPError: HTTP 403: Forbidden
I have been looking for a solution for a week now (I have tried different ports, different configuration of apache, ssh, and the firewall), but I am always getting the same message and the jupyterhub exits as indicated above.
Any hint?
Thanks in advance for your help!
Activity
willingc commentedon Aug 30, 2017
Hi @fmilano1975, There is now a 0.8.0b3 release. Would you mind giving that version a try? Thanks.
cc/ @minrk Do you see anything with the 443 port usage or permissions/SSL cert that would prevent connection? Or possibly an apache setting?
minrk commentedon Aug 31, 2017
This probably means that there is a
configurable-http-proxy
instance still running with an older API token. Try shutting down the hub and check if there are any:If there are, shut them down and try launching jupyterhub again.
bottydim commentedon Dec 13, 2017
It would be nice if the service was doing that automatically on shutdown.
a-bangk commentedon May 18, 2018
Is there a permanent solution for this? Our Jupyterhub restarts every night and fails to start again.
titansmc commentedon May 29, 2018
Hi,
Since I run Jupyterhub through systemd, I have a
that will kill any remaining process:
It is just a dirty fix , but it works for me.
willingc commentedon Jun 8, 2018
I ran up against a stale
configurable-http-proxy
when running tests yesterday. @minrk, is there a straightforward way to do the cleanup automatically or should I document the solution you mention above to check for stale processes?minrk commentedon Jun 14, 2018
If jupyterhub wrote a pid file for the proxy, it could find the previous process and clean it up on startup.
@Adam-Origamiiris how is your jupyterhub restarting every night? Do you have logs? Even if JupyterHub crashes it should shutdown CHP unless it's dying of a pretty severe error
Koshmaar commentedon Oct 29, 2018
I was getting something similar
I was following zero-to-jupyterhub and didn't replace
secretToken='generate with openssl rand -hex 32'
in config file with the output of that command.....makarov20211221 commentedon May 31, 2019
The configurable-http-proxy is Restarting all the time. And the Pid is changing all the time.
Anyone got a solution ?
ChandlerBang commentedon Aug 7, 2019
Same problem here. Anyone can help?
michaelaye commentedon Mar 19, 2020
As this issue is closed, someone needs to make a new issue out of it.
2yongbum commentedon Jun 17, 2021
In my case, server is behind corporate proxy and firewall and jupyterhub tries connect http://127.0.0.1:8001/api/routes using proxy setting.
Unset the proxy enviromnet and it works.
engineerali2009 commentedon Nov 10, 2021
Kindly use
jupyter notebook --ip 127.0.0.1
kingdavid72 commentedon Nov 26, 2021
Thanks kill ^^ solved the problem
wordbaosun commentedon Mar 20, 2023
sudo npm install -g configurable-http-proxy