Intermittent spinning wheel on History and Logbook

Since a while (unfortunately don’t remember the ha release, but its been a few months and ha updates since then) seemingly at random I have a spinning wheel displayed when looking at an entities history or logbook. It works fine for a while - all the data is displayed basically instantly. Except when it doesn’t. And its not bound to a specific entity. It can take up to minutes to show eventually the data, but with no significant cpu/disk/network load on my docker host.

I have a somehow complicated network setup so I assumed it has something to do with websockets getting terminated prematurely.

browser/companion app → haproxy → traefik → docker swarm → ha

So I’ve simplified my network setup as following:

  • browser/companion app → haproxy → docker swarm → ha
  • browser/companion app → docker swarm → ha
  • browser/companion app → docker swarm in host mode → ha

And still I can reproduce the problem with the latest Safari/Chrome/Firefox/ios Companion App. Happens over the Internet and in my LAN.

There are no relevant log entries in ha. The only errors I could find which might be relevant show up in the Browsers Developer Console.

I’ve googled, tcpdumped and debugged an unreasonable time. Down every rabbit hole I could find. Thats why I decided to post today. Anybody seeing this too on their installation? I can’t be the only one. :smile:

In the meantime I’ve deleted the SQLIte db and still experienced the random spinning wheel from the beginning - with a basically empty database.

Next thing I did is installed and configured a MariaDB. And behold: the spinning wheel did not show up running since then! :tada: Its been 6 days since the change (with a purge_keep_days of 7), so I think its fair to say that this did it.

For anybody out there with the same symptoms it might be worth a shot to try changing to a “real” RDBMS. I speculate that the writes to the SQLite DB overwhelmed it from time to time.

Leaving this here so hopefully it will save somebody a lot of debugging time. :slight_smile: