SSD-Tensorflow icon indicating copy to clipboard operation
SSD-Tensorflow copied to clipboard

socket.error: [Errno 99] Cannot assign requested address

Open weiqinwang opened this issue 7 years ago • 10 comments

The following error occurred while executing the jupyter notebook ssd_notebook.ipynb in the docker container

Traceback (most recent call last):
  File "/usr/local/bin/jupyter-notebook", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/jupyter_core/applicat
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwarg
  File "/usr/local/lib/python2.7/dist-packages/traitlets/config/appl
    app.initialize(argv)
  File "<decorator-gen-7>", line 2, in initialize
  File "/usr/local/lib/python2.7/dist-packages/traitlets/config/appl
    return method(app, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/notebook/notebookapp.
    self.init_webapp()
  File "/usr/local/lib/python2.7/dist-packages/notebook/notebookapp.
    self.http_server.listen(port, self.ip)
  File "/usr/local/lib/python2.7/dist-packages/tornado/tcpserver.py"
    sockets = bind_sockets(port, address=address)
  File "/usr/local/lib/python2.7/dist-packages/tornado/netutil.py", 
    sock.bind(sockaddr)
  File "/usr/lib/python2.7/socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 99] Cannot assign requested address

Ubuntu 16.04.2 LTS \n \l

weiqinwang avatar Jul 18 '17 05:07 weiqinwang

@weiqinwang Did you ever find a solution?

iamwilhelm avatar Aug 05 '17 08:08 iamwilhelm

I solved that same error (which I got running a different .ipynb file inside a different docker container) by explicitly providing the IP address (note that 'localhost' did not work):

jupyter notebook --ip='127.0.0.1'

Jane333 avatar Aug 23 '17 14:08 Jane333

@Jane333 Addition to that, I can also use --ip=*

phizaz avatar Sep 17 '17 15:09 phizaz

For me only the --ip=* version worked.

snth avatar Oct 19 '17 08:10 snth

jupyter notebook --ip='127.0.0.1' worked for me!

monajalal avatar Nov 12 '17 19:11 monajalal

worked for me too :) Could you provide a short explanation why specifying an IP address resolves this issue?

EvgeniaAR avatar Nov 27 '17 13:11 EvgeniaAR

@EvgeniaAR honestly, no idea - -" you might need to dig deeper to what "address" it is trying to allocate.

phizaz avatar Nov 27 '17 13:11 phizaz

jupyter seems to try to start the webserver on localhost in my case there was no entry in the hosts file (I don't know why). As soon as I added 127.0.0.1 localhost to my hosts file it worked again

DerJesko avatar Dec 26 '17 15:12 DerJesko

I am having the same problem and I can work around it with --ip=127.0.0.1 Note that localhost does not work for me although I have the 127.0.0.1 localhost entry in my hosts file.

musger avatar Feb 15 '18 20:02 musger

This problem started coming in my Dockerized jupyter notebook. Workaround was to start the notebook with --ip=<actual_IP_of_container>, which I obtained by popping out of docker container using ctrl+p+q and then finding out ip with docker container inspect <container_id>. This dumped plethora of information along with IPAddress field.

Then to start notebook the command became: jupyter notebook --ip=<IPAddress> --allow-root

jyotendra avatar Sep 13 '19 11:09 jyotendra