Invalid request body
Upon updating from 1.51.1 to 1.51.2 I receive an error message from the web and mobile app which reads "Invalid request body".
89 Replies
Thinking this might be related to #2019
I am not using the provided proxy service.
Please check for error logs in the server container and your browser/app
Web report 400 bad request
Don't see anything in the server container logs.
Check the web container
I am not using the provided proxy service.Did you set up the routing correctly?
Well I did notice there was a change from #2019 and I have yet to adapt that.
I'm thinking that is the likely cause at the moment.
That's not a change that should break anything
It's just a small improvement
Okay, well the proxy I have was working with 1.51.1
Is the IP of your proxy, as seen by immich-server, one of
?
Would I be able to find that in the logs?
I don't think so, but docker inspect should do it
I run 2 replicas of the webserver with the proxy and I see the address as 10.0.1.239 and 10.0.1.240
Why do you think #2019 is related? Haven't seen anything that points towards that. Does everything work again if you revert back to v1.51.1?
Also, can you please provide more details about your setup (deployment method, version, which proxy, etc.), check if all your containers are running, if they contain error logs and post screenshots of any errors
Was thinking it was related as the default proxy config changed.
Everything does work again if I revert to 1.51.1
But you aren't using Immich's proxy, so I don't see how that's causing issues
Compose file:
https://pastebin.com/K3wxPJdb
Pastebin
version: "3.9"# swarm deployment extensionx-deploy-swarm: &deploy_s...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
I deploy with docker swarm and use the linuxserver.io swag container for the proxy
Proxy config
https://pastebin.com/kW7w5hfE
Pastebin
Version 2023/01/04server { listen 443 ssl; listen [::]:443...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
I thought the
Might not include their proxy address
Ofc that shouldn't be the case, because the proxy shouldn't be on a public address internally
All the services are running.
If you go to https://demo.immich.app/api/server-info/ping (replace the host with your own, of course), do you get a pong response?
I don't see errors in the logs, except the database has some suspicious messages related to my setup.
🤔
@jrasm91 I don't think this has to do with your refactor in https://github.com/immich-app/immich/pull/2038, but can I get your eyes on this anyways just in case?
What's the actual error and for what request?


That's an error coming from your proxy, not from Immich
So check your proxy logs
Can you send a screenshot of the network request from the web?
From the web dev tools console?
Yeah
https://immich.app/docs/administration/reverse-proxy @EnochPrime can you try follow the info mentioned in the docs
Reverse Proxy | Immich
When deploying Immich it is important to understand that a reverse proxy is required in front of the server and web container. The reverse proxy acts as an intermediary between the user and container, forwarding requests to the correct container based on the URL path.
Like what if the actual response code and did it say what server is sending it.
Unfortunately I cannot send a screenshot at the moment. But it is error code 400
What are the response headers etc?
Connection: keep-alive
Content-Length: 20
Date: <as expected>
Server: nginx
And the response?
"Invalid request body", presumably
What url is this for?
/
@EnochPrime can you pastebin the full logs of
* your proxy container
* immich-server
* immich-web
immich-web
immich-server
https://pastebin.com/6pADAnRD
Pastebin
immich_server.1.mp33o1xn2dck@node-hp | [32m[Nest] 1 - [39m03/...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
proxy 1
https://pastebin.com/EWMuaWL6
Pastebin
core_webserver.1.1hx0w6b7gc8b@pumpkinpi | [mod-init] Attempting ...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
i dont see anything suspicious from the logs
@EnochPrime is it possible to up the log verbosity in your immich proxy config? Ideally so it prints out the full request/response
That should immediately spit out what's going on
I think I may found something deeper in the proxy logs, but I'm having difficulty redacting stuff on the phone.
Here is a sample
Seems like the proxy can't connect and proxy to the immich server container
Since the ping endpoint worked, it could be a problem specifically with proxying the websocket connection?
The the ping test go through the proxy?
Yes
How come the log says connection refused while connecting to upstream with the ping url
Is this possibly related?
https://github.com/immich-app/immich/pull/2059
GitHub
chore: bump openapi version to v1.51.2 by michelheusschen · Pull R...
Can't this be automated?
That's just a routine version number change
That'll do absolutely nothing to anything meaningful 😛
Is there a way to make the webserver log more verbose?
LOG_LEVEL=verbose
for immich-serverIt seems likely unrelated to immich-server as you get the same error on the mobile app and that is not using the immich-web container at all.
The same error in both places would imply it has to be related to your proxy server proxying to the immich-server
(or to immich-server itself, but if that had any errors it would log them)
From the app:
https://domain -> invalid request body
https://domain/api -> no error
Also exposed the webserver port and directly connected without the proxy with issue.
Without issue*
In the app, do you have your domain with /api at the end or not?
without
Try with
That'll work
With works
So it is some issue with the web container or the proxying to it
Perhaps from my webserver environment?
Navigating to the web by ip works?
Web via host IP directly to the webserver container works.
like you can login and everything?
That implies web -> server is good and mobile -> server is good. Looks like proxy -> web is bad
But proxy -> server is good.
The mobile app hits the web server if you don't put in the
/api
, since it makes a request to .well-known/immich
I thought it took me to the page already logged in, but I have to double check.
Mobile app, domain name, with /api, logs in without issue
Web, direct IP, displays login page, reports invalid login
sounds like maybe an issue with the web to server communication then? The happens via your proxy right?
That's what it seems like at the moment.
Should this url work?
http://192.168.0.132:3000/api/server-info/ping
If I roll the webserver back to 1.51.1 then everything seems works. Even with the server and everything else on 1.51.2.
There is this change in the web server
export PROTOCOL_HEADER=X-Forwarded-Proto
(entrypoint.sh)
Maybe that without the matching changes in the the proxy is causing an issueI updated my proxy to include those changes and there was no change to this issue.
What changes did you make?
Pastebin
Version 2023/01/04server { listen 443 ssl; listen [::]:443...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin
Version 2023/01/04map $http_x_forwarded_proto $forwarded_protoco...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
The only change in the web container between 1.51.1 and 1.51.2 is exporting that env variable... hmm
Everything works fine when the web container uses 1.51.1?
I haven't extensively tested it. Right now it's a clean slate with no images uploaded. But I can at least get to the webpage, login, and navigate around to all the pages with 1.51.1.
Could you manually ssh into 1.51.2 (web) and remove the new export env then restart the web to verify if that is an issue or not?
What is the command to restart?
docker restart immich_web or container id or name
Wouldn't restarting the container reapply the env?
I think what Jason mean was to add the same line in the
entrypoint.sh
on 1.51.1*remove
I was saying, run 1.51.2 but remove the new line and just make sure that is what is causing the problem
So... It wasn't as easy as restarting the container, but I overrode the entrypoint with a copy with the line in question commented out.
And it was successful
I was able to connect via the web and mobile with /api.
*Without /api
Yeah, maybe @MicheI knows why that would break your setup. I sure have no idea. Web stops working when the new env variable is added.
It could be because Svelte uses that header for things I didn't anticipate. Based on your nginx config
X-Forwarded-Proto
will always be https
, so it might try to make requests to the server over https. Don't know for certain at all and will look into this tomorrow. We could in the meantime remove export PROTOCOL_HEADER=X-Forwarded-Proto
if it's causing issues.@EnochPrime I hit this exact same issue on upgrade and worked around it by pointing my proxy to immich-proxy (so double proxied) instead of pointing to immich-web and immich-server directly.
Can't actually reproduce the issue. I suspect you're somehow hitting this https://github.com/sveltejs/kit/blob/becf2b0e630ea5d23070873dfd30cecc07d5e498/packages/adapter-node/src/handler.js#L88-L92 error condition, which could be related to setting
PROTOCOL_HEADER
. Guess we can just remove it for now, since it's not being used yet.This seems related as well.
https://github.com/sveltejs/kit/issues/5370
GitHub
Invalid request body · Issue #5370 · sveltejs/kit
Describe the bug I upgraded svelte-kit to its latest version today. I configured my project to use the new vite.config.js setup, however now "Invalid request body" is the only response I ...
One commenter said the issue resolved with node 16.15.1 which just happens to be exactly what the web image uses with node:16-apline3.14.