-
Notifications
You must be signed in to change notification settings - Fork 163
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
Throws an unlistenable error #108
Comments
Hi! There seems to be a lot of link following and reading to do. Would you be willing, really quick, just to post the err.stack of the uncatchable error? |
Absolutely.
btw thanks for the quick response ^__^ |
Thank you! And hopefully the last question I wasn't able to figure out yet from the links: what version of Node.js are you getting this on? |
v0.12.2 also no good on v0.10.38 |
So your gist https://gist.github.com/formula1/582b2acb8c1e6513fe1a seems to be the easiest way for me to reproduce (thanks!), but what are the instructions to run it? |
Actually, I think I figured it out; seems like it was not compatible with Windows out of the box so I had to make some changes. |
I apologize, I was running it on ubuntu and was trying to write things kinda quickly : / |
There is nothing un-catchable here; you're catching it in your own code. If there were an unhandled error, the The something in the |
Well, let me re-open until I can tell you where the issue is. |
Sorry, seems I'm going in some circles as well, lol. Please hang on (: |
server.js does close down for me for both superagent-bad and request-bad : / Oh wow, didn't realize walmart labs has their own parser. Will definitely check that out after I'm done with work today |
Yea, I saw that as well. For me it does it sporadically and didn't experience that before my original post and after making lots of them, it closed down eventually for me. |
I have figured it out: there is an issue in |
Ah! sounds like a job for process.nextTick For what its worth, Throwing an error is definitely better than busboys situation. When things go silently, I get really worried... |
Haha. Don't worry, I'm working on a fix for this right now :) |
Ok, can you tell me if the new |
I'm definitely recieving an emitted error! But I'm still recieving a global error. Is it possible its being thrown twice? I believe I'm pulling from the right repo. Also updated the logging so we know who's error is whos |
What does this mean? Your program is crashing? If it's not, what does "global error" mean? Remember, according to our docs, errors are always emitted on the |
global error comes from https://gist.github.com/formula1/582b2acb8c1e6513fe1a#file-server-js-L98 It could be because the socket hangs up the req emits an error after, are you unpiping after your done? Perhaps I should unpipe This might be a two for one! |
I'm not sure what you mean. I'm not getting that anymore, though. It's possible that you're not actually using the new code. Can you confirm the file contents of our |
With the updated multiparty, I've made 2,000 requests so far and nothing hitting your new "GLOBAL" logging. Prior to the fix, I typically only had to make 4-8 requests before it hit. |
removed node_modules, cleaned cache and installed clean still an error only listening to form, still an error hm... should I throw it? I'm basing all of my issue of the gist, If you think anything should be changed there let me know. I think you can edit it also |
Ok. And, did you confirm the |
What operating system are you on? |
I only have Windows 7 x64. |
Wait a minute, why did you remove the |
From the readme:
If you don't have the error listener on the part, of course you would be getting GLOBAL errors still... |
I'm going to close this issue since I can reproduce the issue with your latest code, and the reason is because you remove the part error handling, which is required. If you add it back, it doesn't crash any longer, since you're handling the error now. It seems that when I first pulled, you didn't have pushed up the commit that removed the error handling. I had pulled again and then there was a new commit after the GLOBAL commit that removed error handling, letting me error out again, but you cannot actually remove that error handling, of course. |
I was about to close it! |
yay! So @formula1 I'm going to release this as a patch release tonight unless you realize there is some issue :) I really appreciate the bug report! This was definitely a "nasty" one to figure out, test, and confirm :D |
No issue, i am glad everything was sorted out so quickly! |
@formula1 this fix is published in 4.1.2 |
@formula1 am still having Error: stream ended unexpectedly and the multiparty is 4.1.2, but I would like you to please look through my code to checkout what am doing if it's right var uuid = require('node-uuid'), exports.create = function(req, res){ console.log(req.body, req.files); //Parse Form form.on('error', function(err) { form.parse(req, function(err, fields, files){
}); |
https://github.com/andrewrk/node-multiparty/blob/master/index.js#L731
This is associated to situations when a multi-part form is artificially created by means of form-data however no "transfer-encoding: chunked" is provided in the request headers. This will lead to the post data being improperly handled, however more importantly should throw an error. Multiparty does throw an error however its uncatchable. I'm quite confident I'm watching all error events possible. If not, let me know.
This is especially bad as it can turn into an exploit unless the there is a global listener for errors. Though there is little to no context associated if it is listened for globally.
form-data/form-data#108
The text was updated successfully, but these errors were encountered: