Ask Your Question
0

Python API gaierror Socket error

asked 2013-02-01 12:58:22 -0500

pritambonde gravatar image

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 "./getListingServer.py", line 66, in <module> conn2.request("GET", "%s/servers" % apiurlt[2], params2, headers2) File "/usr/lib/python2.6/httplib.py", line 914, in request self._send_request(method, url, body, headers) File "/usr/lib/python2.6/httplib.py", line 951, in _send_request self.endheaders() File "/usr/lib/python2.6/httplib.py", line 908, in endheaders self._send_output() File "/usr/lib/python2.6/httplib.py", line 780, in _send_output self.send(msg) File "/usr/lib/python2.6/httplib.py", line 739, in send self.connect() File "/usr/lib/python2.6/httplib.py", line 1112, in connect sock = socket.create_connection((self.host, self.port), self.timeout) File "/usr/lib/python2.6/socket.py", 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.

Thanks, Pritam

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-02-03 08:17:23 -0500

keith-tobin gravatar image

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.

http://stackoverflow.com/questions/4673166/python-httplib-name-or-service-not-known (http://stackoverflow.com/questions/46...)

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2013-02-01 12:58:22 -0500

Seen: 225 times

Last updated: Feb 03 '13