Vaskivskyi / ha-asusrouter

Monitor and control your AsusWRT-powered router from Home Assistant
https://asusrouter.vaskivskyi.com
Apache License 2.0
173 stars 16 forks source link

[Bug] Entities become unavailable/stuck after a few hours after HA restart #598

Closed szerencl closed 8 months ago

szerencl commented 1 year ago

The problem

For a few hours after restarting Home Assistant the integration works flawlessly, but after a few hours an error (see log below) occurs and causes entities and device_trackers to stop updating. A log with DEBUG level is also attached further down.

kép kép

2023-06-14 15:58:44.990 ERROR (MainThread) [custom_components.asusrouter.router] Error fetching boottime data: None
2023-06-14 15:58:45.011 ERROR (MainThread) [custom_components.asusrouter.router] Error fetching sysinfo data: None
2023-06-14 15:58:45.990 ERROR (MainThread) [custom_components.asusrouter.router] Error fetching temperature data: None
2023-06-14 15:58:45.992 ERROR (MainThread) [custom_components.asusrouter.router] Error fetching gwlan data: None
2023-06-14 15:58:45.996 ERROR (MainThread) [custom_components.asusrouter.router] Error connecting to '192.168.0.1' for device update: None
2023-06-14 15:58:46.991 ERROR (MainThread) [custom_components.asusrouter.router] Error fetching ports data: None
2023-06-14 15:59:14.989 ERROR (MainThread) [custom_components.asusrouter.router] Error fetching port_forwarding data: None
2023-06-14 15:59:14.991 ERROR (MainThread) [custom_components.asusrouter.router] Error fetching parental_control data: None
2023-06-14 15:59:14.993 ERROR (MainThread) [custom_components.asusrouter.router] Error fetching ram data: None
2023-06-14 15:59:14.997 ERROR (MainThread) [custom_components.asusrouter.router] Error fetching led data: None

Your device model

RT-AX56U

Firmware type

Merlin

Firmware version

3.0.0.4.388.1_0

Integration version with the issue

0.22.0

Method of the integration installation

HACS

What version and type of Home Assistant installation do you use

docker 2023.6.1

Is there anything useful in the logs?

2023-06-13 21:28:57.992 ERROR (MainThread) [custom_components.asusrouter.router] Error fetching sysinfo data: None
2023-06-13 21:28:58.005 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching sysinfo data in 300.604 seconds (success: False)
2023-06-13 21:29:25.584 DEBUG (MainThread) [custom_components.asusrouter.router] Device tracking is enabled
2023-06-13 21:29:25.584 DEBUG (MainThread) [custom_components.asusrouter.router] Updating AsusRouter device list for '192.168.0.1'
2023-06-13 21:29:25.584 DEBUG (MainThread) [asusrouter.asusrouter] Monitor `update_clients` is enabled
2023-06-13 21:29:25.585 DEBUG (MainThread) [asusrouter.asusrouter] Monitor `onboarding` is enabled
2023-06-13 21:29:25.585 DEBUG (MainThread) [asusrouter.asusrouter] Value `clients` is not in cache yet by monitor `update_clients` or the caching time has already expired
2023-06-13 21:29:25.585 DEBUG (MainThread) [asusrouter.asusrouter] Monitor `update_clients` is enabled
2023-06-13 21:29:25.989 ERROR (MainThread) [custom_components.asusrouter.router] Error connecting to '192.168.0.1' for device update: None
2023-06-13 21:29:25.995 DEBUG (MainThread) [custom_components.asusrouter.router] Updating AiMesh status for '192.168.0.1'
2023-06-13 21:29:25.996 DEBUG (MainThread) [asusrouter.asusrouter] Monitor `onboarding` is enabled
2023-06-13 21:29:25.996 DEBUG (MainThread) [asusrouter.asusrouter] Value `aimesh` is not in cache yet by monitor `onboarding` or the caching time has already expired
2023-06-13 21:29:25.996 DEBUG (MainThread) [asusrouter.asusrouter] Monitor `onboarding` is enabled
2023-06-13 21:29:26.085 DEBUG (MainThread) [asusrouter.asusrouter] Value `clients` is not in cache yet by monitor `onboarding` or the caching time has already expired
2023-06-13 21:29:26.085 DEBUG (MainThread) [asusrouter.asusrouter] Monitor `onboarding` is enabled
2023-06-13 21:29:26.086 DEBUG (MainThread) [asusrouter.asusrouter] Value `clients` is not in cache yet by monitor `onboarding` or the caching time has already expired
2023-06-13 21:29:26.086 DEBUG (MainThread) [asusrouter.asusrouter] Monitor `onboarding` is enabled
2023-06-13 21:29:26.086 DEBUG (MainThread) [asusrouter.asusrouter] Value `clients` is not in cache yet by monitor `onboarding` or the caching time has already expired
2023-06-13 21:29:26.086 DEBUG (MainThread) [asusrouter.asusrouter] Monitor `onboarding` is enabled
2023-06-13 21:29:26.087 DEBUG (MainThread) [asusrouter.asusrouter] Value `clients` is not in cache yet by monitor `onboarding` or the caching time has already expired
2023-06-13 21:29:26.087 DEBUG (MainThread) [asusrouter.asusrouter] Monitor `onboarding` is enabled
2023-06-13 21:29:26.087 DEBUG (MainThread) [asusrouter.asusrouter] Value `clients` is not in cache yet by monitor `onboarding` or the caching time has already expired
2023-06-13 21:29:26.087 DEBUG (MainThread) [asusrouter.asusrouter] Monitor `onboarding` is enabled
2023-06-13 21:29:26.088 DEBUG (MainThread) [asusrouter.asusrouter] Value `clients` is not in cache yet by monitor `onboarding` or the caching time has already expired
2023-06-13 21:29:26.088 DEBUG (MainThread) [asusrouter.asusrouter] Monitor `onboarding` is enabled
2023-06-13 21:29:26.089 DEBUG (MainThread) [asusrouter.asusrouter] Value `clients` is not in cache yet by monitor `onboarding` or the caching time has already expired
2023-06-13 21:29:26.089 DEBUG (MainThread) [asusrouter.asusrouter] Monitor `onboarding` is enabled
2023-06-13 21:29:26.089 DEBUG (MainThread) [asusrouter.asusrouter] Value `clients` is not in cache yet by monitor `onboarding` or the caching time has already expired
2023-06-13 21:29:26.089 DEBUG (MainThread) [asusrouter.asusrouter] Monitor `onboarding` is enabled
2023-06-13 21:29:26.090 DEBUG (MainThread) [asusrouter.asusrouter] Value `clients` is not in cache yet by monitor `onboarding` or the caching time has already expired
2023-06-13 21:29:26.090 DEBUG (MainThread) [asusrouter.asusrouter] Monitor `onboarding` is enabled
2023-06-13 21:29:26.090 DEBUG (MainThread) [asusrouter.asusrouter] Value `clients` is not in cache yet by monitor `onboarding` or the caching time has already expired
2023-06-13 21:29:26.090 DEBUG (MainThread) [asusrouter.asusrouter] Monitor `onboarding` is enabled
2023-06-13 21:29:26.990 ERROR (MainThread) [custom_components.asusrouter.router] Error fetching parental_control data: None
2023-06-13 21:29:26.991 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching parental_control data in 300.805 seconds (success: False)
2023-06-13 21:29:26.992 ERROR (MainThread) [custom_components.asusrouter.router] Error fetching led data: None
2023-06-13 21:29:26.996 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching led data in 300.759 seconds (success: False)
2023-06-13 21:29:26.997 ERROR (MainThread) [custom_components.asusrouter.router] Error fetching port_forwarding data: None
2023-06-13 21:29:27.001 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching port_forwarding data in 300.609 seconds (success: False)
2023-06-13 21:29:27.002 ERROR (MainThread) [custom_components.asusrouter.router] Error fetching gwlan data: None
2023-06-13 21:29:27.005 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching gwlan data in 300.729 seconds (success: False)
2023-06-13 21:29:27.006 ERROR (MainThread) [custom_components.asusrouter.router] Error fetching temperature data: None
2023-06-13 21:29:27.013 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching temperature data in 300.637 seconds (success: False)
2023-06-13 21:29:27.014 ERROR (MainThread) [custom_components.asusrouter.router] Error fetching ports data: None
2023-06-13 21:29:27.022 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching ports data in 300.840 seconds (success: False)
2023-06-13 21:29:27.023 ERROR (MainThread) [custom_components.asusrouter.router] Error fetching wan data: None
2023-06-13 21:29:27.026 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching wan data in 300.825 seconds (success: False)
2023-06-13 21:29:27.027 ERROR (MainThread) [custom_components.asusrouter.router] Error fetching boottime data: None
2023-06-13 21:29:27.030 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching boottime data in 300.908 seconds (success: False)
2023-06-13 21:29:27.053 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching wlan data in 300.698 seconds (success: True)
2023-06-13 21:29:27.054 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching ram data in 300.698 seconds (success: True)
2023-06-13 21:29:27.054 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching cpu data in 300.698 seconds (success: True)
2023-06-13 21:29:27.055 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching network data in 300.587 seconds (success: True)

Diagnostics information

No response

Additional information

No response

Vaskivskyi commented 1 year ago

Hello. Thanks for your report

From your info and logs looks like the device is dropping connection session and then integration cannot reconnect. That's why your log is showing 300 s - that's just the timeout after which it stops trying.

I'll check why it might happen and will let you know whether some more info is needed from your side

P.S. Have you maybe noticed some other feature of this happening except for the timeframe? Maybe some automations triggering with AsusRouter in your HA?

P.P.S. Do you connect to the device using SSL or non-SSL connection?

gregoriusus commented 9 months ago

I have similar problems. Device tracking stops working. Same Merlin firmware, same router. I am using SSL connection.

Vaskivskyi commented 9 months ago

Hello, @szerencl,

You can check now in the new 0.23.0b1 release whether the issue is fixed now. The connection part was completely rebuilt and should work better now


@gregoriusus,

Please, follow the device tracker issue #570. Unfortunately, this is the weirdest part of the Asus API and is still a large work in progress

gregoriusus commented 9 months ago

Great news, will check it. How should I upgrade? Should I delete everything in custom_components/asusrouter/ and dowload from latest branch?

Vaskivskyi commented 9 months ago

You can install it via HACS. Just select the "Show beta versions" for the AsusRouter repository in it

Vaskivskyi commented 8 months ago

The original issue should have already been fixed. In case, you are experiencing any other problems, please, open a new issue