I have a problem is the uploading will be broken as content too large, even the size of a file is not reach the limits. But this situation only appear in containers mode. When I use local mode, it disappears.
For example, I have change the docker/nginx/conf.d/default.conf as below:
location / {
uwsgi_pass ui_server;
include uwsgi_params;
[......]
# Max upload size (except for files) is set to 100mb as default.
client_max_body_size 100m;
}
## Most API
location /api {
uwsgi_pass api_server;
include uwsgi_params;
[......]
# Max upload size (except for files) is set to 100mb as default.
client_max_body_size 100m;
}
location ~ /api/records/.+/draft/files/.+/content {
gzip off;
uwsgi_pass api_server;
include uwsgi_params;
[......]
# Max upload size for files is set to 50GB (configure as needed).
client_max_body_size 50G;
}
When I run server with invenio-cli run, I can upload a 10GB filel; But if I run server with invenio-cli containers start --no-demo-data, the progress will break at 2% and F12 check the errer,
Before digging in nginx configurations, did you check if you have mounted a volume, that can contain large files? It could be simply that you don’t have enough space in the Docker container. Here it does not look like that we mount a volume.
I checked the filesystem. Because I didn’t use s3 file system, so the local storage was used. The path of data is /opt/invenio/var/instance/data/, and it has all the files attaching in old records actually.
The Discard may not be open due to regional restrictions. The nginx config was the same as github, the only change is adding the 80 port in HTTPS server and discarding it from HTTP server. So my default.conf is look like:
upstream ui_server {
server web-ui:5000 fail_timeout=0;
}
upstream api_server {
server web-api:5000 fail_timeout=0;
}
# HTTPS server
server {
listen 80;
listen [::]:80;
listen 443 ssl; # IPv4
listen [::]:443 ssl; # IPv6
server_name _;
charset utf-8;
keepalive_timeout 5;
[......]
# Max upload size for files is set to 50GB (configure as needed).
client_max_body_size 50G;
}
# Static content is served directly by nginx and not the application server.
location /static {
alias /opt/invenio/var/instance/static;
autoindex off;
}
}
Thank you for the reminder, I check the config again. The config of nginx in InvenioRDM is used like mentioned above, but there is another nginx in the top of the server. The engineer bind our site to InvenioRDM server, so the content size was limited by the site config. After changing the config of site, the large file was uploaded successfully.