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.

[BUG][aws_s3_stream_file] Error when streaming SVG files - A header you provided implies functionality that is not implemented - Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.

See original GitHub issue

Describe the bug I’m getting an error when trying to store a SVG file into S3.

I tried using https://dl.airtable.com/.attachments/7d49003c78419a9857790918194e931d/2ea5ca4f/US-logo-black.svg file.

A header you provided implies functionality that is not implemented
at null.throwDefaultError (/tmp/__pdg__/dist/code/5fa66f4f464d941ad29e6e7e2b6af89ad402468ecb870a0cb26e3877cae07f21/node_modules/.pnpm/@aws-sdk+smithy-client@3.186.0/node_modules/@aws-sdk/smithy-client/dist-cjs/default-error-handler.js:8:22)
    at null.deserializeAws_restXmlPutObjectCommandError (/tmp/__pdg__/dist/code/5fa66f4f464d941ad29e6e7e2b6af89ad402468ecb870a0cb26e3877cae07f21/node_modules/.pnpm/@aws-sdk+client-s3@3.186.0/node_modules/@aws-sdk/client-s3/dist-cjs/protocols/Aws_restXml.js:5781:43)
    at process.processTicksAndRejections (internal/process/task_queues.js:95:5)
    at null.null (/tmp/__pdg__/dist/code/5fa66f4f464d941ad29e6e7e2b6af89ad402468ecb870a0cb26e3877cae07f21/node_modules/.pnpm/@aws-sdk+middleware-serde@3.186.0/node_modules/@aws-sdk/middleware-serde/dist-cjs/deserializerMiddleware.js:7:24)
    at null.null (/tmp/__pdg__/dist/code/5fa66f4f464d941ad29e6e7e2b6af89ad402468ecb870a0cb26e3877cae07f21/node_modules/.pnpm/@aws-sdk+middleware-signing@3.186.0/node_modules/@aws-sdk/middleware-signing/dist-cjs/middleware.js:13:20)
    at StandardRetryStrategy.retry (/tmp/__pdg__/dist/code/5fa66f4f464d941ad29e6e7e2b6af89ad402468ecb870a0cb26e3877cae07f21/node_modules/.pnpm/@aws-sdk+middleware-retry@3.186.0/node_modules/@aws-sdk/middleware-retry/dist-cjs/StandardRetryStrategy.js:51:46)
    at null.null (/tmp/__pdg__/dist/code/5fa66f4f464d941ad29e6e7e2b6af89ad402468ecb870a0cb26e3877cae07f21/node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.186.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-cjs/flexibleChecksumsMiddleware.js:56:20)
    at null.null (/tmp/__pdg__/dist/code/5fa66f4f464d941ad29e6e7e2b6af89ad402468ecb870a0cb26e3877cae07f21/node_modules/.pnpm/@aws-sdk+middleware-logger@3.186.0/node_modules/@aws-sdk/middleware-logger/dist-cjs/loggerMiddleware.js:6:22)
    at Object.run (file:///tmp/__pdg__/dist/code/5fa66f4f464d941ad29e6e7e2b6af89ad402468ecb870a0cb26e3877cae07f21/code/actions/s3-stream-file/s3-stream-file.mjs:23:22)
    at global.executeComponent (/var/task/launch_worker.js:146:22)

Logs detail

Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.

To Reproduce See Video

Expected behavior It should work for SVG as it does for PNG.

Screenshots image

image

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari] Brave
  • Version [e.g. 22]

Additional context I believe SVG need to be handled differently?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
Vadorequestcommented, Nov 2, 2022

Indeed, had to update the action. All good now! Thanks!

1reaction
vunguyenhungcommented, Oct 11, 2022

Hello @Vadorequest, thank you so much for providing a very clear detail. I have added this to our component backlog. Please subscribe to this issue as all updates will be made to this issue 🙏

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to upload a stream to S3 with AWS SDK v3
In v3 you can use the Upload class from @aws-sdk/lib-storage to do multipart uploads. Seems like there might be no mention of this...
Read more >
PutObject - Amazon Simple Storage Service
When you use this header, Amazon S3 checks the object against the provided MD5 value and, if they do not match, returns an...
Read more >
put-object — AWS CLI 2.9.11 Command Reference
When you use this header, Amazon S3 checks the object against the provided MD5 value and, if they do not match, returns an...
Read more >
Pass a stream to S3 putObject using AWS SDK for JavaScript v3
NotImplemented : A header you provided implies functionality that is ... Instead you can use Upload within @aws-sdk/lib-storage to get this ...
Read more >
AWS S3 with Java - Reactive Support
Explore the basics of using the reactive extensions available in the AWS SDK V2 library.
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