vinteo / hass-opensprinkler

OpenSprinkler Integration for Home Assistant
MIT License
208 stars 40 forks source link

Getting 504 error when adding integration #245

Closed erahhal closed 1 year ago

erahhal commented 1 year ago

I added the integration through HACS, and when I click the "Add Integratoin" button and add OpenSprinkler, it hangs for a while, then pops up the following error:

 Config flow could not be loaded: <html><body><h1>504 Gateway Time-out</h1> The server didn't respond in time. </body></html> 

Using Home Assistant on a Raspeberry Pi:

Home Assistant 2023.8.4 Supervisor 2023.08.1 Operating System 10.5 Frontend 20230802.1 - latest

EdLeckert commented 1 year ago

This is a network error. I've never encountered it, but:

504 Gateway Timeout server error response code indicates that the server, while acting as a gateway or proxy, did not get a response in time from the upstream server that it needed in order to complete the request. A Gateway might refer to different things in networking and a 504 error is usually not something you can fix, but requires a fix by the web server or the proxies you are trying to get access through.

Have you tried communicating with the OpenSprinkler controller via the web interface, from perhaps a laptop at the same point in the network as your RPi? Have you tried pinging the controller from the HA terminal interface, e.g., through the Terminal & SSH Add-on? I would expect the same error from those methods.

erahhal commented 1 year ago

Sorry i should have been more clear. This happens before I even enter the IP for the device. I have no idea what it's trying to connect to. I just select the opensprinkler integration and this happens before any config dialog pops up.

EdLeckert commented 1 year ago

I don't see many references to this type of problem except this post from over a year ago, here.

Unfortunately, no one responded with a solution. However, it appears that it might not be exclusive to OpenSprinkler.

Are you able to get to the config dialog of other integrations? Just pick something at random and abort.

Is there anything related in the logs besides what you provided earlier?

erahhal commented 1 year ago

I tried other integrations, and config option dialogs come up with no problem. I've got over 30 integrations running without an issue.

Here's exactly what I see:

I click ADD INTEGRATION:

image

Then I filter and click "OpenSprinkler":

image

Then I see this, which spins for maybe 30 seconds:

image

After which I see this:

image

I checked the logs and don't see anything related.

I can confirm that opensprinkler is available on my network from the browser:

image

And that the IP is also accessible from the HA box:

image

erahhal commented 1 year ago

What could it possibly be trying to connect to before I've configured anything?

vinteo commented 1 year ago

How are you accessing Home Assistant itself? Is it through a proxy? If you are, could you try going directly to the local address http://...:8123 and see if you have the same issue?

Have you tried uninstalling the OS integration and reinstalling it again (and restarting HA)? Might be worth a try.

vinteo commented 1 year ago

Not the exact issue but for a similar issue in the past: https://community.home-assistant.io/t/hacs-installing-problem-via-integration-error-config-flow-could-not-be-loaded/314501/20

Some people report success in disabling GoogleCast integration. Maybe not GoogleCast but perhaps another integration could be interfering? Any clues in the logs?

erahhal commented 1 year ago

No GoogleCast integration installed. Nothing in the logs.

Tried the http vs https suggestion, and it took several minutes eventually error. This time though it was just "Error: Unknown":

image

vinteo commented 1 year ago

any luck in uninstalling/reinstalling the integration?

erahhal commented 1 year ago

That fixed it! Must have been in a corrupted state. Thanks for your help @vinteo !