Comments (8)
-
What version of nginx are you seeing this 499 error with?
-
Is it the base nginx-upload-module plugin from repo that you are using or a modified version?
from nginx-upload-module.
-
nginx -V
nginx version: nginx/1.1.15 built by gcc 4.1.2 20080704 (Red Hat 4.1.2-52) TLS SNI support disabled configure arguments: --prefix=/etc/nginx/ --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_gzip_static_module --with-http_stub_status_module --with-ipv6 --with-debug --add-module=../nginx_upload_module-2.2.1 --add-module=../nginx_eval_module-1.0.3 --add-module=../mod_zip-1.1.6
-
I use original upload module compiled from source, without any modifications.
Actually, 499 error is not the main point. The state file inconsistency is much more bothers me.
from nginx-upload-module.
Someone approached me with similar problem before. I need more information in order to figure out what happens. Please provide some relevant debug logs.
from nginx-upload-module.
I've found the root cause of the problem.
Client sends last chunk, sets timeout and waits for the response.
Upload module handles upload, removes state-file (this is important!) and proxies request to backend specified in upload_pass directive. If backend is overloaded and doesn't response during client's timeout client close connection and repeat the same request. But this request is treated as new upload because state-file already removed.
I think the possible solution is do not remove state-file right after upload processing but remove it later, after response from backend. What do you think about this?
from nginx-upload-module.
Yes, we can choose not to remove the state files at all. In that case you can remove them later by running find ... | xargs rm script from cron.
In order to implement that, just outcomment lines 1520-1524 in this file:
https://github.com/vkholodkov/nginx-upload-module/blob/2.2/ngx_http_upload_module.c
However, this will produce duplicate requests on backend side and you have to deal with them somehow (with proper implementation it shouldn't be difficult).
from nginx-upload-module.
Is it safe to delete state-file in ngx_upload_cleanup_handler? This will require to add another flag in ngx_upload_cleanup_t like finished.
What do you think about this?
from nginx-upload-module.
Depends on the client. If client doesn't do simultaneous request, this should be okay. Otherwise it could lead to similar problems.
from nginx-upload-module.
I propose to add flag (finished, for example) indicating that file fully uploaded and to delete state-file in ngx_upload_cleanup_handler in case of finished && !aborted.
I do not understand why simultaneous requests will lead to the problems, could you please explain a bit more detailed?
from nginx-upload-module.
Related Issues (20)
- build error with boringssl
- File name of 25 characters or more, corrupt the upload_field_name.path in the http header HOT 4
- POST form data are lost when using chunk mode of blueimp-jQuery-File-Upload HOT 1
- Compile errors on windows HOT 4
- Upload failing with http2 HOT 3
- Problem with compiling 2.2 with nginx 1.19 HOT 3
- nginx崩溃 HOT 3
- Upload to fastcgi backend HOT 2
- web client cross domain, not work HOT 1
- chunked upload file hashes dropped
- behind upload_pass only can use php? HOT 5
- why `upload_pass_form_field` does not work HOT 3
- Hi, when will you release a new tag ? HOT 2
- Does this support http3? HOT 1
- Uploaded files do not appear in the directory HOT 1
- unable to build with nginx HOT 2
- Nginx error - Page is temporarily unavailable.
- upload_file_name
- upload_pass_form_field does not work HOT 1
- I don't want to use the proxy feature. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nginx-upload-module.