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
73.71k stars 30.83k forks source link

Traccar integration: device_trackers stopped updating AGAIN #76400

Closed ildar170975 closed 2 years ago

ildar170975 commented 2 years ago

The problem

Recently it broke, then was fixed: https://github.com/home-assistant/core/issues/74134 Symptoms are same.

Now the same story:

2022-08-07 19:21:22.490 ERROR (MainThread) [homeassistant.components.device_tracker] Error setting up platform legacy traccar
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/pytraccar/client.py", line 63, in _call_api
async with self._client_session.get(
File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 1138, in __aenter__
self._resp = await self._coro
File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 466, in _request
with timer:
File "/usr/local/lib/python3.10/site-packages/aiohttp/helpers.py", line 721, in __exit__
raise asyncio.TimeoutError from None
asyncio.exceptions.TimeoutError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/device_tracker/legacy.py", line 254, in async_setup_legacy
setup = await self.platform.async_setup_scanner(
File "/usr/src/homeassistant/homeassistant/components/traccar/device_tracker.py", line 201, in async_setup_scanner
return await scanner.async_init()
File "/usr/src/homeassistant/homeassistant/components/traccar/device_tracker.py", line 237, in async_init
await self._api.get_server()
File "/usr/local/lib/python3.10/site-packages/pytraccar/client.py", line 105, in get_server
await self._call_api("server"),
File "/usr/local/lib/python3.10/site-packages/pytraccar/client.py", line 85, in _call_api
raise TraccarConnectionException("Timeouterror connecting to Traccar") from exception
pytraccar.exceptions.TraccarConnectionException: Timeouterror connecting to Traccar

What version of Home Assistant Core has the issue?

2022.8.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Traccar

Link to integration documentation on our website

https://github.com/home-assistant/core/tree/dev/homeassistant/components/traccar

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

ildar170975 commented 2 years ago

Restarted HA, it works again... Hope that was a temporary glitch. Closing now.

ildar170975 commented 2 years ago

Sorry for repeating - last days I keep getting errors in the log on HA startup:

2022-08-14 17:49:59.261 ERROR (MainThread) [homeassistant.components.device_tracker] Error setting up platform legacy traccar
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/pytraccar/client.py", line 63, in _call_api
async with self._client_session.get(
File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 1138, in __aenter__
self._resp = await self._coro
File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 466, in _request
with timer:
File "/usr/local/lib/python3.10/site-packages/aiohttp/helpers.py", line 721, in __exit__
raise asyncio.TimeoutError from None
asyncio.exceptions.TimeoutError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/device_tracker/legacy.py", line 254, in async_setup_legacy
setup = await self.platform.async_setup_scanner(
File "/usr/src/homeassistant/homeassistant/components/traccar/device_tracker.py", line 201, in async_setup_scanner
return await scanner.async_init()
File "/usr/src/homeassistant/homeassistant/components/traccar/device_tracker.py", line 237, in async_init
await self._api.get_server()
File "/usr/local/lib/python3.10/site-packages/pytraccar/client.py", line 105, in get_server
await self._call_api("server"),
File "/usr/local/lib/python3.10/site-packages/pytraccar/client.py", line 85, in _call_api
raise TraccarConnectionException("Timeouterror connecting to Traccar") from exception
pytraccar.exceptions.TraccarConnectionException: Timeouterror connecting to Traccar

and device_tracker entities do not contain any data. It happens not always.

probot-home-assistant[bot] commented 2 years ago

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


traccar documentation traccar source (message by IssueLinks)

ludeeus commented 2 years ago

This is far from the same. Your system can not get a response from traccar server fast enough. Most likely its due to bad hardware, or something like custom components are blocking.

ildar170975 commented 2 years ago

Hardware is rather powerful, Intel 2500K. Speedtest - DL 802.04 Mbit, UL 915.11 Mbit.

Custom components: trackers: asuswrt, iphone detect, Life360, mobile app weather: gismeteo, openweathermap, met kodi uptime version filesize yandex maps xiaomi miio hacs icons: simple icons, font awesome sun season

Mainly there are no errors described above. But sometimes I see them in the log - and I still mainly have device_trackers updated. And sometimes I see these errors right after HA reboot and then these device_trackers are empty. Let's say - erratic errors.

ildar170975 commented 2 years ago

@ludeeus Thanks a lot! Hope it will be more stable now