meichthys / uptime_kuma

Uptime Kuma HACS integration
105 stars 24 forks source link

Not being able to establish connection #80

Closed x4N70pHyLL closed 8 months ago

x4N70pHyLL commented 9 months ago

Hi,

I just tried to set up the integration but I am not able to connect.

Both Home Assistant and Uptime Kuma are running in a Docker Container in Synology NAS, HA in host network, Uptime Kuma in bridge with port 3001.

I am able to connect from my browser to the local ip of the NAS with 192.168.x.x:3001 as well as to the /metrics with a token.

In HA I am only getting "Request exception for '192.168.x.y:3001/metrics' with - 192.168.x.y:3001/metrics" in the Log. The Integration says "Failed to connect".

Any Ideas?

meichthys commented 9 months ago

What version of Uptime Kuma are you using? This may be related to https://github.com/meichthys/uptime_kuma/issues/79

x4N70pHyLL commented 9 months ago

What version of Uptime Kuma are you using? This may be related to #79

I am using 1.23.3, so it seems not to be related I guess...

meichthys commented 9 months ago

Have you tried this step on the readme?

_NOTE: If you have issues connecting, try creating an uptimekuma API key and using that with NO username for the credentials. If you are still having issues,make sure you can successfully connect to http(s)://youruptimekuma.url/metrics

x4N70pHyLL commented 9 months ago

Have you tried this step on the readme?

_NOTE: If you have issues connecting, try creating an uptimekuma API key and using that with NO username for the credentials. If you are still having issues,make sure you can successfully connect to http(s)://youruptimekuma.url/metrics

Yes as I wrote in the initial issue I both tried to put in the API key w/o username to connect and tried the same "manually" by accessing the /metrics URL and logging in there with the API key, which worked.

Any issue with the container accessing another container (should be fine, doing it in other contexts as well)? I noticed that Uptime Kuma and one other container (Heimdall) are in bridge networking mode and interestingly I am having this issue here with Uptime Kuma and noticing that Heimdall (basically a Dashboard with Links to Containers/Services) seems to have trouble with accessing stuff in other containers as well (e.g. details/stats on Jellyfish and AdGuard) - seems a little suspicious. Bridge to host connections within Docker / Synology Container Manager should work, right?

meichthys commented 9 months ago

I'm not very familiar with different docker network configurations, but i would think the bridge mode should be fine, but there are lots of variables here.

We've had some other issue reports similar to this, and my usual recommendation is to use a valid HTTPS certificate and a reverse proxy.

You could also try using "admin" as the username along with the token as the password. Apparently it helped someone here: https://github.com/meichthys/uptime_kuma/issues/55#issuecomment-1661817451

You may also find this helpful since DNS is so often an issue: https://github.com/meichthys/uptime_kuma/issues/19#issuecomment-1328336356

x4N70pHyLL commented 9 months ago

I'm not very familiar with different docker network configurations, but i would think the bridge mode should be fine, but there are lots of variables here.

We've had some other issue reports similar to this, and my usual recommendation is to use a valid HTTPS certificate and a reverse proxy.

You could also try using "admin" as the username along with the token as the password. Apparently it helped someone here: #55 (comment)

You may also find this helpful since DNS is so often an issue: #19 (comment)

Thanks for the hints, really appreciate it. I am kind of frustrated right now. I double checked, it may be an issue running one container in host and the other in bride mode. To be sure, I both routed the containers together as well as created Uptime Kuma new in host mode just to be sure it is not a Container networking related issue. I tried all options (standard login, admin+token, token only) each with verify certificate and without.

Nothing helped, as I have no idea where to further investigate, seems like I have to give up and use "ping" function within HomeAssistant...

Stele77 commented 9 months ago

Same here. I tried every combination, acces to /metrics is also possible.

ripp2003 commented 8 months ago

Hi, try this when using internal kuma server with only ip and no ssl :

url : http://xxx.xxx.xxx.xxx port : 3001 username : admin pass : API pasword (must be created before under kuma) dont' use verify ssl

x4N70pHyLL commented 8 months ago

Hi, try this when using internal kuma server with only ip and no ssl :

url : http://xxx.xxx.xxx.xxx port : 3001 username : admin pass : API pasword (must be created before under kuma) dont' use verify ssl

That helped. Thanks a lot!

ripp2003 commented 8 months ago

I had the same problem and that make me crazy 😀

ianpogi5 commented 7 months ago

Hi, try this when using internal kuma server with only ip and no ssl :

url : http://xxx.xxx.xxx.xxx port : 3001 username : admin pass : API pasword (must be created before under kuma) dont' use verify ssl

can someone put this in the README?

meichthys commented 7 months ago

Thanks @ripp2003 I'll add this to the readme.