Copy from S3 to S3 fails
gerhardj-b opened this issue · 4 comments
When specifying a copy source which is a location in an S3 Bucket, the Operation cuts of the first character from the Bucket name.
Example with the official cli:
root@docker-desktop:/$ aws s3 --endpoint-url http://$MY_S3_NINJA cp s3://testbucket/testfile s3://testbucket/newtestfile
copy failed: s3://testbucket/testfile to s3://testbucket/newtestfile An error occurred (NoSuchBucket) when calling the CopyObject operation: Source bucket 'estbucket' does not exist
I suspect the substring here to be the culprit.
Amazon API Documentation here
Thanks for reporting this, @gerhardj-b – Apparently, the aws
CLI sends the copy header without leading path delimiter while the Java library does. (The new test cases are thus a bit pointless.)
Awesome, thanks. I read the API description also as not expecting a leading delimiter. Anyways, thanks for the extra check and solution for both cases.
For internal reference: The original error is reproduced via with access credentials taken from http://localhost:9444/ui
$ aws configure --profile s3ninja
$ export AWS_PROFILE=s3ninja
$ aws s3 --endpoint-url http://localhost:9444 cp s3://bucket1/file1 s3://bucket2/file2.pdf
Released with version 8.3.2