If I upload a small file using S3.upload() and specify tagging then the tags are applied. If however, the file is larger than 15M and under the hood upload uses a multipart upload then the tags are silently not applied.
const AWS = require('aws-sdk')
const fs = require('fs')
const s3 = new AWS.S3({
region: 'ap-southeast-2',
credentials: new AWS.SharedIniFileCredentials(),
})
s3.upload(
{
Bucket: 'vigil.media.dev-damon',
Key: 'test.upload.big',
Tagging: 'someKey=someValue',
Body: fs.createReadStream('./some-big.file'),
},
(err, data) => {
if (err) {
console.errro(err)
} else {
console.dir(data)
}
}
)
And then check if tags applied:
$ aws s3api get-object-tagging --bucket vigil.media.dev-damon --region ap-southeast-2 --key test.upload.big
{
"TagSet": []
}
If ./some-big.file is changed to something less than 15M then checking the tags afterwards show they have been applied.
AWS SDK 2.28.0
Node v7.7.3
MacOS 10.12.3
@damonmaria
It looks like S3 supports tagging a multi-part upload only after it has finished uploading. I think it should be safe for us to call putObjectTagging after a multi-part upload, though that will mean an extra request.
@chrisradek Although an extra request it is a multipart upload so is already multiple requests. When uploading a large file you're not expecting millisecond latency.
@damonmaria
Agreed. I've marked this as a bug. Our plan is to make the extra request if upload does a multi-part upload. I'll comment here once we have a PR up.
Is this documented anywhere? Judging by the linked PR, callers should be using this like so
s3.upload(
{
Bucket: 'BUCKET',
Key: 'KEY',
Body: Buffer.from('some data')
},
{
tags: [
{
Key: 'key',
Value: 'value',
},
{
Key: 'otherKey',
Value: 'otherValue',
},
],
}
);
instead of passing a Tagging string option in the first argument to upload. However, this is not documented in the JS SDK docs.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.
Most helpful comment
Is this documented anywhere? Judging by the linked PR, callers should be using this like so
instead of passing a
Taggingstring option in the first argument toupload. However, this is not documented in the JS SDK docs.