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.14k stars 29.82k forks source link

Google maps travel distance is taking more than 10 sec then fails #124318

Open crissmil opened 3 weeks ago

crissmil commented 3 weeks ago

The problem

several error logs from google maps integration: "ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.xxxxx fails"

What version of Home Assistant Core has the issue?

core-2024.8.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

Google Maps

Link to integration documentation on our website

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

Diagnostics information

home-assistant_google_travel_time_2024-08-20T16-49-14.653Z.log

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2024-08-20 19:32:11.197 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.mirela_driving_home_time is taking over 10 seconds
2024-08-20 19:33:14.065 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.mirela_driving_home_time fails
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/googlemaps/client.py", line 253, in _request
    result = self._get_body(response)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/googlemaps/client.py", line 276, in _get_body
    raise googlemaps.exceptions._RetriableRequest()
googlemaps.exceptions._RetriableRequest

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/googlemaps/client.py", line 253, in _request
    result = self._get_body(response)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/googlemaps/client.py", line 276, in _get_body
    raise googlemaps.exceptions._RetriableRequest()
googlemaps.exceptions._RetriableRequest

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/googlemaps/client.py", line 253, in _request
    result = self._get_body(response)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/googlemaps/client.py", line 276, in _get_body
    raise googlemaps.exceptions._RetriableRequest()
googlemaps.exceptions._RetriableRequest

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/googlemaps/client.py", line 253, in _request
    result = self._get_body(response)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/googlemaps/client.py", line 276, in _get_body
    raise googlemaps.exceptions._RetriableRequest()
googlemaps.exceptions._RetriableRequest

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/googlemaps/client.py", line 253, in _request
    result = self._get_body(response)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/googlemaps/client.py", line 276, in _get_body
    raise googlemaps.exceptions._RetriableRequest()
googlemaps.exceptions._RetriableRequest

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/googlemaps/client.py", line 253, in _request
    result = self._get_body(response)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/googlemaps/client.py", line 276, in _get_body
    raise googlemaps.exceptions._RetriableRequest()
googlemaps.exceptions._RetriableRequest

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/googlemaps/client.py", line 253, in _request
    result = self._get_body(response)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/googlemaps/client.py", line 276, in _get_body
    raise googlemaps.exceptions._RetriableRequest()
googlemaps.exceptions._RetriableRequest

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/googlemaps/client.py", line 253, in _request
    result = self._get_body(response)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/googlemaps/client.py", line 276, in _get_body
    raise googlemaps.exceptions._RetriableRequest()
googlemaps.exceptions._RetriableRequest

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/googlemaps/client.py", line 253, in _request
    result = self._get_body(response)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/googlemaps/client.py", line 276, in _get_body
    raise googlemaps.exceptions._RetriableRequest()
googlemaps.exceptions._RetriableRequest

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/googlemaps/client.py", line 253, in _request
    result = self._get_body(response)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/googlemaps/client.py", line 276, in _get_body
    raise googlemaps.exceptions._RetriableRequest()
googlemaps.exceptions._RetriableRequest

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/googlemaps/client.py", line 253, in _request
    result = self._get_body(response)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/googlemaps/client.py", line 276, in _get_body
    raise googlemaps.exceptions._RetriableRequest()
googlemaps.exceptions._RetriableRequest

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 942, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1302, in async_device_update
    await hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/google_travel_time/sensor.py", line 175, in update
    self._matrix = distance_matrix(
                   ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/googlemaps/distance_matrix.py", line 130, in distance_matrix
    return client._request("/maps/api/distancematrix/json", params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/googlemaps/client.py", line 258, in _request
    return self._request(url, params, first_request_time,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/googlemaps/client.py", line 258, in _request
    return self._request(url, params, first_request_time,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/googlemaps/client.py", line 258, in _request
    return self._request(url, params, first_request_time,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  [Previous line repeated 8 more times]
  File "/usr/local/lib/python3.12/site-packages/googlemaps/client.py", line 203, in _request
    raise googlemaps.exceptions.Timeout()
googlemaps.exceptions.Timeout

Additional information

No response

home-assistant[bot] commented 3 weeks ago

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

Code owner commands Code owners of `google_travel_time` 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 google_travel_time` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


google_travel_time documentation google_travel_time source (message by IssueLinks)