question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

lib-storage Upload working but result is missing

See original GitHub issue

Describe the bug

Hello there,

Since 3.26.0 the Upload command from lib-storage does not return the same data and therefore is not usable

Edit: to clarify : the file is sent correctly to the bucket, but the result is not correct

Your environment

SDK version number

@aws-sdk/client-s3: 3.26.0 and 3.27.0
@aws-sdk/lib-storage: 3.26.0 and 3.27.0

Is the issue in the browser/Node.js/ReactNative?

Node.js

Details of the browser/Node.js/ReactNative version

▶ node -v
v16.2.0

Steps to reproduce

const client = new S3({
    region,
    credentials: {
        accessKeyId,
        secretAccessKey,
     },
 })
const params = {
    Bucket: bucket,
    Key: filename,
    Body: file,
    ACL: 'public-read',
    ContentType: type,
}

const upload = new Upload({
    client,
    queueSize: 3,
    params,
})
const data = await upload.done()

console.log({ data })

Observed behavior

With 3.26.0 and 3.27.0, the content of data is

{
  data: {
    '$metadata': {
      httpStatusCode: 200,
      requestId: undefined,
      extendedRequestId: 'dD4fCNw0SfXPpz6AKXc......',
      cfId: undefined,
      attempts: 1,
      totalRetryDelay: 0
    },
    BucketKeyEnabled: undefined,
    ETag: '"8e79af4e71fa......."',
    Expiration: undefined,
    RequestCharged: undefined,
    SSECustomerAlgorithm: undefined,
    SSECustomerKeyMD5: undefined,
    SSEKMSEncryptionContext: undefined,
    SSEKMSKeyId: undefined,
    ServerSideEncryption: 'AES256',
    VersionId: 'OCh1_......'
  }
}

Expected behavior

with 3.25.0 the result is

{
  data: {
    '$metadata': {
      httpStatusCode: 200,
      requestId: undefined,
      extendedRequestId: 'H2cT3+QuQ3vG2/fBtj/GP8g...',
      cfId: undefined,
      attempts: 1,
      totalRetryDelay: 0
    },
    Bucket: 'The name of the bucket',
    BucketKeyEnabled: undefined,
    ETag: '"5a101d2..."',
    Expiration: undefined,
    Key: 'the key provided',
    Location: 'https://xxx.s3.eu-central-1.amazonaws.com/the key provided',
    RequestCharged: undefined,
    SSEKMSKeyId: undefined,
    ServerSideEncryption: 'AES256',
    VersionId: '28mF6wpfmGAe...'
  }
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:9
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ajredniwjacommented, Dec 6, 2021

@samchungy thanks for the PR, I have had someone look at it, can you please address the comments. Thanks for your contribution as well.

1reaction
wallindcommented, Sep 22, 2021

Run into the same problem, see #2675.

ditto^. experiencing same problem trying to upgrade from v2 -> v3 for bundle size reduction benefits. Downgrading to 3.25.0 works for me as well as a temporary fix. Bumping to hopefully get this rectified.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Amazon S3 bucket file upload response is not available
I have whole code using multer and aws-sdk. include this files and npm install all //aws s3 packages const aws = require("aws-sdk"); const ......
Read more >
Resolve errors uploading data to or downloading ...
I want to download data from Amazon Aurora and upload it to Amazon S3. How can I resolve an error I received while...
Read more >
Resolve issues with uploading large files in Amazon S3
I'm trying to upload a large file (1 GB or larger) to Amazon Simple Storage ... A multipart upload can result in faster...
Read more >
Migrating to AWS SDK v3 for Javascript
tips, gotchas and surprises with the new AWS SDK. ... @aws-sdk/lib-dynamodb; The implementation for s3.upload is now in @aws-sdk/lib-storage ...
Read more >
[solved] AWS S3 - File uploads - Get Help and Help Others
Actually with text files is working correctly but using images, the files are uploading to the bucket but not showing correctly (looks like...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found