-
Notifications
You must be signed in to change notification settings - Fork 390
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
bug in resumable upload nginx #123
Comments
I don't see any issue here. You asked the system to clean up the file and it was cleaned up as per your log. |
Yes, but nginx throw out 400 when the file was not loaded. I do not know what to do :( I reproduce the bug in the following steps
|
timeout after 7,5 sec and 400 :( and sleanup 😭 |
I see HTTP/2.0 request in your log. upload module does not work with http/2.0. The reason 400 is returned is probably because of a bug in nginx. |
😮 not knew. Thank you so much |
@vkholodkov it is not true that the module doesn’t support http 2. There are even unit tests to ensure it functions, and we’ve been using it with http 2 for over a year now, when I added that functionality |
@fdintino I did not know that. @slavaslava56ru if so, then the issue is somewhere in your system or nginx itself. |
@vkholodkov Can you tell, Where to look for a problem? |
@slavaslava56ru can I ask you where you from and what do you do with nginx and nginx upload module? |
I am trying to upload a file in parts. I specifically turn off the Internet to check that if the part did not upload, then everything is ok. But sometimes at break the request remains hanging and eventually drops from 400 |
Are you uploading in the browser with the javascript File interface? If so, you would want to catch the error and retry the upload range that failed. This is how we have implemented a resumable upload with offline network error handling. If you are simply ignoring the error, it makes sense that the range that errored would be filled with null bytes. |
It might also be helpful to diagnose the issue if you provided a gist of the full debug log. |
Yes, through the js interface. Byte range is loaded again the same on which it broke. The problem is that nginx gives an error which clear ranges loaded before |
Oki, Now I will try to get a complete log |
may be reason in this directives
|
Is there any chance you have the directive |
upload_cleanup 400 404 500-599 |
I think what happens is that you get n == NGX_ERROR at this place in ngx_http_do_read_upload_client_request_body:
The 400 status codes is not appropriate here, because the request has not been received entirely. More appropriate code is NGX_HTTP_CLIENT_CLOSED_REQUEST. Please replace NGX_HTTP_BAD_REQUEST with NGX_HTTP_CLIENT_CLOSED_REQUEST and see if it helps your situation. |
Yes, @vkholodkov is right I believe. We're returning the wrong status code in that bit of code. That, combined with the If you were to change the
that would temporarily work around the bug, without requiring you to recompile nginx. But that's just a temporary hack. I have some time today, I'll implement the above fix and add a test for it. That said, it would still be helpful to get feedback about whether that is actually the fix that's needed in your case. |
Hmmm.... one other thing. Are you sure you recompiled the module with debug flags? I don't see any of the nginx-upload-module debug messages in the log file you posted. |
Sorry, that nginx build is gone, so I can’t say for sure |
you can use nginx -V to dump the full command line that was used to run your build |
Today will fix? |
I only ever get a 408 when I try to replicate your issue. Can you try applying @vkholodkov's patch and see if it fixes things for you? |
@fdintino ok, now see |
not fixed :( |
If you still get 400, this means your client sends something wrong, because other places where upload module return 400 are related to request validation. |
Hello. Have same problem, and this patch not fixed it, can u help me? |
Hey. I have a problem. When the Internet breaks, nginx gives http code 400. I have set cleanup on it by default. When the file is downloaded, a problem occurs. The upper bytes of the file are empty :( Can you tell me how to fix it? Besides removing 400 code from cleanup
The text was updated successfully, but these errors were encountered: