{"action":"opened","issue":{"url":"https://api.github.com/repos/Yelp/mrjob/issues/1713","repository_url":"https://api.github.com/repos/Yelp/mrjob","labels_url":"https://api.github.com/repos/Yelp/mrjob/issues/1713/labels{/name}","comments_url":"https://api.github.com/repos/Yelp/mrjob/issues/1713/comments","events_url":"https://api.github.com/repos/Yelp/mrjob/issues/1713/events","html_url":"https://github.com/Yelp/mrjob/issues/1713","id":277944183,"number":1713,"title":"region issues having to do with listing buckets","user":{"login":"davidmarin","id":50076,"avatar_url":"https://avatars1.githubusercontent.com/u/50076?v=4","gravatar_id":"","url":"https://api.github.com/users/davidmarin","html_url":"https://github.com/davidmarin","followers_url":"https://api.github.com/users/davidmarin/followers","following_url":"https://api.github.com/users/davidmarin/following{/other_user}","gists_url":"https://api.github.com/users/davidmarin/gists{/gist_id}","starred_url":"https://api.github.com/users/davidmarin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidmarin/subscriptions","organizations_url":"https://api.github.com/users/davidmarin/orgs","repos_url":"https://api.github.com/users/davidmarin/repos","events_url":"https://api.github.com/users/davidmarin/events{/privacy}","received_events_url":"https://api.github.com/users/davidmarin/received_events","type":"User","site_admin":false},"labels":[{"id":52190,"url":"https://api.github.com/repos/Yelp/mrjob/labels/Bug","name":"Bug","color":"d95757","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/Yelp/mrjob/milestones/51","html_url":"https://github.com/Yelp/mrjob/milestone/51","labels_url":"https://api.github.com/repos/Yelp/mrjob/milestones/51/labels","id":2941250,"number":51,"title":"v0.6.2","description":"","creator":{"login":"davidmarin","id":50076,"avatar_url":"https://avatars1.githubusercontent.com/u/50076?v=4","gravatar_id":"","url":"https://api.github.com/users/davidmarin","html_url":"https://github.com/davidmarin","followers_url":"https://api.github.com/users/davidmarin/followers","following_url":"https://api.github.com/users/davidmarin/following{/other_user}","gists_url":"https://api.github.com/users/davidmarin/gists{/gist_id}","starred_url":"https://api.github.com/users/davidmarin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidmarin/subscriptions","organizations_url":"https://api.github.com/users/davidmarin/orgs","repos_url":"https://api.github.com/users/davidmarin/repos","events_url":"https://api.github.com/users/davidmarin/events{/privacy}","received_events_url":"https://api.github.com/users/davidmarin/received_events","type":"User","site_admin":false},"open_issues":10,"closed_issues":0,"state":"open","created_at":"2017-11-27T20:38:37Z","updated_at":"2017-11-29T23:22:32Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2017-11-29T23:22:32Z","updated_at":"2017-11-29T23:22:32Z","closed_at":null,"author_association":"COLLABORATOR","body":"`S3Filesystem.get_all_bucket_names()` can fail with the following error when attempting to access buckets in a different region:\r\n\r\n```botocore.exceptions.ClientError: An error occurred (AuthorizationHeaderMalformed) when calling the ListBuckets operation: The authorization header is malformed; the region 'us-west-2' is wrong; expecting 'us-east-1'```\r\n\r\nFor reference, here is the code:\r\n\r\n```python\r\n    def get_all_bucket_names(self):\r\n        r = self.make_s3_resource()\r\n        for b in r.buckets.all():\r\n            yield b.name\r\n```\r\n\r\nEven though all we're doing is getting buckets and then querying their `name` attribute, this upsets the V4 version of the API because you're only supposed to access buckets through their own endpoint.\r\n\r\nThe remedy is not to use an s3 resource to get bucket objects at all, and instead call `s3_client.list_buckets()`"}}
{"actor":{"display_login":"davidmarin"}}