Teslemetry / hass-teslemetry

Teslemetry integration from Home Assistant through HACS
https://teslemetry.com
MIT License
13 stars 7 forks source link

Teslemetry errors in log. Shortly after the errors, Home Assistant crashes #104

Closed drjjr2 closed 3 months ago

drjjr2 commented 4 months ago

Checklist

Describe the issue

For at least two days in a row I see errors in the log from Teslemetry. And each day about 15-18 minutes later, Home Assistant reboot.

Reproduction steps

Unclear. It looks like at 19:10 for the past two days, at least, there is an error listed below. A few minutes later, Home Assistant crashes/reboots. Could be coincidence...or not

Debug logs

2024-06-27 19:10:12.623 ERROR (MainThread) [custom_components.teslemetry] Error fetching Teslemetry Vehicle data: Either an internal service or a vehicle did not respond (timeout).
2024-06-27 19:10:22.467 ERROR (MainThread) [custom_components.teslemetry] Error fetching Teslemetry Vehicle data: Either an internal service or a vehicle did not respond (timeout).
2024-06-27 19:10:26.424 ERROR (MainThread) [custom_components.teslemetry] Error fetching Teslemetry Energy Site Live data: The response from the server was not JSON.
2024-06-27 19:11:23.295 INFO (MainThread) [backoff] Backing off async_request(...) for 0.5s (tesla_wall_connector.exceptions.WallConnectorConnectionTimeoutError: Timeout while connecting to Wall Connector at 192.168.0.142)
2024-06-27 19:15:37.650 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.weatheralerts_1 is taking over 10 seconds
*** end of log ***

The next day:
2024-06-28 19:10:00.462 ERROR (MainThread) [custom_components.teslemetry] Error fetching Teslemetry Vehicle data: The response from the server was not JSON.
2024-06-28 19:10:13.732 ERROR (MainThread) [custom_components.teslemetry] Error fetching Teslemetry Energy Site Live data: Either an internal service or a vehicle did not respond (timeout).
*** end of log ***
Bre77 commented 4 months ago

If they are happening at the exact same time, which is UTC 00:10, then I know what the problem is and will implement a serverside fix.

drjjr2 commented 4 months ago

If they are happening at the exact same time, which is UTC 00:10, then I know what the problem is and will implement a serverside fix.

Well I am in UTC-5 so that makes sense. I was going to disable Teslemetry today to see if that was really the issue. Should I leave it enabled to see if this is the issue?

Bre77 commented 4 months ago

If they are happening at the exact same time, which is UTC 00:10, then I know what the problem is and will implement a serverside fix.

Well I am in UTC-5 so that makes sense. I was going to disable Teslemetry today to see if that was really the issue. Should I leave it enabled to see if this is the issue?

Maybe leave it disabled so you can be sure, I'll know if I fixed my side in a little over 4 hours based on my server logs.

drjjr2 commented 4 months ago

Yeah, looks like the same thing happened today. I didn't get a chance to disable it before 19:10 today. I have it disabled now, so we shall see what happens tomorrow.

Bre77 commented 4 months ago

My server side fix didn't work because the API service restarted at 00:10 again. Which again seems to confirm it's the issue. I've made another attempt to resolve that and will monitor it closely tomorrow.

I have no idea why it's crashing though, I can't reproduce it on the core version.

drjjr2 commented 4 months ago

As I think we expected, no restart/crash today with the integration disabled.

Bre77 commented 4 months ago

There was also no service restart, so I believe you are safe to re-enable the integration and confirm no crash tomorrow. I am still unable to produce the crash/high CPU, but the server-side condition that causes that should not happen again.

drjjr2 commented 4 months ago

OK, will do. I will let you know what happens tomorrow evening

drjjr2 commented 4 months ago

No crashes yesterday with the integration enabled.