CLI Import - Gateway Timeout
I was able to successfully import most of my files but there are about 200 or so that the CLI import tool isn't happy about. I'm going to venture a guess it has something to do regarding the size of the files.
I
cd
to my directory of folders/files I want to upload and run: docker run -it --rm -v "$(pwd)":/import ghcr.io/immich-app/immich-cli:latest upload --key <redacted> --server https://photos.domain.com/api -t 10
. It runs for awhile and eventually outputs a bunch of `504 Gateway Time-out. The server didn't respond in time." Any ideas how I can fix this? It's probably hitting an upload size limit.23 Replies
Example output:
What version of the server are you using?
1.43.1
It uploaded the majority of those without issue. Having issues with the last 198. It was at 202 before so it was able to randomly make it through 4 this last pass.
And the one from the error appeared to be a video. Are you communicating through any proxy or connecting directly to let 2283?
going through haproxy. let me attempt directly.
So that solved the initial issue. I also rectified it with HAProxy by increasing Server Timeout from the default
30s
. For now I increased it to 5m
and I no longer get the 504 Gateway Time-out
errors. However now I've got a new issue. Anyway to increase the verbosity of the output?
Just to be clear,the above output is connecting directly, not through HAProxy just to remove that from the equation.Hmmm. Did it successfully upload, but just print out that warning?
It seems to think there are 175 assets that haven't been uploaded
I don't think there is any logging in the CLI
Doesn't appear to have uploaded either
Are they all movies/videos?
Hard to tell what the 175 are it thinks need to be uploaded
didn't find that mov, let me try that jpg next. those are the only 2 file names that show up in the output, other than when it's iterating through files. What I pasted is literally all I see in the output now.
Same with the jpg, so no, not all movies/videos it seems:
Other things from that day uploaded with no issue:
Hmm, usually i have a few guesses of what could be going on but this is pretty new for me.
What version of node are you running out of curiosity?
And is the CPU maxed during upload?
This lives in a VM and given it 10 cores. Running the process again and I'd say it's averaging about 50% cpu
The immich-server process?
36-40%
no combination of ffmpeg, node and nginx
I'd definitely try with node 16. I didn't think it would even complete with version 12
but isn't node running inside the container? probably should see what version is running inside there
just for giggles, i'm going to restart everything and see if something is just "stuck"
Oh, i didn't realize you were using the docker container
Seems there were some ffmpeg processes that might have been orphaned due to the original HAProxy issue. Now it's sitting at <3% while running the process. Outcome was the same.
Yea, sorry, probably should have included that for ya...
Now I'm starting to wonder if I should nuke the volume and start from scratch. Wondering if the server timeout from the proxy caused some files to be in purgatory
Yeah, sorry I couldn't be more help. Not sure what else to try
I'm happy to dig into the db for you if you think it would be helpful, but seems most prefer nginx for the proxy of choice here vs haproxy. I might be an edge case.
The proxy timeout shouldn't really be an issue
It just means the server didn't respond soon enough, but everything else would have worked fine
shrug i'll wipe and re-upload. not a big deal. however, for those that may search, you definitely need to increase your Server Time Out >30s when using HAProxy. Normally the default would be fine. Only becomes an issue for large files, which is why it seems to mostly affect videos.