How to allow accessing URLs from service fabric cluster?

Nachiket Kamat 1 Reputation point

I have a python application from which I am trying to connect to couple of URLs.

When I run the application locally then there is no error. When I build a docker image for the application and run it, then also there is no error. However, when I deploy the docker image into a service fabric cluster, then I get the following error. From a similar question, I understand that this may be related to DNS/proxy issues. Can you suggest some steps to fix this in the service fabric cluster?

socket.gaierror: [Errno 11002] getaddrinfo failed

During handling of the above exception, another exception occurred:



import urllib.request as r  

Traceback (most recent call last):
File "C:\Python\lib\urllib\", line 1318, in do_open
File "C:\Python\lib\http\", line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File "C:\Python\lib\http\", line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "C:\Python\lib\http\", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "C:\Python\lib\http\", line 1026, in _send_output
File "C:\Python\lib\http\", line 964, in send
File "C:\Python\lib\http\", line 1392, in connect
File "C:\Python\lib\http\", line 936, in connect
(,self.port), self.timeout, self.source_address)
File "C:\Python\lib\", line 704, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "C:\Python\lib\", line 745, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11002] getaddrinfo failed

During handling of the above exception, another exception occurred:  
Traceback (most recent call last):  
  File "C:\Python\lib\site-packages\flask\", line 1813, in full_dispatch_request  
    rv = self.dispatch_request()  
  File "C:\Python\lib\site-packages\flask\", line 1799, in dispatch_request  
    return self.view_functions[rule.endpoint](**req.view_args)  
  File "C:\app\email_extractor\", line 106, in hello_test  
  File "C:\Python\lib\urllib\", line 223, in urlopen  
    return, data, timeout)  
  File "C:\Python\lib\urllib\", line 526, in open  
    response = self._open(req, data)  
  File "C:\Python\lib\urllib\", line 544, in _open  
    '_open', req)  
  File "C:\Python\lib\urllib\", line 504, in _call_chain  
    result = func(*args)  
  File "C:\Python\lib\urllib\", line 1361, in https_open  
    context=self._context, check_hostname=self._check_hostname)  
  File "C:\Python\lib\urllib\", line 1320, in do_open  
    raise URLError(err)  
Azure Service Fabric
Azure Service Fabric
An Azure service that is used to develop microservices and orchestrate containers on Windows and Linux.
212 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Nandan Mathure 6 Reputation points


    This may be happening because the URL is cluster URL and docker image is running on only one of the nodes.

    Either run docker image on all nodes or configure reverse proxy ( to allow external traffic be routed to correct node.

    Also, try to access URL of node directly to make sure firewalls are not blocking the traffic on specific ports.


    Nandan Mathure

    1 person found this answer helpful.
    0 comments No comments