socket.error: [Errno 111] Connection refused

Asked by Ved Antani

I have setup single development instance using - http://swift.openstack.org/development_saio.html - things work fine as per this page.
I am trying to connect programatically as follows and getting connection refused error :

:~/python-cloudfiles$ python
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24)
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cloudfiles
>>> conn=cloudfiles.get_connection(authurl='http://127.0.0.1:11000/v1.0',username='test:tester',api_key='testing')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "cloudfiles/__init__.py", line 98, in get_connection
    return Connection(*args, **kwargs)
  File "cloudfiles/connection.py", line 86, in __init__
    self._authenticate()
  File "cloudfiles/connection.py", line 92, in _authenticate
    (url, self.cdn_url, self.token) = self.auth.authenticate()
  File "cloudfiles/authentication.py", line 67, in authenticate
    conn.request('GET', '/' + self.uri, headers=self.headers)
  File "/usr/lib/python2.7/httplib.py", line 955, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.7/httplib.py", line 989, in _send_request
    self.endheaders(body)
  File "/usr/lib/python2.7/httplib.py", line 951, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 811, in _send_output
    self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 773, in send
    self.connect()
  File "/usr/lib/python2.7/httplib.py", line 754, in connect
    self.timeout, self.source_address)
  File "/usr/lib/python2.7/socket.py", line 571, in create_connection
    raise err
socket.error: [Errno 111] Connection refused
>>>

Question information

Language:
English Edit question
Status:
Answered
For:
OpenStack Object Storage (swift) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Ved Antani (ved) said :
#1

The API call fails with port 8080 also. But ST works against this URL

~/swift/trunk$ st -A http://127.0.0.1:8080/auth/v1.0 -U test:tester -K testing stat
   Account: AUTH_7616beed-9ac5-4153-a287-d24ca896dabb
Containers: 0
   Objects: 0
     Bytes: 0
Accept-Ranges: bytes

Revision history for this message
gholt (gholt) said :
#2

Are you sure you're using the exact same auth url in both cases?
The cloudfiles bindings' example should probably look like this:

conn=cloudfiles.get_connection(authurl='http://127.0.0.1:8080/auth/v1.0', username='test:tester', api_key='testing')

Can you help with this problem?

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

To post a message you must log in.