"No route to host" error running python console in a container

In PyCharm I have setup a remote interpreter on a docker image and made it the default interpreter for my project:

I can connect to a container that uses this without any problems however when I open up the python console, which tries to run that remote interpreter, I get this:

Python 2.7.5 (default, Nov 6 2016, 00:28:07) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux2
Traceback (most recent call last):
File "/opt/.pycharm_helpers/pydev/_pydev_bundle/pydev_console_utils.py", line 274, in add_exec
self.finish_exec(more)
File "/opt/.pycharm_helpers/pydev/_pydev_bundle/pydev_console_utils.py", line 457, in finish_exec
return server.NotifyFinished(more)
File "/usr/lib64/python2.7/xmlrpclib.py", line 1233, in __call__
return self.__send(self.__name, args)
File "/usr/lib64/python2.7/xmlrpclib.py", line 1587, in __request
verbose=self.__verbose
File "/usr/lib64/python2.7/xmlrpclib.py", line 1273, in request
return self.single_request(host, handler, request_body, verbose)
File "/usr/lib64/python2.7/xmlrpclib.py", line 1301, in single_request
self.send_content(h, request_body)
File "/usr/lib64/python2.7/xmlrpclib.py", line 1448, in send_content
connection.endheaders(request_body)
File "/usr/lib64/python2.7/httplib.py", line 1013, in endheaders
self._send_output(message_body)
File "/usr/lib64/python2.7/httplib.py", line 864, in _send_output
self.send(msg)
File "/usr/lib64/python2.7/httplib.py", line 826, in send
self.connect()
File "/usr/lib64/python2.7/httplib.py", line 807, in connect
self.timeout, self.source_address)
File "/usr/lib64/python2.7/socket.py", line 571, in create_connection
raise err
error: [Errno 113] No route to host

I've googled around and found things suggesting the firewall may be the problem. I tried to open up the appropriate port as per http://ask.xmodulo.com/open-port-firewall-centos-rhel.html by issuing:

sudo firewall-cmd --zone=public --add-port=41560/tcp

but that hasn't helped.

Bit clueless as to what to do next. Any suggestions?

 

thanks in advance

0
Avatar
Permanently deleted user

3 months on...this problem has gone away for me because I've moved to using a new base VM image for dev purposes and the problem doesn't occur there.

 

However, a colleague of mine had a similar issue and he managed to solve it by issuing:

sudo iptables -I INPUT 1 -p tcp --match multiport --dport 1:60000 -j ACCEPT

 Your mileage may vary.

1

请先登录再写评论。