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
DOC: document how to change ipcontroller-engine.json in case controller was started with --ip="*" #4538
Comments
Under normal circumstances, What version of IPython are you using, and on what system? |
I'm using a git version from yesterday on windows. I think the problem is that "ipconfig" is printing it's output in German but the code is expecting it in English import IPython.utils.localinterfaces
def _populate_from_list(addr):
print addr
IPython.utils.localinterfaces._populate_from_list = _populate_from_list
from IPython.utils.localinterfaces import _load_ips_ipconfig, get_output_error_code
_load_ips_ipconfig()
['127.0.0.1']
out, err, rc = get_output_error_code('ipconfig')
print out
Windows-IP-Konfiguration
Drahtlos-LAN-Adapter Drahtlosnetzwerkverbindung 3:
Medienstatus. . . . . . . . . . . : Medium getrennt
Verbindungsspezifisches DNS-Suffix:
Drahtlos-LAN-Adapter Drahtlosnetzwerkverbindung 2:
Medienstatus. . . . . . . . . . . : Medium getrennt
Verbindungsspezifisches DNS-Suffix:
Drahtlos-LAN-Adapter Drahtlosnetzwerkverbindung:
Verbindungsspezifisches DNS-Suffix: fritz.box
Verbindungslokale IPv6-Adresse . : fe80::e1e6:ef28:8414:6965%15
IPv4-Adresse . . . . . . . . . . : 192.168.181.26
Subnetzmaske . . . . . . . . . . : 255.255.255.0
Standardgateway . . . . . . . . . : 192.168.181.1
Ethernet-Adapter Bluetooth-Netzwerkverbindung:
Medienstatus. . . . . . . . . . . : Medium getrennt
Verbindungsspezifisches DNS-Suffix:
Ethernet-Adapter LAN-Verbindung:
Medienstatus. . . . . . . . . . . : Medium getrennt
Verbindungsspezifisches DNS-Suffix:
Ethernet-Adapter VirtualBox Host-Only Network:
Verbindungsspezifisches DNS-Suffix:
Verbindungslokale IPv6-Adresse . : fe80::8519:94b0:31c6:8976%31
IPv4-Adresse . . . . . . . . . . : 192.168.56.1
Subnetzmaske . . . . . . . . . . : 255.255.255.0
Standardgateway . . . . . . . . . :
Tunneladapter isatap.{6C6D4B31-DE6C-4D25-A174-D177DBB8802F}:
Medienstatus. . . . . . . . . . . : Medium getrennt
Verbindungsspezifisches DNS-Suffix:
Tunneladapter Teredo Tunneling Pseudo-Interface:
Medienstatus. . . . . . . . . . . : Medium getrennt
Verbindungsspezifisches DNS-Suffix:
Tunneladapter isatap.{F8E56AA0-96E7-4C2A-A278-DBEF0E3382E4}:
Medienstatus. . . . . . . . . . . : Medium getrennt
Verbindungsspezifisches DNS-Suffix:
Tunneladapter isatap.{B8AA2EFE-2AD8-4F10-89DD-203893621C61}:
Medienstatus. . . . . . . . . . . : Medium getrennt
Verbindungsspezifisches DNS-Suffix:
Tunneladapter isatap.fritz.box:
Medienstatus. . . . . . . . . . . : Medium getrennt
Verbindungsspezifisches DNS-Suffix: fritz.box
Tunneladapter isatap.{EDB803A5-FE08-4A3E-A8EC-CF86090064F8}:
Medienstatus. . . . . . . . . . . : Medium getrennt
Verbindungsspezifisches DNS-Suffix:
Tunneladapter isatap.{C763A4C3-0F9E-46E2-8147-1836853C4096}:
Medienstatus. . . . . . . . . . . : Medium getrennt
Verbindungsspezifisches DNS-Suffix: The problematic method def _load_ips_ipconfig():
"""load ip addresses from `ipconfig` output (Windows)"""
out, err, rc = get_output_error_code('ipconfig')
if rc:
raise IOError("no ipconfig: %s" % err)
lines = out.splitlines()
addrs = ['127.0.0.1']
for line in lines:
line = line.lower().split()
if line[:2] == ['ipv4', 'address']: # FAIL...
addrs.append(line.split()[-1])
_populate_from_list(addrs) |
Aha - an incorrect English assumption. I'll see what I can do about fixing that. |
http://stackoverflow.com/questions/166506/finding-local-ip-addresses-using-pythons-stdlib import socket
print([ip for ip in socket.gethostbyname_ex(socket.gethostname())[2] ])
['192.168.181.26', '192.168.56.1'] (The first is my current IP in the local net, the second is the virtualbox adapter) And here the output when in a Cisco VPN: |
That's precisely what this code used to do, and doesn't anymore because it is unreliable, and when it fails it typically does so with a 30 second hang on DNS resolution. |
Not sure if that helps:
-> Get to the 0.0.0.0 entry, take the next lines and make a set from all the 4th entries in each line. |
Maybe it's a bug in |
No, it's generally caused by an issue in system configuration, not any API - the gethostname / gethostbyname approach involves a DNS lookup. If that fails, it will generally fail by timeout, rather than failing immediately. |
Ah I see. |
Please leave this BR open, I will add some doc fixes to document what to change if you need to specify the IP adress of the controller by hand. |
this is where the location key of the connection file is currently discussed, if you want to add to that in the docs. |
When the controller was started and bound to "*" (as the documentation of the config file says), the ipcontroller-engine.json file will include the following line:
At least in my case it was not enough to change the location to the controller IP, but I had to include the controller IP via the interface line:
It would both be nice to document how to specify the IP of the controller in the tutorial (http://ipython.org/ipython-doc/dev/parallel/parallel_process.html#starting-the-controller-and-engines-on-different-hosts) and/or change the logic to find the IP to bind to in the engine to take the location argument into account when the interface specifies "*".
The text was updated successfully, but these errors were encountered: