Hi Antonio,<div><br></div><div>It sounds like you might be using the wrong credentials. The S3 layer works with the EC2 credentials.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On 6 December 2012 06:33, Antonio Messina <span dir="ltr"><<a href="mailto:arcimboldo@gmail.com" target="_blank">arcimboldo@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><br>Hi all,<br><br>I'm trying to access SWIFT using the S3 API compatibility layer, but I always get an "AccessDenied".<br>

<br>I'm running folsom on ubuntu precise 12.04 LTS, packages are from  <a href="http://ubuntu-cloud.archive.canonical.com" target="_blank">ubuntu-cloud.archive.canonical.com</a> 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. <br>



<br>I've installed swift-plugin-s3 and I've configured proxy-server.conf as follow:<br><br clear="all">pipeline = catch_errors healthcheck cache ratelimit authtoken keystoneauth swift3  proxy-logging proxy-server<br>



[filter:swift3]<br>use = egg:swift3#swift3<br><br>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). <br><br>The code I'm using is:<br>



<br>from libcloud.storage.types import Provider as StorageProvider<br>from libcloud.storage.providers import get_driver as get_storage_driver<br><br>s3driver = get_storage_driver(StorageProvider.S3)<br>s3 = s3driver(ec2access, ec2secret, secure=False, host=s3host, port=8080)<br>



s3.list_containers()<br><br>What I get is:<br><br>Traceback (most recent call last):<br>  File "<stdin>", line 1, in <module><br>  File "/home/antonio/.virtualenvs/cloud/local/lib/python2.7/site-packages/libcloud/storage/drivers/s3.py", line 176, in list_containers<br>



    response = self.connection.request('/')<br>  File "/home/antonio/.virtualenvs/cloud/local/lib/python2.7/site-packages/libcloud/common/base.py", line 605, in request<br>    connection=self)<br>  File "/home/antonio/.virtualenvs/cloud/local/lib/python2.7/site-packages/libcloud/common/base.py", line 93, in __init__<br>



    raise Exception(self.parse_error())<br>  File "/home/antonio/.virtualenvs/cloud/local/lib/python2.7/site-packages/libcloud/storage/drivers/s3.py", line 68, in parse_error<br>    raise InvalidCredsError(self.body)<br>



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>'<br>



<br><br>Using boto instead:<br><br>>>> import boto<br>>>> s3conn = boto.s3.connection.S3Connection( aws_access_key_id=ec2access, aws_secret_access_key=ec2secret, port=s3port, host=s3host, is_secure=False,debug=3)<br>



>>> s3conn.get_all_buckets()        <br>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 7c67d5b35b5a4127887c5da319c70a18:WXVx9AONXvIkDiIdg8rUnfncFnM=\r\nUser-Agent: Boto/2.6.0 (linux2)\r\n\r\n'<br>



reply: 'HTTP/1.1 403 Forbidden\r\n'<br>header: Content-Type: text/xml; charset=UTF-8<br>header: Content-Length: 124<br>header: X-Trans-Id: tx7a823c742f624f2682bfddb19f31bcc2<br>header: Date: Wed, 05 Dec 2012 19:24:42 GMT<br>



Traceback (most recent call last):<br>  File "<stdin>", line 1, in <module><br>  File "/home/antonio/.virtualenvs/cloud/local/lib/python2.7/site-packages/boto/s3/connection.py", line 364, in get_all_buckets<br>



    response.status, response.reason, body)<br>boto.exception.S3ResponseError: S3ResponseError: 403 Forbidden<br><?xml version="1.0" encoding="UTF-8"?><br><Error><br>  <Code>AccessDenied</Code><br>



  <Message>Access denied</Message><br></Error><br><br>Login and password work when using the command line tool `swift`.<br><br>I think I may be missing something very basilar here, but I couldn't find so much documentation...<br>



<br>Thanks in advance<span class="HOEnZb"><font color="#888888"><span><font color="#888888"><br><br>.a.</font></span><br clear="all"></font></span></div><span class="HOEnZb"><font color="#888888"><br>-- <br><a href="mailto:antonio.s.messina@gmail.com" target="_blank">antonio.s.messina@gmail.com</a><br>

<a href="mailto:arcimboldo@gmail.com" target="_blank">arcimboldo@gmail.com</a><br>
GC3: Grid Computing Competence Center<br><a href="http://www.gc3.uzh.ch/" target="_blank">http://www.gc3.uzh.ch/</a><br>University of Zurich<br>Winterthurerstrasse 190<br>CH-8057 Zurich Switzerland<br>
</font></span><br>_______________________________________________<br>
Mailing list: <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
Post to     : <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>
Unsubscribe : <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
More help   : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Cheers,<br>~Blairo<br>
</div>