H
Homarrā€¢14mo ago
randomvalid

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
Manicraft1001
Manicraft1001ā€¢14mo ago
Hi, thanks for your post. This is a known issue with 0.13.3. Do you have authentication enabled? @randomvalid
randomvalid
randomvalidā€¢14mo ago
Hi! No, I don't have. Should I modify nginx to point to 127.0.1.1 instead of 127.0.0.1?
Manicraft1001
Manicraft1001ā€¢14mo ago
No. The IP you're seeing is only related to the container's internal network Can you post your docker run or compose?
randomvalid
randomvalidā€¢14mo ago
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
Manicraft1001
Manicraft1001ā€¢14mo ago
Thank you. We'll look into it. FYI @tagaishi
randomvalid
randomvalidā€¢14mo ago
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.
Manicraft1001
Manicraft1001ā€¢14mo ago
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?
randomvalid
randomvalidā€¢14mo ago
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.
Manicraft1001
Manicraft1001ā€¢14mo ago
Okay, thanks for the insight. The previous version worked without that workaround, right?
randomvalid
randomvalidā€¢14mo ago
Welcome! Yes that's right!
Manicraft1001
Manicraft1001ā€¢14mo ago
Okay, thanks for telling us We'll look into it, but I do not have an ETA
randomvalid
randomvalidā€¢14mo ago
No problem, it is usable now, whenever you release the fix I will write my config back šŸ™‚
Tag
Tagā€¢14mo ago
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
randomvalid
randomvalidā€¢14mo ago
/etc/hosts seems fine - 127.0.0.1 localhost, 127.0.1.1 {fqdn} What do you mean by that?
Tag
Tagā€¢14mo ago
randomvalid
randomvalidā€¢14mo ago
Let me check... That works also
Tag
Tagā€¢14mo ago
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
randomvalid
randomvalidā€¢14mo ago
Thank you! I understand, anyway it's a good tip šŸ˜‰
Tag
Tagā€¢14mo ago
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
randomvalid
randomvalidā€¢14mo ago
I know, but somehow homarr binds to that adress rather than 127.0.0.1
Tag
Tagā€¢14mo ago
Maybe before it was set as
127.0.0.1 localhost {fqdn}
127.0.0.1 localhost {fqdn}
instead
randomvalid
randomvalidā€¢14mo ago
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... šŸ˜„ )
Tag
Tagā€¢14mo ago
Ah, that's too bad.
randomvalid
randomvalidā€¢14mo ago
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...
Tag
Tagā€¢14mo ago
And if you were to return to 0.13.2, is that issue persisting?
randomvalid
randomvalidā€¢14mo ago
I can check it, but I doubt. Issue is gone if I revert to 0.13.2.
Tag
Tagā€¢14mo ago
Alright then there is indeed a problem somehow from our side
randomvalid
randomvalidā€¢14mo ago
I think also, should I report it as a bug on github?
salty
saltyā€¢14mo ago
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...
Tag
Tagā€¢14mo ago
Possibly Yes
randomvalid
randomvalidā€¢14mo ago
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...
Tag
Tagā€¢14mo ago
Although the problem isn't exactly the same, they only both stem from using reverse proxying, the cause might be the same
salty
saltyā€¢14mo ago
Yeah, I just noticed the reverse proxy link. Could be wrong.
Meierschlumpf
Meierschlumpfā€¢14mo ago
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
randomvalid
randomvalidā€¢14mo ago
I'm using the latest tag, but I think that is exactely the same, so latest is 0.13.3
salty
saltyā€¢14mo ago
they point to the same hash on GHCR at least.
Meierschlumpf
Meierschlumpfā€¢14mo ago
yeah that's true (Does it rebuild if you get the same hash for another image name?)
salty
saltyā€¢14mo ago
it will not re-download it, no.
Meierschlumpf
Meierschlumpfā€¢14mo ago
Okay I see
Tag
Tagā€¢14mo ago
@meierschlumpf the only thing I can see causing problem would be the next dependency update
salty
saltyā€¢14mo ago
but clashing hashes are not likely
Meierschlumpf
Meierschlumpfā€¢14mo ago
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
randomvalid
randomvalidā€¢14mo ago
Tried it out, using exact tag, issue is back...
Meierschlumpf
Meierschlumpfā€¢14mo ago
Ok thanks for your effort
Tag
Tagā€¢14mo ago
But it doesn't make sense because we just went from .10 to .19 so unlikely to me too
salty
saltyā€¢14mo ago
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. šŸ˜„
Meierschlumpf
Meierschlumpfā€¢14mo ago
Is dev working? Because there should be exactly the same changes but it is another hash
randomvalid
randomvalidā€¢14mo ago
Yeah but I guess, if you clear the session cookie you won't be able to login again...
salty
saltyā€¢14mo ago
yeah, that was my point. login triggers this
Failed to proxy https://172.19.0.11:7575/en/login Error: write EPROTO 980B5FDB137F0000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:354:

at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16) {

errno: -71,

code: 'EPROTO',

syscall: 'write'

}

Error: write EPROTO 980B5FDB137F0000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:354:

at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16) {

errno: -71,

code: 'EPROTO',

syscall: 'write'

}
Failed to proxy https://172.19.0.11:7575/en/login Error: write EPROTO 980B5FDB137F0000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:354:

at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16) {

errno: -71,

code: 'EPROTO',

syscall: 'write'

}

Error: write EPROTO 980B5FDB137F0000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:354:

at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16) {

errno: -71,

code: 'EPROTO',

syscall: 'write'

}
Anyway, your issue might be unrelated so I'll let you lads continue.
randomvalid
randomvalidā€¢14mo ago
Same issue, bad gateway, but if I modify to 127.0.1.1 it works.
Meierschlumpf
Meierschlumpfā€¢14mo ago
Okay thanks for testing, so we are now sure it is actually happening because of changes in homarr i guess šŸ˜‰
randomvalid
randomvalidā€¢14mo ago
Welcome, if you need additional input from my side, just let me know! šŸ™‚
Tag
Tagā€¢14mo ago
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.
liquidguru
liquidguruā€¢14mo ago
I access via a cloudflare tunnel, as I'm remote, and get the same error
Tag
Tagā€¢14mo ago
@randomvalid @salty 0.13.4 is out, would you be able to say if the problems are fixed now?
salty
saltyā€¢14mo ago
Works fine my dev box now, I'll let you know if we get reports of it not working with Saltbox.
Manicraft1001
Manicraft1001ā€¢14mo ago
Awesome, thank you šŸ‘
Tag
Tagā€¢14mo ago
Wonderful thank you for the feedback
randomvalid
randomvalidā€¢14mo ago
Yes it's working, thank you for the quick fix! šŸ™‚
Tag
Tagā€¢14mo ago
Thanks for confirming. Glad all is well
salty
saltyā€¢14mo ago
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...
Tag
Tagā€¢14mo ago
Yeah that's also the one I saw when searching up on the subject
Thomas
Thomasā€¢14mo ago
This just got closed lmao, 4 hours ago
salty
saltyā€¢14mo ago
hehe they did reference another PR that might fix it as well at least.
Want results from more Discord servers?
Add your server