502 Bad Gateway
Hello all, happy Homarr user here! š
Beginning from today after the container has been updated to the latest version (v0.13.3) I've got 502 Bad Gateway if I try to open Homarr. I'm using it behind nginx as a subfolder . I investigated a bit, but I didn't find any obvious, until I spot the problem in Homarr log:
"ready started server on 127.0.1.1:7575, url: http://127.0.1.1:7575"
Do you see it? Not? Let me help: 127.0.1.1. Any idea what's the problem? How can I solve it?
One remark: I'm using docker host networking.
64 Replies
Hi, thanks for your post. This is a known issue with 0.13.3. Do you have authentication enabled?
@randomvalid
Hi! No, I don't have. Should I modify nginx to point to 127.0.1.1 instead of 127.0.0.1?
No. The IP you're seeing is only related to the container's internal network
Can you post your docker run or compose?
Sure, here it is:
sudo docker run --name homarr \
--network host\
-d \
--restart always \
-v /container/homarr/config:/app/data/configs \
-v /container/homarr/icon:/app/public/icons \
-d ghcr.io/ajnart/homarr:latest
Thank you. We'll look into it.
FYI @tagaishi
Since I'm using host networking, the modification in nginx is actually working, so it can be a workaround others with the same setup - I've just tested it.
Wait, what modification did you make?
@meierschlumpf @ajnart could this be, because we changed the base image? Wasn't this an issue with the base image for some reason?
Okay, so I have an nginx reverse proxy with a bunch of location directives, originally it pointed to 127.0.0.1, but after that I changed to 127.0.1.1 and it works.
Original:
location / {
proxy_pass http://127.0.0.1:7575/;
}
Workaround:
location / {
proxy_pass http://127.0.1.1:7575/;
}
As I mentioned I'm using docker host networking, so maybe that's the reason why this workaround is working for me.
Okay, thanks for the insight. The previous version worked without that workaround, right?
Welcome! Yes that's right!
Okay, thanks for telling us
We'll look into it, but I do not have an ETA
No problem, it is usable now, whenever you release the fix I will write my config back š
What if you replace 127.0.1.1 in nginx by localhost, does it work?
Also, check your /etc/hosts to see if the localhost line was removed or changed somehow
/etc/hosts seems fine - 127.0.0.1 localhost, 127.0.1.1 {fqdn}
What do you mean by that?
Let me check...
That works also
There you go :)
All 127.x.x.x are loopback IP's, so setting to localhost should cover it no matter what your fqdn does
Thank you! I understand, anyway it's a good tip š
Btw the fqdn is set by nginx and the OS, homarr has nothing in place that would touch that somehow
So I don't really know how that problem hasn't shown earlier
I know, but somehow homarr binds to that adress rather than 127.0.0.1
Maybe before it was set as instead
Yes that is possible
Sorry, I've just realized I was wrong... it do not work. localhost resolves 127.0.0.1, the hostname or fqdn resolves 127.0.1.1. So if I use localhost in nginx that won't solve the problem. (I tested one instance, while modified another one... š )
Ah, that's too bad.
Host is debian bookworm, and this explains: https://serverfault.com/questions/363095/why-does-my-hostname-appear-with-the-address-127-0-1-1-rather-than-127-0-0-1-in
Server Fault
Why does my hostname appear with the address 127.0.1.1 rather than ...
This may be a bit of a noobish question, but I was taking a look at /etc/hosts on my new Xubuntu install and saw this:
127.0.0.1 localhost
127.0.1.1 myhostname
On most 'nixes I've used, the secon...
And if you were to return to 0.13.2, is that issue persisting?
I can check it, but I doubt.
Issue is gone if I revert to 0.13.2.
Alright then there is indeed a problem somehow from our side
I think also, should I report it as a bug on github?
likely related to https://github.com/ajnart/homarr/issues/1363
GitHub
0.13.3: 500 Internal Server Error on homepage when password is enab...
Environment Docker Version 0.13.3 Describe the problem Just upgraded to 0.13.3. I had password enabled and was unauthenticated and the homepage now displays Internal Server Error. Note that there i...
Possibly Yes
I think these two are seperate issues, I don't have authentication, and I get back a bad gateway, homarr is working but on a wrong address...
Although the problem isn't exactly the same, they only both stem from using reverse proxying, the cause might be the same
Yeah, I just noticed the reverse proxy link. Could be wrong.
Are you currently using image tag 0.13.3 or latest? Maybe if you change to 0.13.3 it works? (Idk why it should but maybe)
Then docker would just have a stroke with the current image
I'm using the latest tag, but I think that is exactely the same, so latest is 0.13.3
they point to the same hash on GHCR at least.
yeah that's true (Does it rebuild if you get the same hash for another image name?)
it will not re-download it, no.
Okay I see
@meierschlumpf the only thing I can see causing problem would be the next dependency update
but clashing hashes are not likely
It's unlikely in my opinion but of course it could be the case. I'm just wondering why nobody using dev had the problem then
Tried it out, using exact tag, issue is back...
Ok thanks for your effort
But it doesn't make sense because we just went from .10 to .19 so unlikely to me too
The funny thing about the issue I linked is that you can make the page work if you rollback, login, then update to the new version and use the login session from earlier, so that is related to the login bits.
š
Is dev working?
Because there should be exactly the same changes but it is another hash
Yeah but I guess, if you clear the session cookie you won't be able to login again...
yeah, that was my point.
login triggers this Anyway, your issue might be unrelated so I'll let you lads continue.
Same issue, bad gateway, but if I modify to 127.0.1.1 it works.
Okay thanks for testing, so we are now sure it is actually happening because of changes in homarr i guess š
Welcome, if you need additional input from my side, just let me know! š
Found that the problem for the other issue is about the next dependency. The reason this doesn't work might be because of it too but for different reasons.
I access via a cloudflare tunnel, as I'm remote, and get the same error
@randomvalid @salty 0.13.4 is out, would you be able to say if the problems are fixed now?
Works fine my dev box now, I'll let you know if we get reports of it not working with Saltbox.
Awesome, thank you š
Wonderful thank you for the feedback
Yes it's working, thank you for the quick fix! š
Thanks for confirming. Glad all is well
Guessing this https://github.com/vercel/next.js/pull/54926 will fix it once it is merged for newer versions.
GitHub
Fix
next-server
not working properly when HOSTNAME
is defined b...What?
Follow-up of #53131.
This PR fixes issues caused by the previous PR, which are: req.url reporting the host's IP instead of the host itself, router.push sometimes uses the host's IP (c...
Yeah that's also the one I saw when searching up on the subject
This just got closed lmao, 4 hours ago
hehe
they did reference another PR that might fix it as well at least.