Python API gaierror Socket error

Asked by Pritam on 2013-02-01

Hello All,

My name is Pritam.

I was developing a Code in Python to call Nova-APi. Please find below mention Python version:-

[root@kingcobra myCloud]# python --version
Python 2.6.6

Python Program developed Code is throwing error for service not known, find below mention stack trace:-

Traceback (most recent call last):
  File "./", line 66, in <module>
    conn2.request("GET", "%s/servers" % apiurlt[2], params2, headers2)
  File "/usr/lib/python2.6/", line 914, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.6/", line 951, in _send_request
  File "/usr/lib/python2.6/", line 908, in endheaders
  File "/usr/lib/python2.6/", line 780, in _send_output
  File "/usr/lib/python2.6/", line 739, in send
  File "/usr/lib/python2.6/", line 1112, in connect
    sock = socket.create_connection((, self.port), self.timeout)
  File "/usr/lib/python2.6/", line 553, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
socket.gaierror: [Errno -2] Name or service not known

Can someone guide me do i need to download the LIBERLIES and include in Python.


Question information

English Edit question
OpenStack Compute (nova) Edit question
No assignee Edit question
Last query:
Last reply:
Keith Tobin (keith-tobin) said : #1

The last line in eye 'Traceback' tells you what is wrong, httplib was unable to resolve the name or service. This could be because the URL or format you passed is incorrect. Have a look at the following link, it has more info that should help.

Can you help with this problem?

Provide an answer of your own, or ask Pritam for more information if necessary.

To post a message you must log in.