Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The node crashes when receives stream requests #59

Open
aaitor opened this issue Nov 29, 2022 · 0 comments
Open

The node crashes when receives stream requests #59

aaitor opened this issue Nov 29, 2022 · 0 comments
Labels
bug Something isn't working refactor

Comments

@aaitor
Copy link
Member

aaitor commented Nov 29, 2022

Describe the bug

The node crashes when receives stream requests

To Reproduce

Any of this code integrations to use the upload endpoints kill the node service

             const stream = createReadStream(data)
             form.append('file', stream)

// OR

            const stream = new ReadableStreamBuffer({
                frequency: 10,      // in milliseconds.
                chunkSize: 2048     // in bytes.
              })
            stream.put(data, "utf8")
            form.append('file', stream)
            
// OR 

            const stream = new Readable()
            // // eslint-disable-next-line @typescript-eslint/no-empty-function
            stream._read = () => {} // _read is required but you can noop it
            stream.push(buffer)
            stream.push(null)
            form.append('file', stream)
node:events:491
      throw er; // Unhandled 'error' event
      ^

Error: Unexpected end of form
    at Multipart._final (/node_modules/busboy/lib/types/multipart.js:588:17)
    at callFinal (node:internal/streams/writable:696:27)
    at prefinish (node:internal/streams/writable:725:7)
    at finishMaybe (node:internal/streams/writable:735:5)
    at Multipart.Writable.end (node:internal/streams/writable:633:5)
    at IncomingMessage.onend (node:internal/streams/readable:693:10)
    at Object.onceWrapper (node:events:627:28)
    at IncomingMessage.emit (node:events:525:35)
    at IncomingMessage.emit (node:domain:489:12)
    at endReadableNT (node:internal/streams/readable:1358:12)
Emitted 'error' event on FileStream instance at:
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Expected behavior

The node returns a HTTP error code and don't die

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working refactor
Projects
None yet
Development

No branches or pull requests

2 participants