When a JUPYTERHUB_SERVICE_URL is received with port number 0 (which is a valid usecase according to @minrk, some mechanism triggers which causes the Jupyter server to start running on port 80 instead of the default port 8888. Even when a JUPYTER_PORT environment variable is set, this value is ignored. I'm not sure where/why this exactly happens.
This seems to be the only place where JUPYTERHUB_SERVICE_URL is parsed. When an invalid port number 0 is received, I think it is best to log a warning and revert to the default port 5000 instead.
This PR is related to the problem identified in https://github.com/jupyter/docker-stacks/issues/1862 .
When a
JUPYTERHUB_SERVICE_URL
is received with port number 0 (which is a valid usecase according to @minrk, some mechanism triggers which causes the Jupyter server to start running on port 80 instead of the default port 8888. Even when aJUPYTER_PORT
environment variable is set, this value is ignored. I'm not sure where/why this exactly happens.This seems to be the only place where
JUPYTERHUB_SERVICE_URL
is parsed. When an invalid port number0
is received, I think it is best to log a warning and revert to the default port5000
instead.