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.

Invalid busboy behavior on incomplete multipart

See original GitHub issue

With busboy 0.2.9 when piping an incomplete multipart to busboy the last (incomplete) part is emitted on source end (field emitted, or file stream end emitted), then busboy stops emitting events (no file end, no finish, no error). It should instead emit an error: the multipart is invalid (because incomplete) and should not emit the current part, because it’s not finished.

head commit e70d9e462b21f5554c54aa16bc20620e5f5e3eff fixes part of this issue: now busboy emits an error (Error: Unexpected end of multipart data), but the current incomplete part is still emitted. For field events we should just not emit them and emit error on busboy. For file events we should emit error on file, on busboy or on both, I’m not sure which. Busboy also emits finish, I’m not sure if we want that in addition to the error event.

I’m not sure how to properly handle errors in a pipe involving multiple streams (in my case: http request incoming message, busboy, aws-sdk S3 upload; the S3 upload needs an explicit abort on source error, and the http request needs a reply): busboy readme doesn’t show any error handling example.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
thomas-riccardicommented, Jul 30, 2018

@tomasdev Sorry I don’t remember, it was too long ago, I stopped using node.js since.

0reactions
mscdexcommented, Dec 19, 2021

Closing this for now with the new implementation in master and with changes to node streams in general in modern versions of node. 'close' is now the event to listen for whether there was an error or not and 'finish' should only be emitted if there was no error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Discovering and Deleting Incomplete Multipart Uploads ... - AWS
If the complete multipart upload request isn't sent successfully, Amazon S3 will not assemble the parts and will not create any object. The ......
Read more >
apollo-upload-server | Yarn - Package Manager
Middleware and an Upload scalar to add support for GraphQL multipart requests (file uploads via queries and mutations) to various Node.js GraphQL servers....
Read more >
graphql-upload - npm
Middleware and an Upload scalar to add support for GraphQL multipart requests (file uploads via queries and mutations) to various Node.js ...
Read more >
5.x API - Express.js
Note: This is early beta documentation that may be incomplete and is still under ... use multipart-handling middleware like busboy, multer, formidable, ...
Read more >
S3 multipart upload presigned url - Caritas Castellaneta
The upload ID might be invalid, or the multipart upload might have been aborted ... Otherwise, the incomplete multipart upload becomes eligible for...
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