home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.97k stars 30.17k forks source link

Authentication issue with Renault #93966

Closed emmaguy closed 1 year ago

emmaguy commented 1 year ago

The problem

I can't login to my Renault account via the integration. If I enter the incorrect username and password, I get the following as you might expect:

Logger: homeassistant.components.renault.renault_hub
Source: components/renault/renault_hub.py:48
Integration: renault (documentation, issues)
First occurred: 12:22:15 (1 occurrences)
Last logged: 12:22:15

Login to Renault failed: invalid loginID or password

If I enter the correct username and pw, I get this:

Logger: aiohttp.server
Source: components/renault/renault_hub.py:107
First occurred: 11:33:16 (2 occurrences)
Last logged: 12:19:40

Error handling request
Traceback (most recent call last):
  File "/volume1/@appstore/homeassistant/env/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
    resp = await request_handler(request)
  File "/volume1/@appstore/homeassistant/env/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/volume1/@appstore/homeassistant/env/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/volume1/@appstore/homeassistant/env/lib/python3.10/site-packages/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/volume1/@appstore/homeassistant/env/lib/python3.10/site-packages/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
    return await handler(request)
  File "/volume1/@appstore/homeassistant/env/lib/python3.10/site-packages/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
  File "/volume1/@appstore/homeassistant/env/lib/python3.10/site-packages/homeassistant/components/http/ban.py", line 81, in ban_middleware
    return await handler(request)
  File "/volume1/@appstore/homeassistant/env/lib/python3.10/site-packages/homeassistant/components/http/auth.py", line 236, in auth_middleware
    return await handler(request)
  File "/volume1/@appstore/homeassistant/env/lib/python3.10/site-packages/homeassistant/components/http/view.py", line 136, in handle
    result = await result
  File "/volume1/@appstore/homeassistant/env/lib/python3.10/site-packages/homeassistant/components/config/config_entries.py", line 180, in post
    return await super().post(request, flow_id)
  File "/volume1/@appstore/homeassistant/env/lib/python3.10/site-packages/homeassistant/components/http/data_validator.py", line 73, in wrapper
    result = await method(view, request, data, *args, **kwargs)
  File "/volume1/@appstore/homeassistant/env/lib/python3.10/site-packages/homeassistant/helpers/data_entry_flow.py", line 110, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
  File "/volume1/@appstore/homeassistant/env/lib/python3.10/site-packages/homeassistant/data_entry_flow.py", line 286, in async_configure
    result = await self._async_handle_step(
  File "/volume1/@appstore/homeassistant/env/lib/python3.10/site-packages/homeassistant/data_entry_flow.py", line 374, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/volume1/@appstore/homeassistant/env/lib/python3.10/site-packages/homeassistant/components/renault/config_flow.py", line 45, in async_step_user
    return await self.async_step_kamereon()
  File "/volume1/@appstore/homeassistant/env/lib/python3.10/site-packages/homeassistant/components/renault/config_flow.py", line 76, in async_step_kamereon
    accounts = await self.renault_hub.get_account_ids()
  File "/volume1/@appstore/homeassistant/env/lib/python3.10/site-packages/homeassistant/components/renault/renault_hub.py", line 107, in get_account_ids
    for account in await self._client.get_api_accounts():
  File "/volume1/@appstore/homeassistant/env/lib/python3.10/site-packages/renault_api/renault_client.py", line 58, in get_api_accounts
    response = await self.get_person()
  File "/volume1/@appstore/homeassistant/env/lib/python3.10/site-packages/renault_api/renault_client.py", line 54, in get_person
    return await self.session.get_person()
  File "/volume1/@appstore/homeassistant/env/lib/python3.10/site-packages/renault_api/renault_session.py", line 175, in get_person
    return await kamereon.get_person(
  File "/volume1/@appstore/homeassistant/env/lib/python3.10/site-packages/renault_api/kamereon/__init__.py", line 178, in get_person
    await request(
  File "/volume1/@appstore/homeassistant/env/lib/python3.10/site-packages/renault_api/kamereon/__init__.py", line 160, in request
    http_response.raise_for_status()
  File "/volume1/@appstore/homeassistant/env/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('https://api-wired-prod-1-euw1.wrd-aws.com/commerce/v1/persons/f173ef72-e3a0-4685-b494-f72c0b624988?country=GB')

What version of Home Assistant Core has the issue?

core-2023.1.7

What was the last working version of Home Assistant Core?

N/A - new installation

What type of installation are you running?

Home Assistant Core

Integration causing the issue

Renault

Link to integration documentation on our website

https://www.home-assistant.io/integrations/renault/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

Looks similar to some historic issues, e.g. #68406

home-assistant[bot] commented 1 year ago

Hey there @epenet, mind taking a look at this issue as it has been labeled with an integration (renault) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `renault` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign renault` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


renault documentation renault source (message by IssueLinks)

arthur2017-ui commented 1 year ago

Hi, I have exactly same error message + log file when I try to connect = "Unknown error occurred". Login+pswd are correct. It has worked fine 2 monthes ago, and now it is impossible for me to reconnect successfully.

vbelloir commented 1 year ago

Same thing here.

It was working few months ago, but now, I got the same error and logs mentioned in first post.

vbelloir commented 1 year ago

UPDATE : My HA instance wasn't up to date. I updated my docker to 2023.7.3, and now I can login with Renault integration.

Renault API was updated in release 2023.4.6 : https://www.home-assistant.io/blog/2023/04/05/release-20234/#release-202343---april-12

epenet commented 1 year ago

Thanks for confirming

Please note that the correct link for 2023.4.6 is https://www.home-assistant.io/blog/2023/04/05/release-20234/#release-202346---april-21

epenet commented 1 year ago

@emmaguy please check your version of HA If you are using 2023.1.7 (as specified in your issue description) then you need to update to 2023.4.6 or later.

arthur2017-ui commented 1 year ago

Hello, with new HA version it works again FINE.THANK you very much René Griesmar06 43 37 32 58

Le mardi 1 août 2023 à 14:13:50 UTC+2, epenet ***@***.***> a écrit :  

@emmaguy please check your version of HA If you are using 2023.1.7 (as specified in your issue description) then you need to update to 2023.4.6 or later.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

craigmpeters commented 1 year ago

Just confirming with latest version it works, check the version number if you have updated the docker image as the repository I was using was not up to date with the latest version.

arthur2017-ui commented 1 year ago

Hello  yes it works fine again with Latest version. Thank you.

Envoyé par AOL sur Android

Le lun., août 7, 2023 à 16:40, Craig @.***> a écrit:

Just confirming with latest version it works, check the version number if you have updated the docker image as the repository I was using was not up to date with the latest version.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

arthur2017-ui commented 1 year ago

it works fine again with 

Le lundi 7 août 2023 à 16:40:59 UTC+2, Craig Peters ***@***.***> a écrit :  

Just confirming with latest version it works, check the version number if you have updated the docker image as the repository I was using was not up to date with the latest version.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>