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

301 Moved Permanently #33

Open
my-web-manager opened this issue Mar 8, 2016 · 8 comments
Open

301 Moved Permanently #33

my-web-manager opened this issue Mar 8, 2016 · 8 comments

Comments

@my-web-manager
Copy link

Executing the command with an S3 bucket located in Sydney Australia (ap-southeast-1) throws an error.

root@vmd001 [/path/to/folder/test]# /path/to/folder/s3-parallel-put --bucket=vmd001 --put=add --insecure --dry-run --limit=1 .
Traceback (most recent call last):
File "/path/to/folder/s3-parallel-put", line 420, in
sys.exit(main(sys.argv))
File "/path/to/folder/s3-parallel-put", line 391, in main
bucket = connection.get_bucket(options.bucket)
File "/usr/lib/python2.6/site-packages/boto/s3/connection.py", line 502, in get_bucket
return self.head_bucket(bucket_name, headers=headers)
File "/usr/lib/python2.6/site-packages/boto/s3/connection.py", line 549, in head_bucket
response.status, response.reason, body)
boto.exception.S3ResponseError: S3ResponseError: 301 Moved Permanently

@IhorKirei
Copy link

Got same error.

@martgnz
Copy link

martgnz commented Jul 25, 2016

This is not addressed on the README, but if you look at the code there's an option to set the AWS region as --bucket_region=YOUR_REGION.

In my case setting it to my region, eu-west-1, solved the issue:

./s3-parallel-put --bucket=MY_BUCKET \
   --put=stupid
   --dry-run --limit=1
   --bucket_region=eu-west-1
   --insecure
   .

@uslperera
Copy link

Is it fixed yet?

@mishudark
Copy link
Owner

no yet

@aaronflorey
Copy link

I found removing the following fixed it for me

calling_format = boto.s3.connection.OrdinaryCallingFormat(),

@nealalpert
Copy link

commenting out calling_format = boto.s3.connection.OrdinaryCallingFormat(), seems to result in a 400 being returned for me. any word on a work around for this?

@nealalpert
Copy link

After some investigation we narrowed down the issue to

connection = S3Connection(is_secure=options.secure, host=options.host)

The initial connection uses boto.s3.connect_to_region but the child processes do not.

Swapping this line for

connection = boto.s3.connect_to_region(options.bucket_region,
is_secure=options.secure,
)

seemed to fix our issue and allow us to upload to a region other than us-east-1.

@timdau
Copy link

timdau commented Oct 21, 2022

To use a non-default region you must specify both the --bucket_region and the --host, as follows:
s3-parallel-put --bucket=$BUCKET . --bucket_region=ca-central-1 --host=s3.ca-central-1.amazonaws.com

The S3 Endpoints can be found here https://docs.aws.amazon.com/general/latest/gr/s3.html

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

8 participants