[Openstack] Fwd: [swift3] api - boto and libcloud => AccessDenied

Antonio Messina arcimboldo at gmail.com
Wed Dec 5 19:33:07 UTC 2012

Hi all,

I'm trying to access SWIFT using the S3 API compatibility layer, but I
always get an "AccessDenied".

I'm running folsom on ubuntu precise 12.04 LTS, packages are from
ubuntu-cloud.archive.canonical.com repository. Swift is correctly
configured, login and password have been tested with the web interface and
from command line. Glance uses it to store the images.

I've installed swift-plugin-s3 and I've configured proxy-server.conf as

pipeline = catch_errors healthcheck cache ratelimit authtoken keystoneauth
swift3  proxy-logging proxy-server
use = egg:swift3#swift3

I've then tried to connect using my keystone login and password (and I've
also tried with the EC2 tokens, with the same result).

The code I'm using is:

from libcloud.storage.types import Provider as StorageProvider
from libcloud.storage.providers import get_driver as get_storage_driver

s3driver = get_storage_driver(StorageProvider.S3)
s3 = s3driver(ec2access, ec2secret, secure=False, host=s3host, port=8080)

What I get is:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
line 176, in list_containers
    response = self.connection.request('/')
line 605, in request
line 93, in __init__
    raise Exception(self.parse_error())
line 68, in parse_error
    raise InvalidCredsError(self.body)
libcloud.common.types.InvalidCredsError: '<?xml version="1.0"
encoding="UTF-8"?>\r\n<Error>\r\n  <Code>AccessDenied</Code>\r\n
<Message>Access denied</Message>\r\n</Error>'

Using boto instead:

>>> import boto
>>> s3conn = boto.s3.connection.S3Connection( aws_access_key_id=ec2access,
aws_secret_access_key=ec2secret, port=s3port, host=s3host,
>>> s3conn.get_all_buckets()
send: 'GET / HTTP/1.1\r\nHost: cloud-storage1:8080\r\nAccept-Encoding:
identity\r\nDate: Wed, 05 Dec 2012 19:25:00 GMT\r\nContent-Length:
0\r\nAuthorization: AWS
Boto/2.6.0 (linux2)\r\n\r\n'
reply: 'HTTP/1.1 403 Forbidden\r\n'
header: Content-Type: text/xml; charset=UTF-8
header: Content-Length: 124
header: X-Trans-Id: tx7a823c742f624f2682bfddb19f31bcc2
header: Date: Wed, 05 Dec 2012 19:24:42 GMT
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
line 364, in get_all_buckets
    response.status, response.reason, body)
boto.exception.S3ResponseError: S3ResponseError: 403 Forbidden
<?xml version="1.0" encoding="UTF-8"?>
  <Message>Access denied</Message>

Login and password work when using the command line tool `swift`.

I think I may be missing something very basilar here, but I couldn't find
so much documentation...

Thanks in advance


antonio.s.messina at gmail.com
arcimboldo at gmail.com
GC3: Grid Computing Competence Center
University of Zurich
Winterthurerstrasse 190
CH-8057 Zurich Switzerland
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20121205/ba71a00d/attachment.html>

More information about the Openstack mailing list