Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL used by S3Request.bucket_url() has changed and no longer works #54

Open
leonardr opened this issue Dec 12, 2016 · 0 comments
Open

Comments

@leonardr
Copy link

Thanks for your work on a useful library.

I have upload code that works with tinys3 0.1.11 but fails with 0.1.12. The difference appears to be the destination URL tinys3 uses to upload a document. It's possible this is the same problem as issue #53, but I get a different error message.

Revision 308e3b9 changed the type of URL generated by S3Request.bucket_url. In 0.1.11, a document I upload is sent to http://s3.amazonaws.com/{bucket}/{key}. This works fine. In 0.1.12, the URL used is http://{bucket}.s3.amazonaws.com/{key}, and I get a 403 error from S3:

  File "/home/leonardr/.local/lib/python2.7/site-packages/tinys3/pool.py", line 84, in as_completed
    yield r.result()
  File "/home/leonardr/.local/lib/python2.7/site-packages/concurrent/futures/_base.py", line 398, in result
    return self.__get_result()
  File "/home/leonardr/.local/lib/python2.7/site-packages/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/leonardr/.local/lib/python2.7/site-packages/tinys3/request_factory.py", line 348, in run
    r.raise_for_status()
  File "/home/leonardr/.local/lib/python2.7/site-packages/requests/models.py", line 893, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
HTTPError: 403 Client Error: Forbidden for url: {url}

In revision 308e3b9 the reason given for changing the URL format is "Come back of the virtual-hosting URL style as the old one actually isn't working with a recent bucket". I would guess each URL style works on some buckets and fails on others.

Please let me know if you need any more information about my S3 configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant