Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable To Login With Firefox ESR #2859

Closed
ghost opened this issue Feb 27, 2019 · 9 comments · Fixed by #2860
Closed

Unable To Login With Firefox ESR #2859

ghost opened this issue Feb 27, 2019 · 9 comments · Fixed by #2860
Assignees

Comments

@ghost
Copy link

ghost commented Feb 27, 2019

@ndonegan commented on Feb 27, 2019, 5:44 PM UTC:

Home Assistant release with the issue:
0.88.1

Last working Home Assistant release (if known):
0.87.1

Operating environment (Hass.io/Docker/Windows/etc.):
Virtualenv install running on Raspbian. Talking directly to HA via HTTP on port 81123

Component/platform:

  • auth
  • http

Description of problem:
When attempting to login with Firefox ESR on Debian Strech, the following error appears after entering the creds for Home Assistant Local:
Error: Message format incorrect: required key not provided @ data['client_id']

In the log the only message is:

ERROR (MainThread) [homeassistant.components.http.data_validator] Data does not match schema: required key not provided @ data['client_id']

I did try removing .storage and onboarding again to see if there was corruption there.

When I look at the Web Console, I see TypeError: NetworkError when attempting to fetch resource.' where the resource in question is onboarding-ed29f25b.js:2189:1138. The line referenced seems to be attempting to do a POST against /api/onboarding/users I don't see any attempt to even hit that url on the HA install.

I had updated a few days before this issue appeared and hadn't noticed anything odd in HA. It's only when it's IP changed and I had to login again that the issue surfaced.

Chromium and Firefox on Android do not seem to suffer from this issue.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

No configuration related to auth or http in the configuration.yml, relying on default.

Traceback (if applicable):

Only output in the log, even with logging upped to debug is:

ERROR (MainThread) [homeassistant.components.http.data_validator] Data does not match schema: required key not provided @ data['client_id']

Additional information:

Reported this on #17528 but was asked to create a new ticket.

This issue was moved by awarecan from home-assistant/home-assistant#21493.

@awarecan
Copy link
Contributor

I did try removing .storage and onboarding again to see if there was corruption there.

You missed this important information in your original comment. So the login error should be the same as #2858.

I haven't looked into onboard issue, it might be same, might not.

@Enzo-Matrix
Copy link

The issue is much worst with HA 0.89.0b1.
Error is the same with ShadowDom disabled:

2019-03-02 19:12:24 ERROR (MainThread) [homeassistant.components.http.data_validator] Data does not match schema: required key not provided @ data['redirect_uri']

image

And with ShadowDom enabled, login still fails:

2019-03-02 19:15:52 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/lib64/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/lib64/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/lib64/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/lib64/python3.7/site-packages/homeassistant/components/http/real_ip.py", line 33, in real_ip_middleware
    return await handler(request)
  File "/usr/lib64/python3.7/site-packages/homeassistant/components/http/ban.py", line 68, in ban_middleware
    return await handler(request)
  File "/usr/lib64/python3.7/site-packages/homeassistant/components/http/auth.py", line 98, in auth_middleware
    return await handler(request)
  File "/usr/lib64/python3.7/site-packages/homeassistant/components/http/view.py", line 112, in handle
    result = await result
  File "/usr/lib64/python3.7/site-packages/homeassistant/components/http/data_validator.py", line 46, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/lib64/python3.7/site-packages/homeassistant/components/http/ban.py", line 78, in handle_req
    resp = await func(view, request, *args, **kwargs)
  File "/usr/lib64/python3.7/site-packages/homeassistant/components/auth/login_flow.py", line 220, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
  File "/usr/lib64/python3.7/site-packages/homeassistant/data_entry_flow.py", line 80, in async_configure
    flow, step_id, user_input)
  File "/usr/lib64/python3.7/site-packages/homeassistant/data_entry_flow.py", line 98, in _async_handle_step
    result = await getattr(flow, method)(user_input)  # type: Dict
  File "/usr/lib64/python3.7/site-packages/homeassistant/auth/providers/homeassistant.py", line 283, in async_step_init
    user_input['password'])
  File "/usr/lib64/python3.7/site-packages/homeassistant/auth/providers/homeassistant.py", line 229, in async_validate_login
    self.data.validate_login, username, password)
  File "/usr/lib64/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib64/python3.7/site-packages/homeassistant/auth/providers/homeassistant.py", line 126, in validate_login
    for user in self.users:
  File "/usr/lib64/python3.7/site-packages/homeassistant/auth/providers/homeassistant.py", line 114, in users
    return self._data['users']  # type: ignore
TypeError: 'NoneType' object is not subscriptable

@awarecan
Copy link
Contributor

awarecan commented Mar 3, 2019

What is your browser version? Please Ctrl+F5 hard refresh your browser cache or open a "private" window to retry.

I cannot reproduce your issue using FireFox 60.5.2esr (64-bit) and HA 0.89.0b1

@Enzo-Matrix
Copy link

Also running Firefox 60.5.2esr (64-bit) on Linux. Clearing the cache and using private mode had no effect. Same result on SeaMonkey and mobile Firefox. How does one disable these new Dom feature in HA itself?

@awarecan
Copy link
Contributor

awarecan commented Mar 3, 2019

It is not a new feature, we are using shadow DOM long time ago. We just changed button component to mwc-button from paper-button in 0.88 release. That caused the login issue I fixed in #2860

By the way, your backend stacktrace match the issue home-assistant/core#21569. I am going to look into it.

@awarecan
Copy link
Contributor

awarecan commented Mar 3, 2019

FYI, home-assistant/core#21619 should resolve the backend stack trace issue. But the root cause of that is still unclear, it seems frontend submit the login request twice if you enabled shadow dom support (the 2nd request will throw error due the race condition).

@Enzo-Matrix
Copy link

@awarecan
Race condition fix in 0.89.0b2 resolved the login issue.
Thanks for looking into this issue.

@awarecan
Copy link
Contributor

awarecan commented Mar 5, 2019

It may not fix the root cause in the browser, could you look at your network tabs if there are two POST request after you click submit button (or press ENTER).

@ant0nwax
Copy link

ant0nwax commented Mar 20, 2021

Sorry to mention

i would like to use Old Smart Devices as Panels
for that i think? i must login and authenticate to homeassistant

such as
5 x Android Tablets Running Android 4.0.4 (Chrome)
1 x Windows Phone running WIndows mobile 10 (Browser)
1 x Iphone 4 iOS 6.0.6 (Safari)
1 x Ipad mini 2 iOS 9.x.x (Safari) (did not test yet)

all of the above have the issue with the

Error: Message format incorrect: required key not provided @ data['client_id']

please could you explain me how to use these old devices as Panels for Home Assistant or is the open source community following the trend of big companies instead of upcycling?

Thank you

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Mar 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants