Core: After upgrade to 118 broken OAuth2 with aiohttp 3.7.1

Created on 20 Nov 2020  ·  16Comments  ·  Source: home-assistant/core

The problem

Environment

  • Home Assistant Core release with the issue: 118
  • Last working Home Assistant Core release (if known): 117.6
  • Operating environment (OS/Container/Supervised/Core): debian
  • Integration causing this issue: https://github.com/dmitry-k/yandex_smart_home
  • Link to integration documentation on our website:

Problem-relevant configuration.yaml

```no matter

```

Traceback/Error logs


custom not have error, broken OAuth2 after https://github.com/home-assistant/core/pull/42305
trouble with aiohttp 3.7.1 version library
old version as 3.5 work normally
with this version aiohttp 3.7.1 not worked Oauth2 authorization foк request and refresh token.

Integration cant pass authorization. and show error some Attempt to login or request with invalid authentication from a0d7b954-nginxproxymanager.local.hass.io (172.30.33.3) (Mozilla / 5.0 (Windows NT 6.2; WOW64) AppleWebKit / 536.5 (KHTML like Gecko) YaBrowser / 1.0.1084.5402 Chrome / 19.0 .1084.5409 Safari / 536.5)
trouble after this pull
https://github.com/home-assistant/core/pull/42305

Additional information

There are a lot of people using this integration. and nothing depends on the author of the component

Most helpful comment

@MartinHjelmare don't worry. Problem on the side of Yandex servers.

New aiohttp uses new compression params (wbits) for Content-Encoding: deflate compression. There are no mistakes.

Yandex servers, for some unknown reason, cannot read the response /auth/token with this new compression.

https://docs.python.org/3/library/zlib.html#zlib.compressobj

aiohttp==3.6.2

https://github.com/aio-libs/aiohttp/blob/v3.6.2/aiohttp/web_response.py#L683-L684

aiohttp==3.7.1

https://github.com/aio-libs/aiohttp/blob/v3.7.1/aiohttp/web_response.py#L736-L738

I made a fix to disable compression in Home Assistant and everything works:

https://github.com/AlexxIT/yandex_smart_home_fix

Thanks to @Anonym-tsk here description whats happened with deflate compression:

https://github.com/aio-libs/aiohttp/issues/4506

All 16 comments

Same problem. Had to downgrade core to 117.6

the same problem, authorization fails.

I confirm the problem.

the same problem

I have the following error in the logs on attempt to flip a switch from yandex station, probably it is related:

Nov 19 20:47:29 shulyaka hass[15355]: 2020-11-19 23:47:29 DEBUG (MainThread) [homeassistant.components.http.view] Serving /auth/token to 5.45.207.7 (auth: False)

I also can confirm that downgrading to aiohttp-3.6.3 resolves the issue.

similar problem

I have the same, had to go downgrade HA to 117.6

++

We don't track issues with custom integrations in this issue tracker.

@MartinHjelmare I think the issue was raised here as a "buggy aiohttp core dependency", not exactly as "we have an issue with the custom code", which could be true of course but not obvious. There is a separate issue for the custom component.

Мы не отслеживаем проблемы с пользовательской интеграцией в этом средстве отслеживания проблем.

in your opinion aiohttp is custom integration? broken auth method

We need information and log info from home assistant that shows the problem where no custom integration is used to be able to solve it. Please open a new issue when you can provide that.

This is the problem of problems. All voice control fell apart. And the authority of HA in the eyes of my family members fell as never before (((

@MartinHjelmare don't worry. Problem on the side of Yandex servers.

New aiohttp uses new compression params (wbits) for Content-Encoding: deflate compression. There are no mistakes.

Yandex servers, for some unknown reason, cannot read the response /auth/token with this new compression.

https://docs.python.org/3/library/zlib.html#zlib.compressobj

aiohttp==3.6.2

https://github.com/aio-libs/aiohttp/blob/v3.6.2/aiohttp/web_response.py#L683-L684

aiohttp==3.7.1

https://github.com/aio-libs/aiohttp/blob/v3.7.1/aiohttp/web_response.py#L736-L738

I made a fix to disable compression in Home Assistant and everything works:

https://github.com/AlexxIT/yandex_smart_home_fix

Thanks to @Anonym-tsk here description whats happened with deflate compression:

https://github.com/aio-libs/aiohttp/issues/4506

The same problem!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

piitaya picture piitaya  ·  3Comments

neonandu picture neonandu  ·  3Comments

Elmardus picture Elmardus  ·  3Comments

Konstigt picture Konstigt  ·  3Comments

MartinHjelmare picture MartinHjelmare  ·  3Comments