Home Assistant Constantly Refreshing

Update

This has been removed in v2.11.2 and will fail to start if the configuration below is left in.


I was seeing constant page refreshes on Home Assistant. In the end, it was changes to Traefik v2.11 and how it handles connections.

Using the browser developer tools, it was constantly trying upgrade the connection to a websocket to the point it was flooding the network log. Every attempt would cause the page to reload.

In v2.11.1, connections default to 2 seconds before Traefik disconnects them. The connection to my Home Assistant with the websocket upgrades were more often than not taking longer than 2 seconds.

To mitigate this, a new configuration was added: lingeringTimeout. Setting this to 0 will disable it or set a time higher than the 2 seconds default.

Here’s my configuration example traefik.yml:
# HTTPS endpoint, with domain wildcard
https:
address: :443
http:
tls:
# Generate a wildcard domain certificate
certResolver: letsencrypt
domains:
- main: dannytsang.com
sans:
- '*.dannytsang.com'
middlewares:
- securityHeaders@file
transport:
respondingTimeouts:
tcp:
lingeringTimeout: 0

Problems after Traefik update from 2.11.0 to 2.11.1: Solution inside

About Danny

I.T software professional always studying and applying the knowledge gained and one way of doing this is to blog. Danny also has participates in a part time project called Energy@Home [http://code.google.com/p/energyathome/] for monitoring energy usage on a premise. Dedicated to I.T since studying pure Information Technology since the age of 16, Danny Tsang working in the field that he has aimed for since leaving school. View all posts by Danny → This entry was posted in Home Automation, Infrastructure and tagged , , , , , . Bookmark the permalink.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.