HA stuck on 'Loading Data'

I can’t get past the ‘Loading data’ screen.
I have loads of these errors in the log.
It looks like something in the authorisation system might be messed up.

2019-12-09 10:07:54 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 275, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp\_http_parser.pyx", line 523, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method

I have tried Chrome mobile, Fully Kiosk and Edge. I have tried deleting a user and recreating it.

This is new behaviour and the only thing I have done that I can think might be relevant is to install the Android app and then later on remove it. But I don’t really see how that could make a difference.

I have refresh tokens for my phone from today Including one I presume for the app which I reinstalled thinking it might help - the app can’t connect either.

image

I also have tons of other refresh tokens, some dated over a year ago.
e.g.

image
I’d be grateful for ANY suggestions.

I still have access through my Desktop (Chrome) but I am guessing I’ll lose that if I logout!

what’s your http section in config look like?

It doesn’t look like much…

http:
#  ssl_certificate: /ssl/fullchain.pem
#  ssl_key: /ssl/privkey.pem

I don’t remember ever changing it.

So given that config, you don’t access HA outside your network?

Not via an open port on my router.
I do use ZeroTier though
And I’ve set up the UniFi VPN

it should be working internally then.

Yes it did until yesterday.
I can’t even create a new user and logon with that user. It just stops on ‘Loading Data’
Which I presume means it has kind of authenticated ok???

Do you have auto login? Also, did your hidden auth files change?

Some more information…

When trying to logon with the new user (that has never been in HA) I get these errors (two, I explain why later)

2019-12-09 15:05:50 WARNING (MainThread) [homeassistant.components.websocket_api.http.connection.140372919309136] Disconnected: Did not receive auth message within 10 seconds
2019-12-09 15:19:49 WARNING (MainThread) [homeassistant.components.websocket_api.http.connection.140372945186512] Disconnected: Did not receive auth message within 10 seconds

and looking at the log from the ‘authenticated’ Custom component by @ludeeus it shows the wrong user name logging in. This shows that I tried twice at the same time as from the two log entries.

192.168.1.223:
  city: null
  country: null
  hostname: 192.168.1.223
  last_used_at: '2019-12-09T15:19:27.911467+00:00'
  prev_used_at: '2019-12-09T15:05:39.216677+00:00'
  region: null
  user_id: 0f6a7xxxxxxxxxxxx7198
  username: WRONG NAME

If you mean does the browser remember my password then yes except it asks me for login details now as it hasn’t had a susccesful login to save.

I don’t know what this is but nothing changed as far as I know

do you have an old snapshot? Because you can save the .storage folder, restore a snapshot and compare the current .storage folder to the one you restored.

That was a genius idea but didn’t yield anything useful (so far).
I have snapshots going back a few weeks and I didn’t need to restore it I just used 7-Zip to look inside.

Both of the .storage/auth files are the same except for the user I deleted and recreated to try and fix this and for the extra test user I created, also to try and fix this.

So unless I am looking in the wrong place, no clues.

Did those error messages mean anything to you?
Might extra logging help? If so do you know what to turn on?

it’s meaningless to me. I’m wondering if your install is corrupted in some way.

To turn on extra logging, just set it logging to debug. But it’ll be jam packed full of stuff.

Yes… that thought has crossed my mind :roll_eyes:
Do you mean corruption in HA itself? Meaning a clean install of HA followed by a restore from before the problem might be worth a try?

Not something I really want to start doing…

Yes it will…

whenever I encounter that loading data issue, I right click and turn on the inspector. 9 out to 10 it is the same customization template failing. Editing(killing) that customization for the time being reloads the system.
Might be worth a check?

Interesting,

Yes it is.

I’m only able to look at my desktop PC at the moment (which is working) and I see these errors which look suspicious… But I have no idea what they mean.

hmmm, that doesn’t look like the errors I referred to, seems safe to rule that out unfortunately, they’re always quite easy to solve…

web socket errors are among the more mysterious errors considering they never offer anything to go on.

you could disable anything using the websocket integration and see what happens, I hope you can still samba into your files?

really sorry I can’t be of assistance, your network setup is unfamiliar to me, I’m using the duckdns route.

you could for a test disable all http settings and simply use an unsecured instance? Should be not that dangerous if you’re only using it locally.

Yeah thanks.
I can still get to my config via Samba. My desktop (ethernet connected) is working perfectly well but I am concerned it might be a bit fragile if I don’t get to the bottom of this.

Just before I pressed on ‘Reply’ to post this I decided to close Chrome and reopen it. All those errors have gone so I don’t know what that was all about…

I’m seriously thinking I might have to reinstall HA and start from the beginning.

Hey… got the same error. Without any reason and any changes made since yesterday I’m stuck on “loading data”. It started with my tablet, then my desktop and this morning even my android phone.
Now I was trying to enable debug logger but after a reboot I can’t access through ssh.
Very strange…

I was stuck on loading screen awhile back. Had port forwarding on my router set up. Deleting and recreating these settings on my router did the trick…