Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Error: MultipartParser.end(): stream ended unexpectedly: state = START #744

lookfirst opened this Issue · 4 comments

3 participants


I'm using latest connect and I'm getting these exceptions below (from formidable) are thrown up. The issue is that I'm on heroku and every time one of these gets thrown my instance dies. According to the author of formidable, he thinks that this gets thrown because a connection dies before the end of the request (felixge/node-formidable#190 (comment)), which is entirely possible. He also thinks this is better discussed here (felixge/node-formidable#190 (comment)), so here I am.

I've tried to setup a middleware to 'catch' these errors and prevent my instance from being killed, but it seems to get thrown up before any middleware can catch it.

Error: MultipartParser.end(): stream ended unexpectedly: state = START
    at MultipartParser.end (/app/node_modules/express/node_modules/connect/node_modules/formidable/lib/multipart_parser.js:306:12)
    at IncomingMessage.IncomingForm.parse.fields (/app/node_modules/express/node_modules/connect/node_modules/formidable/lib/incoming_form.js:102:30)
    at IncomingMessage.EventEmitter.emit (events.js:93:17)
    at IncomingMessage._emitEnd (http.js:366:10)
    at HTTPParser.parserOnMessageComplete [as onMessageComplete] (http.js:149:23)
    at Socket.socket.ondata (http.js:1704:22)
    at TCP.onread (net.js:403:27)

Issue #673 also looks like it should get rid of formidable, but no progress on it in 4 months. What happened?

Anyway, I'd love to find out how to at least catch these errors so that I can prevent my instances from being killed. Thanks!

tj commented

node version?


0.8.14 (heroku latest)

tj commented

hmm, if it's not giving us an "error" even that definitely seems like more of a formidable bug


reopen if it still exists with multiparty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.