Closed YonatanHanan closed 2 years ago
Hello,
Are you 100% sure about your bucket name? eu-central-1
and us-east-1
are in the same partition (https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html). It should be impossible to have 2 buckets with the same name.
Can you call the list objects command (https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-s3/interfaces/listobjectsv2commandinput.html#bucket) from the s3Client on the bucket?
Yep there's 100% an error with the bucket name or the region.
http://users-files-prod.s3-website.us-east-1.amazonaws.com/ returns:
400 Bad Request
Code: IncorrectEndpoint
Message: The specified bucket exists in another region. Please direct requests to the specified endpoint.
Endpoint: users-files-prod.s3-website.eu-central-1.amazonaws.com
RequestId: E9CJDXTW9HXES157
HostId: J0QSQbeCzfEkdgSYITFIbK0A69ZbnOkZ4j55tsj9YaIMRdvKRsXVfHQFqG47JkcLTuFlyrE7w+c=
the bucket is private, so maybe the error is because of that?
Nope. Even private buckets that don't have a website respond to this query. Look: http://s3-sync-client.s3-website.eu-west-3.amazonaws.com. If your bucket name is really users-files-prod you should contact Amazon because it's theoretically impossible.
OK, is it possible to sync a "folder" inside an s3 bucket? await sync(
s3://users-files-prod/${srcPath},
s3://${destPath});
Yes and it is straight forward for simple cases. You can use filters
and relocations
options for complex cases (e.g. if you want to filter some data or change the target bucket structure). You have many examples in the test folder of the repo.
ok thanks for the help :)
Hi,
I'm trying to copy one s3 bucket to another one. this is the code:
but i get
and the request was to
users-files-prod.s3.eu-central-1.amazonaws.com
and not to us-east-1what am i doing wrong?