Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: Failed to get port info #206

Open
grant-guo opened this issue Nov 9, 2017 · 1 comment
Open

RuntimeError: Failed to get port info #206

grant-guo opened this issue Nov 9, 2017 · 1 comment
Labels
host networking Related to host networking

Comments

@grant-guo
Copy link

I use docker 'host' network in order to visit some resources on the network where the host is sitting , got the error "Failed to get port info", here is configuration:

c.JupyterHub.hub_ip = '10.0.0.5'
c.JupyterHub.ip = '10.0.0.5'
c.JupyterHub.admin_access = True

c.JupyterHub.spawner_class = 'dockerspawner.DockerSpawner'
c.DockerSpawner.image = 'jupyter/all-spark-notebook'
c.DockerSpawner.host_ip = '0.0.0.0'
c.DockerSpawner.extra_host_config = { 'network_mode': 'host' }

I saw the source code says, if using 'host' network, need to override 'get_ip_and_port'. I have limited knowledge about python, anyone can show me how to configure it?

@limimiking
Copy link

I've also encountered this problem, I solved it in this way:

from tornado import gen
from dockerspawner import DockerSpawner
class DockerSpawner_host(DockerSpawner):
@gen.coroutine
def get_ip_and_port(self):
return self.host_ip, self.port
c.DockerSpawner_host.use_internal_ip = False

Put the above code in the jupyterhub_config.py, just before your DockerSpawner configs. In this way, the DockerSpawner_host becomes your new version of DockerSpawner. you should modify your other configurations and replace DockerSpawner with DockerSpawner_host. Hope that will help.

@minrk minrk added the host networking Related to host networking label Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
host networking Related to host networking
Projects
None yet
Development

No branches or pull requests

3 participants