Desktop/mobile apps cannot connect suddenly

So starting yesterday I have a very strange issue, and it’s driving me crazy. Suddenly the official mobile apps cannot connect to HA server. However, when I delete cache within the app (on iOS at least, on Android I can’t find that option) it works after a refresh straight away. After a few session/refreshes/launching app however, it gives the same error and I need to delete cache to access it again. There are no logs about this either…

Nothing has been changed and this suddenly happened. This happens to both Android and iOS devices. Accessing HA through the website (also on iOS and Android) works fine however. Its strictly the app. Also, notifications work even when app cannot access HA server.I was running HA 114.4 and one version before the latest mobile apps. I’m running it through DuckDNS with https btw.

This is what I have tried in the meantime, which did not solve it:

  • Update from HA 114.4 to 115.2
  • Update Android and iOS apps to latest version
  • Uninstall apps and re-install
  • Delete and re-add the mobile integrations
  • Restart HA
  • Restart router
  • Change DNS settings on my router
  • Connect through wifi and through cellular
  • DuckDNS shows same IP and shows no errors

It’s driving me insane and I really hope someone can help me with this. Removing cached every 4-5 times I use the app is insane.

Edit: now I suddenly have experienced it does not connect on desktop when openening a new browser. I’m litterally editing stuff on one browser, while the other browser says it cannot connect to it. I opened the iOS app and that one didn’t work either. I cleaned cache on mobile and that one worked. The desktop still doesn’t work on the 2nd browser.

Edit: I cleared cache on Edge chromium and could login again after authenticating. I don’t think it’s solved, since mobile keeps having that issue. I expect I get the same error any time again on desktop.

I think this is a deeper issue… Perhaps with SSL? But it’s just strange that deleting cache on Android, iOS and desktop fixes it temporarily.

No, please read my post completely before suggestion solutions. I appreciate the help, but I don’t to create confusion or waste peoples time.

As I mentioned, this happened on 114. I updated to 115.2 in order to hopefully solve this, which did not. So going back to 114 will NOT Solve this, since I was already running 114 when this issue first occured.

Edit: I even deleted the SSL key and certfiles, created an entire new DuckDNS account, removed the old one (also IP address), uninstalled DuckDNS and installed again with new DuckDNS account and new cert/keyfiles. Restarted HA and logged in with new url. After a few tries, same error.

And again: hitting reset front cache and reload opens it straight away. I’m going insane with this, so is my family.

Are there errors in the logs?

The only error I saw was this:

Logger: frontend.js.latest.202009180
Source: components/system_log/__init__.py:193 
First occurred: 18:10:27 (1 occurrences) 
Last logged: 18:10:27

:0:0 Script error.

But I’m not sure if this is even related, I couldn’t pinpoint the exact time. When I tried before I couldn’t see anything in log. Also, it’s per device. So when it happens on one, others don’t have the issue per se. And then a different one ‘times out’ etc. All devices work as soon as I clear cache on said device. It’s as if the connection gets rejected, untill I clear the cache.

@petro I also say these logs just now when I tried, but can be a coincidence and unrelated.

 Logger: asyncio
Source: /usr/local/lib/python3.8/asyncio/selector_events.py:901
First occurred: 10:30:08 (7 occurrences)
Last logged: 10:30:08

socket.send() raised exception.
Logger: aiohttp.websocket
Source: /usr/local/lib/python3.8/site-packages/aiohttp/http_websocket.py:571
First occurred: 10:30:09 (1 occurrences)
Last logged: 10:30:09

websocket connection is closing.

The only thing I can try is burn a brand new sd card and instead of restoring, put back the files manually… I worry that it won’t help anything though and I’m just wasting time…

Edit: I opened a ticket yesterday on Github and it looks like I’m not the only one now: https://github.com/home-assistant/core/issues/40347#issuecomment-695970651

Edit: looks like scheduler component/card is the culprit (for now). Read the github ticket for more info