runDMCA / home-assistant-mazda

Custom component for Home Assistant that adds integration for Mazda Connected Services
Apache License 2.0
27 stars 14 forks source link

Issue with HA 2024.7 #5

Open DiVrox opened 4 days ago

DiVrox commented 4 days ago

Thanks for you work! I really love this integration. No issues so far untill last night ... upgraded HA to 2024.7.0 and since then, the integration keeps initializing. Anyone else experiencing the same problem?

ilwalti commented 4 days ago

Same here. App on smartphone works fine.

I've got this debug log:

Traceback (most recent call last):
  File "/config/custom_components/mazda/__init__.py", line 154, in async_update_data
    vehicles = await with_timeout(mazda_client.get_vehicles())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mazda/__init__.py", line 56, in with_timeout
    async with asyncio.timeout(timeout_seconds):
  File "/usr/local/lib/python3.12/asyncio/timeouts.py", line 115, in __aexit__
    raise TimeoutError from exc_val
TimeoutError
2024-07-04 11:31:41.672 ERROR (MainThread) [custom_components.mazda] Unknown error occurred during Mazda update request: 
Traceback (most recent call last):
  File "/config/custom_components/mazda/__init__.py", line 57, in with_timeout
    return await task
           ^^^^^^^^^^
  File "/config/custom_components/mazda/pymazda/client.py", line 30, in get_vehicles
    vec_base_infos_response = await self.controller.get_vec_base_infos()
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mazda/pymazda/controller.py", line 30, in get_vec_base_infos
    return await self.connection.api_request(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mazda/pymazda/connection.py", line 191, in api_request
    return await self.__api_request_retry(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mazda/pymazda/connection.py", line 221, in __api_request_retry
    return await self.__send_api_request(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mazda/pymazda/connection.py", line 329, in __send_api_request
    response = await self._session.request(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 608, in _request
    await resp.start(conn)
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 976, in start
    message, payload = await protocol.read()  # type: ignore[union-attr]
                       ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/streams.py", line 640, in read
    await self._waiter
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/config/custom_components/mazda/__init__.py", line 154, in async_update_data
    vehicles = await with_timeout(mazda_client.get_vehicles())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mazda/__init__.py", line 56, in with_timeout
    async with asyncio.timeout(timeout_seconds):
  File "/usr/local/lib/python3.12/asyncio/timeouts.py", line 115, in __aexit__
    raise TimeoutError from exc_val
TimeoutError
2024-07-04 11:32:39.381 INFO (MainThread) [custom_components.mazda.pymazda.connection] Logging in as MY_SECOND_DRIVER
2024-07-04 11:32:39.381 INFO (MainThread) [custom_components.mazda.pymazda.connection] Retrieving public key to encrypt password
2024-07-04 11:32:39.800 INFO (MainThread) [custom_components.mazda.pymazda.connection] Sending login request
2024-07-04 11:32:39.934 INFO (MainThread) [custom_components.mazda.pymazda.connection] Successfully logged in as MY_SECOND_DRIVER
2024-07-04 11:32:39.935 INFO (MainThread) [custom_components.mazda.pymazda.connection] Retrieving encryption keys
2024-07-04 11:32:39.935 DEBUG (MainThread) [custom_components.mazda.pymazda.connection] Sending POST request to service/checkVersion
2024-07-04 11:32:40.297 INFO (MainThread) [custom_components.mazda.pymazda.connection] Successfully retrieved encryption keys
2024-07-04 11:32:40.297 DEBUG (MainThread) [custom_components.mazda.pymazda.connection] Sending POST request to remoteServices/getVecBaseInfos/v4
2024-07-04 11:33:09.940 ERROR (MainThread) [custom_components.mazda] Unknown error occurred during Mazda update request: 
Traceback (most recent call last):
  File "/config/custom_components/mazda/__init__.py", line 57, in with_timeout
    return await task
           ^^^^^^^^^^
  File "/config/custom_components/mazda/pymazda/client.py", line 30, in get_vehicles
    vec_base_infos_response = await self.controller.get_vec_base_infos()
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mazda/pymazda/controller.py", line 30, in get_vec_base_infos
    return await self.connection.api_request(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mazda/pymazda/connection.py", line 191, in api_request
    return await self.__api_request_retry(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mazda/pymazda/connection.py", line 221, in __api_request_retry
    return await self.__send_api_request(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mazda/pymazda/connection.py", line 329, in __send_api_request
    response = await self._session.request(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 608, in _request
    await resp.start(conn)
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 976, in start
    message, payload = await protocol.read()  # type: ignore[union-attr]
                       ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/streams.py", line 640, in read
    await self._waiter
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/config/custom_components/mazda/__init__.py", line 154, in async_update_data
    vehicles = await with_timeout(mazda_client.get_vehicles())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mazda/__init__.py", line 56, in with_timeout
    async with asyncio.timeout(timeout_seconds):
  File "/usr/local/lib/python3.12/asyncio/timeouts.py", line 115, in __aexit__
    raise TimeoutError from exc_val
TimeoutError
2024-07-04 11:33:09.943 DEBUG (MainThread) [custom_components.mazda] Finished fetching mazda data in 30.009 seconds (success: False)

I'm available for further debugging...

Grigorek commented 4 days ago

I can confirm, some logs like @ilwalti

Maggus574 commented 4 days ago

Hey!

Same problem here since Update to HA2024.7.

deherw commented 4 days ago

yep, me to.

ghammer80 commented 4 days ago

Same here.

oransterf commented 3 days ago

the irony that I had installed this only a few days ago and now it doesn't work anymore

doosterkamp commented 3 days ago

+1 Sam issue (and log entries) since 2024.7 over here also!

ilwalti commented 3 days ago

An update, but I don't know if it is somewhat related tho this issue... today I've received on the official app an advice that says that Mymazda app isn't reachable july 9, between 0100 and 0700 CEST, due to a programmed mainteance. Maybe they're doing something on the users' database

Bye

ctml91 commented 3 days ago

Same. Downgraded to 2024.6 docker.io/homeassistant/home-assistant:2024.6 and all working again. Will wait for someone to figure out a fix to upgrade HA :)

DiVrox commented 3 days ago

I can confirm core 2024.7.1 doesn't work either. Same error.

Downgraded to core 2024.6.4 and everything works fine again.

If I can be of any help testing something, let me know

formiification commented 2 days ago

shit... same story here; probably this project is not supported anymore, so downgrade to 2024.6 is not an option for longer time

deltamikeromeo commented 1 day ago

Same issue for me.

townsmcp commented 1 day ago

Same issue for me. I’m not a dev but it seems like HA apis have changed. For example the following API calls exist in the code found here https://developers.home-assistant.io/blog/2024/04/13/deprecate_async_track_state_change/. Also calls exist for async_forward_entry_setups. Are there any devs here that know about the deprecated calls and how to get round them?

ilwalti commented 1 day ago

Same issue for me. I’m not a dev but it seems like HA apis have changed.

This is for sure. At the moment, I can't find what is changed, unfortunately... @runDMCA , are you still on this project?

doosterkamp commented 8 hours ago

Funny thing is that the first API requests are successful, but theres a time-out when sending a POST request to remoteServices/getVecBaseInfos/v4

INFO (MainThread)  [custom_components.mazda.pymazda.connection] Logging in as XXXXXX@XXXXXXXXXX.XXX
INFO (MainThread)  [custom_components.mazda.pymazda.connection] Retrieving public key to encrypt password
INFO (MainThread)  [custom_components.mazda.pymazda.connection] Sending login request
INFO (MainThread)  [custom_components.mazda.pymazda.connection] Successfully logged in as XXXXXX@XXXXXXXXXX.XXX
INFO (MainThread)  [custom_components.mazda.pymazda.connection] Retrieving encryption keys
DEBUG (MainThread) [custom_components.mazda.pymazda.connection] Sending POST request to service/checkVersion
INFO (MainThread)  [custom_components.mazda.pymazda.connection] Successfully retrieved encryption keys
DEBUG (MainThread) [custom_components.mazda.pymazda.connection] Sending POST request to remoteServices/getVecBaseInfos/v4
ERROR (MainThread) [custom_components.mazda] Unknown error occurred during Mazda update request: 
                      Traceback (most recent call last):
                        File "/config/custom_components/mazda/__init__.py", line 57, in with_timeout
                          return await task
                                ^^^^^^^^^^
                        File "/config/custom_components/mazda/pymazda/client.py", line 30, in get_vehicles
                          vec_base_infos_response = await self.controller.get_vec_base_infos()
                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                        File "/config/custom_components/mazda/pymazda/controller.py", line 30, in get_vec_base_infos
                          return await self.connection.api_request(
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                        File "/config/custom_components/mazda/pymazda/connection.py", line 191, in api_request
                          return await self.__api_request_retry(
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                        File "/config/custom_components/mazda/pymazda/connection.py", line 221, in __api_request_retry
                          return await self.__send_api_request(
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                        File "/config/custom_components/mazda/pymazda/connection.py", line 329, in __send_api_request
                          response = await self._session.request(
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                        File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 608, in _request
                          await resp.start(conn)
                        File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 976, in start
                          message, payload = await protocol.read()  # type: ignore[union-attr]
                                            ^^^^^^^^^^^^^^^^^^^^^
                        File "/usr/local/lib/python3.12/site-packages/aiohttp/streams.py", line 640, in read
                          await self._waiter
                      asyncio.exceptions.CancelledError
                      The above exception was the direct cause of the following exception:
                      Traceback (most recent call last):
                        File "/config/custom_components/mazda/__init__.py", line 154, in async_update_data
                          vehicles = await with_timeout(mazda_client.get_vehicles())
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                        File "/config/custom_components/mazda/__init__.py", line 56, in with_timeout
                          async with asyncio.timeout(timeout_seconds):
                        File "/usr/local/lib/python3.12/asyncio/timeouts.py", line 115, in __aexit__
                          raise TimeoutError from exc_val
                      TimeoutError
DEBUG (MainThread) [custom_components.mazda] Finished fetching mazda data in 120.005 seconds (success: False)
townsmcp commented 7 hours ago

I did try upping line 57 of file init.py timeout from 30 seconds to 60 seconds and reboot HA but it still didn’t pull in anything on 2024.07

ilwalti commented 6 hours ago

I did try upping line 57 of file init.py timeout from 30 seconds to 60 seconds and reboot HA but it still didn’t pull in anything on 2024.07

Did the same, no joy...