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

Metadata will be lost when using s3TransferManager to copy large file #5049

Closed
SinnoSong opened this issue Mar 27, 2024 · 3 comments
Closed
Labels
guidance Question that needs advice or information. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days.

Comments

@SinnoSong
Copy link

SinnoSong commented Mar 27, 2024

Describe the bug

I have a large file(2.5GB), I use S3TransferManager copy the object to another key.

Expected Behavior

A new file will be created, and the new file contains original metadata.

Current Behavior

The new file be created, but it does not have the original metadata.

Reproduction Steps

Here is my code:

CopyObjectRequest request = CopyObjectRequest.builder().sourceBucket(bucket).sourceKey(key)
                .destinationBucket(destinationBucket).destinationKey(newKey).metadataDirective(MetadataDirective.COPY).build();
        var copyRequest = CopyRequest.builder().copyObjectRequest(request).build();
        s3TransferManager.copy(copyRequest).completionFuture().join();

Possible Solution

No response

Additional Information/Context

No response

AWS Java SDK version used

2.25.16
aws-crt used version 0.29.13

JDK version used

jdk17

Operating System and version

aws lambda java17

@SinnoSong SinnoSong added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Mar 27, 2024
@zoewangg
Copy link
Contributor

Hi @SinnoSong, this is the expected behavior.

Note that for multipart copy request, existing metadata stored in the source object is NOT copied to the destination object; if required, you can retrieve the metadata from the source object and set it explicitly in the @link CopyObjectRequest.Builder#metadata(Map)}.

https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/transfer/s3/S3TransferManager.html#copy(software.amazon.awssdk.transfer.s3.model.CopyRequest)

@zoewangg zoewangg added guidance Question that needs advice or information. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. and removed bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Mar 27, 2024
@SinnoSong
Copy link
Author

@zoewangg Thank you.

Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guidance Question that needs advice or information. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days.
Projects
None yet
Development

No branches or pull requests

2 participants