-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Issue uploading file with io.js or node > 0.11.6 #2427
Comments
You can visit for working code in https://github.com/pandeysoni/Hapi-file-upload-download
|
Hey @pandeysoni, Thanks for the example. Just to clarify, it is not that I'm not able to get file upload to work, I have a working application using 0.10.30. The issue is that in versions of node > 0.11.6 and in io.js instead of always getting a 400 in the request I sometimes get the error mentioned above. |
Hi @dschenkelman, I cloned your github repo and i tested with node : v0.10.31 and it is throwing error with version 0.10 also. |
Have just tried running 10 times with node 0.10.30 and did not get the error. Running 5 times with io.js 1.2.0 I got the error 4 times. |
I had a look at this. I am unable to reproduce the error on node 0.12. I ran the client 50'ish times. Which system are you on? |
It's on windows 7. |
Sorry forgot to include it here, had added it to the sample project. Ubuntu 14.04.1 LTS. |
Ok, so this is a very tricky issue. This is indeed a bug in Hapi and in fact not related to new versions of node. I have been able to create a test case which fails on both 0.10, 0.12, and io.js. The error occurs when the client payload is not consumed on a request with the |
Wow, you were quick to find that. I spent some time going through Hapi's code but couldn't figure out the cause. I tried the fix in the machine were I could reproduce the issue and it seems to be fixed. Thanks a lot for the time and effort. |
So, it's 2 years later now and it seems that this is in fact a node.js bug, which I have reported here: nodejs/node#12339. The serverside fix just mitigated the client-side issue. |
When trying to migrate my app to either node 0.12 or io.js (any version) I started seeing an issue that is not always reproduced (seems to be a race condition of some sort) when uploading files.
Basically, when uploading a file larger than that allowed by the payload
maxBytes
we get an error:This does not happen if the size of the file is under the limit.
I put together a repository that reproduces the issue: https://github.com/dschenkelman/hapi-upload-iojs.
The text was updated successfully, but these errors were encountered: