No way to update metadata in copyObject
See original GitHub issueHello,
I am trying to use copyObject
to copy a file over itself while updating lastModified
on it. However, this fails with this error:
S3Error: This copy request is illegal because it is trying to copy an object to itself without changing the object's metadata, storage class, website redirect location or encryption attributes.
I’ve noticed that some of the other client libraries do include metadata fields in their copyObject
- however I can also see how adding a parameter would introduce a potentially breaking change.
I can work with either of these two solutions:
- Update lastModified when copying an object onto itself
- Adding a parameter for new metadata
- Adding an overflow method that replaces the
conditions
parameter with an object (an example):
const conds = new Minio.CopyConditions();
const options = {
conditions: conds,
metadata: {
lastModified: new Date()
}
}
client.copyObject('bucket', 'prefix/file', '/bucket/prefix/file', options, callback);
For now I will have to stick with the download/reupload workaround - but using copyObject
will be far more efficient.
Thank you!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:8 (3 by maintainers)
Top Results From Across the Web
No way to update metadata in copyObject · Issue #1192 - GitHub
Hello, I am trying to use copyObject to copy a file over itself while updating lastModified on it. However, this fails with this...
Read more >How to update metadata on an existing object in s3 using ...
My metadata is updated and my original file does not get overwritten and deleted. I used the documentation from here. So my PUT...
Read more >CopyObject - Amazon Simple Storage Service
When copying an object, you can preserve all metadata (default) or specify new metadata. However, the ACL is not preserved and is set...
Read more >Amazon S3 - Copy object(s)
... the original ones, move objects across Amazon S3 locations and update object metadata by copying original objects to new ones that contain...
Read more >Creating Tables In A S3 Bucket Issues - Ahana Cloud
Copy the object over again using S3 command line or python script. Note: Since S3 is an immutable store, so there is no...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The code below is Python.
Now I am using this method to update metadata. I hope we will have the function to update metadata directly.
Why is this issue relevant to current
minio-py
?