Set client_max_body_size via docker env file?
I am using the default docker compose stack.
I use the CLI tool to upload and find that very large files fail. I believe this is due to the default 50000M file size limitation within the immich proxy config.
Is it possible to use a docker enviornment variable to set this aspect of the proxy config?
20 Replies
what is your very large file size?
I'm seeing failures of a few hundred files, all of them are videos. File sizes range but mostly are in the 1GB - 10GB range
are you uploading over your dns or local IP?
FWIW, several thousand still images and lots of smaller videos were uploaded correctly.
I am uploading using local IP
immich upload --key <API KEY> --server http://192.168.110.14:2283/api /mnt/remotes/TRUENAS.CHARLES.HOME_Photos/2023 --recursive --import192.168.110.14 is the IP of the ubuntu VM on my local network that is running the immich docker stack
You are using the import feature, correct?
yes, for the read-only gallery
If you're using import then nginx limits should not be involved at all
for read-only library, the file don't actually get uploaded
what failure are you seeing?
ok. thank you both, will need to look into this further then.
I was previously seeing 504 gateway errors shown in the CLI output after completion of the immich cli script running
I just tried to re-run it to get the full output for you, but now the output does not show any error, it just stops before importing all files
I re-ran the immich cli import tool, this time from the immich-server container
I get this gateway timeout error failure
what is your server spec?
When you import a file it actually reads it from disk and hashes it. For large files this could take awhile and the http request could be timing out while it waits for the hashing to finish. The file is probably successfully importing though.
You may want to try running the command on the immich-server container directly and use http://localhost:3001 as the server url I believe. This would bypass the Nginx timeouts.
immich is running via docker stack on an ubuntu VM.
VM is allocated 8GiB RAM and 4x vCPUs. Only containers running on this VM are the immich containers plus portainer agent.
VM is on an XCP-NG host that is running only this VM and 1 other.
Neither the VM or the VM host are under heavy load, but if immich typically requires more memory, I can allocate much more.
ok thanks. I will look a few of the filenames and see if they in fact do import despite the error messages. Not in front of my system currently, will report back today.
I have the same issue and this is the case. I get timeout errors but the images show up so 🤷🏽♂️
using
localhost:3001
fails with the following output:
Try without api in the url
use http://localhost:3001/ as the server urlSpecifically for import, the file hashing happens 100% on the server, while the http request is waiting for a response. Nginx has a timeout that says "If I don't get any data back from this request after X seconds, I'm going to drop the connection". If hashing on the server takes longer than X seconds, the connection is dropped, even though the code for hashing/importing is still running on the server.
looks like
http://localhost:3001
without /api
works properly. thanks guys
got it. that explains it. for me, I dont think theres any advantage in connecting via the proxy when I am running this from the CLI, I might as well just take out the middlemanYeah, exactly. If you can access the server container (while at home, etc.) it will always be faster/less error prone
going to submit a PR to the docs to clarify this on the read-only gallery page