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

Socket Error 99 for ipython notebook #6193

Closed
gluincth opened this Issue Jul 23, 2014 · 7 comments

Comments

Projects
None yet
6 participants
@gluincth

gluincth commented Jul 23, 2014

Hi
when trying to open a notebook I get a socket error 99 "Cannot assign requested address". This happened after a system update, although Ipython was updated only from 2.1.0-62 to 2.1.0-63 (SuSE package) I checked the following without any sucess:

  1. checked if loopback device is running (it is with inet addr:127.0.0.1 Mask:255.0.0.0)
  2. checked with netstat -lp if standard port is already assigned (it was not)
  3. run a small test script to start tornado web server at port 8888, it worked
  4. Create a default profile and run ipython again
  5. Started ipython with explicit host and (random) port (ipython notebook --init --ip='localhost' --port=49151)
  6. Tried is as root
  7. Checked that the firewall is not blocking
  8. Checked that I am able to write to tmp (in case that is needed)

So I am at a loss what else I can do. Any pointer on what else I can do are appreciated.

The start-up message is
tmp/> ipython notebook --init --log-level=50 --ip='localhost' --port=49151 [15:46:39]
Traceback (most recent call last):
File "/usr/bin/ipython", line 5, in
start_ipython()
File "/usr/lib/python2.7/site-packages/IPython/init.py", line 120, in start_ipython
return launch_new_instance(argv=argv, *_kwargs)
File "/usr/lib/python2.7/site-packages/IPython/config/application.py", line 563, in launch_instance
app.initialize(argv)
File "", line 2, in initialize
File "/usr/lib/python2.7/site-packages/IPython/config/application.py", line 92, in catch_config_error
return method(app, *args, *_kwargs)
File "/usr/lib/python2.7/site-packages/IPython/terminal/ipapp.py", line 320, in initialize
super(TerminalIPythonApp, self).initialize(argv)
File "", line 2, in initialize
File "/usr/lib/python2.7/site-packages/IPython/config/application.py", line 92, in catch_config_error
return method(app, _args, *_kwargs)
File "/usr/lib/python2.7/site-packages/IPython/core/application.py", line 381, in initialize
self.parse_command_line(argv)
File "/usr/lib/python2.7/site-packages/IPython/terminal/ipapp.py", line 315, in parse_command_line
return super(TerminalIPythonApp, self).parse_command_line(argv)
File "", line 2, in parse_command_line
File "/usr/lib/python2.7/site-packages/IPython/config/application.py", line 92, in catch_config_error
return method(app, _args, *_kwargs)
File "/usr/lib/python2.7/site-packages/IPython/config/application.py", line 475, in parse_command_line
return self.initialize_subcommand(subc, subargv)
File "", line 2, in initialize_subcommand
File "/usr/lib/python2.7/site-packages/IPython/config/application.py", line 92, in catch_config_error
return method(app, _args, *_kwargs)
File "/usr/lib/python2.7/site-packages/IPython/config/application.py", line 413, in initialize_subcommand
self.subapp.initialize(argv)
File "", line 2, in initialize
File "/usr/lib/python2.7/site-packages/IPython/config/application.py", line 92, in catch_config_error
return method(app, _args, *_kwargs)
File "/usr/lib/python2.7/site-packages/IPython/html/notebookapp.py", line 745, in initialize
self.init_webapp()
File "/usr/lib/python2.7/site-packages/IPython/html/notebookapp.py", line 632, in init_webapp
self.http_server.listen(port, self.ip)
File "/usr/lib64/python2.7/site-packages/tornado/tcpserver.py", line 116, in listen
sockets = bind_sockets(port, address=address)
File "/usr/lib64/python2.7/site-packages/tornado/netutil.py", line 103, in bind_sockets
sock.bind(sockaddr)
File "/usr/lib64/python2.7/socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
error: [Errno 99] Cannot assign requested address

My system configuration is
{'commit_hash': '681fd77',
'commit_source': 'installation',
'default_encoding': 'UTF-8',
'ipython_path': '/usr/lib/python2.7/site-packages/IPython',
'ipython_version': '2.1.0',
'os_name': 'posix',
'platform': 'Linux-3.11.10-17-default-x86_64-with-SuSE-13.1-x86_64',
'sys_executable': '/usr/bin/python',
'sys_platform': 'linux2',
'sys_version': '2.7.6 (default, Nov 21 2013, 15:55:38) [GCC]'}

My tornado version is
Name: python-tornado/Version: 3.2.1-2.1/Arch: x86_64

@minrk

This comment has been minimized.

Member

minrk commented Jul 23, 2014

And what if you try --ip=127.0.0.1?

@gluincth

This comment has been minimized.

gluincth commented Jul 24, 2014

Hi

That works (should have thought of that). I put it into my ipython_notebook_config.py. I wonder though why the behaviour changed...
So from my side I could close this issue. Only if one could change the error message to something meaningful that points to the solution, I would keep this issue open. But maybe this problem is too specific...

Thanks a lot for the quick answer!

@minrk

This comment has been minimized.

Member

minrk commented Jul 24, 2014

Copying explanation from #6191:

IPython listens on localhost by default. 127.0.0.1 ought to behave the same, and does in almost all cases. Some cases where this can be handled differently include local proxies and/or firewalls (usually due to a configuration oversight, rather than an intentional difference in behavior). We have found cases where localhost works and 127 doesn't and vice versa, so there isn't an unambiguously correct answer for the default.

Do you have a firewall and/or proxy configuration? If so, do you control its configuration? I would describe this behavior as a bug in your network setup, but it may not be one that you have permission to fix.

@minrk minrk closed this Jul 24, 2014

@minrk minrk added this to the no action milestone Jul 24, 2014

@naoko

This comment has been minimized.

naoko commented Aug 17, 2014

Thank you, specifying 127.0.0.1 solved the socket error for me as well

@tigerneil

This comment has been minimized.

tigerneil commented Dec 11, 2017

If you use it in cloud server, you can use --ip=0.0.0.0.

@Leegenux

This comment has been minimized.

Leegenux commented Jan 23, 2018

Thanks for keeping this issue on, I am setting up a notebook server on a cloud server. And specifying the listening ip as "0.0.0.0" does solved this same problem.

@OussamaSegh

This comment has been minimized.

OussamaSegh commented Oct 23, 2018

Thanks, I had the same problem :)

etejedor added a commit to etejedor/root that referenced this issue Nov 23, 2018

[ROOT-9829] Make Jupyter server to listen on all interfaces
Users might want to connect to a notebook server launched with
'root --notebook' from another computer. This setting of the
Jupyter configuration makes that possible.

This also solves the issue explained here:

ipython/ipython#6193

Depending on the network configuration of a machine/container,
binding on localhost might fail. This looks like the issue
reported on ROOT-9829.

etejedor added a commit to etejedor/root that referenced this issue Nov 23, 2018

[ROOT-9829] Make Jupyter server listen on all interfaces
Users might want to connect to a notebook server launched with
'root --notebook' from another computer. This setting of the
Jupyter configuration makes that possible.

This also solves the issue explained here:

ipython/ipython#6193

Depending on the network configuration of a machine/container,
binding on localhost might fail. This looks like the issue
reported on ROOT-9829.

etejedor added a commit to root-project/root that referenced this issue Nov 27, 2018

[ROOT-9829] Make Jupyter server listen on all interfaces
Users might want to connect to a notebook server launched with
'root --notebook' from another computer. This setting of the
Jupyter configuration makes that possible.

This also solves the issue explained here:

ipython/ipython#6193

Depending on the network configuration of a machine/container,
binding on localhost might fail. This looks like the issue
reported on ROOT-9829.

etejedor added a commit to etejedor/root that referenced this issue Nov 27, 2018

[ROOT-9829] Make Jupyter server listen on all interfaces
Users might want to connect to a notebook server launched with
'root --notebook' from another computer. This setting of the
Jupyter configuration makes that possible.

This also solves the issue explained here:

ipython/ipython#6193

Depending on the network configuration of a machine/container,
binding on localhost might fail. This looks like the issue
reported on ROOT-9829.

etejedor added a commit to root-project/root that referenced this issue Nov 28, 2018

[ROOT-9829] Make Jupyter server listen on all interfaces
Users might want to connect to a notebook server launched with
'root --notebook' from another computer. This setting of the
Jupyter configuration makes that possible.

This also solves the issue explained here:

ipython/ipython#6193

Depending on the network configuration of a machine/container,
binding on localhost might fail. This looks like the issue
reported on ROOT-9829.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment