You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When performing a cross-region S3 copy operation using Boto3 (or the AWS CLI), the SourceClient parameter in Boto3 and the --endpoint-url parameter in the AWS CLI are not applied consistently. This results in errors when attempting to copy objects from a source bucket in one region to a destination bucket in another region.
Note that this was tested on Scaleway, not on AWS.
Regression Issue
Select this option if this issue appears to be a regression.
Expected Behavior
Using Boto3 client's copy command to copy object from one bucket (in one region) to another bucket (in another region).
Current Behavior
Expected Behavior: The object should copy successfully from the source bucket to the destination bucket across regions, using the SourceClient to correctly resolve the source bucket's region.
Actual Behaviour: an error is raised.
botocore.exceptions.ClientError: An error occurred (NoSuchBucket) when calling the CopyObject operation: The specified bucket does not exist
The copy command does not use information from the SourceClient input, and only uses the info (credentials, location, etc.) from the client on which the copy method was called.
I also tried this with the aws cli, but got the same results:
Describe the bug
When performing a cross-region S3 copy operation using Boto3 (or the AWS CLI), the
SourceClient
parameter in Boto3 and the--endpoint-url
parameter in the AWS CLI are not applied consistently. This results in errors when attempting to copy objects from a source bucket in one region to a destination bucket in another region.Note that this was tested on Scaleway, not on AWS.
Regression Issue
Expected Behavior
Using Boto3 client's copy command to copy object from one bucket (in one region) to another bucket (in another region).
Current Behavior
Expected Behavior: The object should copy successfully from the source bucket to the destination bucket across regions, using the SourceClient to correctly resolve the source bucket's region.
Actual Behaviour: an error is raised.
The copy command does not use information from the
SourceClient
input, and only uses the info (credentials, location, etc.) from the client on which the copy method was called.I also tried this with the aws cli, but got the same results:
The aws cli seems to fall back on an amazonaws endpoint:
Reproduction Steps
Possible Solution
I could not get it to work using boto3, but I managed to get a solution that was acceptable to me using rclone.
Example config to be placed in
~.conf/rclone/rclone.conf
:sync the source to the destination one-way:
Additional Information/Context
No response
SDK version used
boto3='1.35.66'
Environment details (OS name and version, etc.)
Python 3.11.2 (main, Mar 7 2023, 16:53:12) [GCC 12.2.1 20230201] on linux
The text was updated successfully, but these errors were encountered: