ipython / ipyparallel

IPython Parallel: Interactive Parallel Computing in Python
https://ipyparallel.readthedocs.io/
Other
2.58k stars 999 forks source link

"Controller appears to be listening on localhost, but not on this machine" warning on debian/ubuntu #316

Open gpolles opened 6 years ago

gpolles commented 6 years ago

Yeah, it's just a warning, low priority. But also an easy fix, maybe? The reason is because the ip_for_host call returns 127.0.1.1 instead of 127.0.0.1

Quoting from the debian reference manual:

For example, "/etc/hosts" looks like the following.

127.0.0.1 localhost 127.0.1.1

The following lines are desirable for IPv6 capable hosts

::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts

Each line starts with a IP address and it is followed by the associated hostname.

The IP address 127.0.1.1 in the second line of this example may not be found on some other Unix-like systems. The Debian Installer creates this entry for a system without a permanent IP address as a workaround for some software (e.g., GNOME) as documented in the bug #719621.

Not sure if needed but there is ipython info:

{'commit_hash': u'b467d487e',
 'commit_source': 'installation',
 'default_encoding': 'UTF-8',
 'ipython_path': '/home/xxxx/miniconda2/lib/python2.7/site-packages/IPython',
 'ipython_version': '5.5.0',
 'os_name': 'posix',
 'platform': 'Linux-4.4.0-112-generic-x86_64-with-debian-stretch-sid',
 'sys_executable': '/home/xxxx/miniconda2/bin/python',
 'sys_platform': 'linux2',
 'sys_version': '2.7.13 |Continuum Analytics, Inc.| (default, Dec 20 2016, 23:09:15) \n[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]'}
minrk commented 6 years ago

What do you get for socket.gethostname() and socket.gethostbyname_ex(socket.gethostname())? With that config, I wouldn't expect this warning to appear unless the hostnames actually don't match.

gpolles commented 6 years ago

Hi minrk,

In [4]: socket.gethostname()
Out[4]: 'g-omen-866-264'

In [5]: socket.gethostbyname_ex(socket.gethostname())
Out[5]: ('g-omen-866-264', [], ['127.0.1.1'])
michaelaye commented 6 years ago

getting the same warning all of a sudden. Here's my values for socket.gethostname() and socket.gethostbyname_ex(socket.gethostname()):

'surfer-172-29-13-53-hotspot.internet-for-guests.com' ('surfer-172-29-13-53-hotspot.internet-for-guests.com', [], ['83.218.160.135'])

just trying to run a local notebookserver with an ipcluster on my laptop. my system:

{'commit_hash': '7f10f7bb3',
 'commit_source': 'installation',
 'default_encoding': 'UTF-8',
 'ipython_path': '/Users/klay6683/miniconda3/envs/stable/lib/python3.6/site-packages/IPython',
 'ipython_version': '6.4.0',
 'os_name': 'posix',
 'platform': 'Darwin-16.7.0-x86_64-i386-64bit',
 'sys_executable': '/Users/klay6683/miniconda3/envs/stable/bin/python',
 'sys_platform': 'darwin',
 'sys_version': '3.6.5 | packaged by conda-forge | (default, Apr  6 2018, '
                '13:44:09) \n'
                '[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)]'}
abjer commented 5 years ago

I have the same problem as OP socket used is 127.0.1.1 and therefore it won't connect.