Vaskivskyi / ha-asusrouter

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

[Bug] Unable to add the integration #883

Open wozniak-michal opened 3 weeks ago

wozniak-michal commented 3 weeks ago

The problem

The following error appears when trying to add the integration:

Screenshot_20241106_153324_Home Assistant

Underlying error: Screenshot_20241106_153343_Home Assistant

2024-11-06 13:28:52.443 ERROR (MainThread) [homeassistant.config_entries] Error occurred loading flow for integration asusrouter: No module named 'asusrouter'

HA running in a Docker, integration installed via HACS:

Screenshot_20241106_153421_Home Assistant

Your device model

RT-AX56U

Firmware type

Merlin

Firmware version

3004.388.8_2

Integration version with the issue

0.34.0

Method of the integration installation

HACS

What version and type of Home Assistant installation do you use

Container 2024.10.2

Is there anything useful in the logs?

No response

Diagnostics information

No response

Additional information

No response

marcforn commented 2 weeks ago

Same here, the integration stopped working two days ago.

Vaskivskyi commented 2 weeks ago

Hello,

I suppose, you have installed the integration and then restarted HA as required? Can you please check that the issue persists if you restart your HA once more?

The No module named 'asusrouter' means, the library (backend of the integration) was not installed, or that the python env did not refresh the list of available packages. In the first case, it might be that the package was not installed due to some issue connecting to PyPI at the time or some internal issue with the installation.

If restarting does not help, please check whether your HA log shows any issues with installing asusrouter package.

Let me know what you find.

wozniak-michal commented 2 weeks ago

Hey @Vaskivskyi, thanks for the response!

I have removed the integration, enabled debug logging for HACS and installed the integration once again, here is the output:

2024-11-10 13:11:04.119 INFO (MainThread) [custom_components.hacs] Starting download, 0.34.1
2024-11-10 13:11:04.119 INFO (MainThread) [custom_components.hacs] <Integration Vaskivskyi/ha-asusrouter> Running pre installation steps
2024-11-10 13:11:04.120 INFO (MainThread) [custom_components.hacs] <Integration Vaskivskyi/ha-asusrouter> Pre installation steps completed
2024-11-10 13:11:04.120 INFO (MainThread) [custom_components.hacs] <Integration Vaskivskyi/ha-asusrouter> Running installation steps
2024-11-10 13:11:04.120 DEBUG (MainThread) [custom_components.hacs] <Integration Vaskivskyi/ha-asusrouter> Getting repository information
2024-11-10 13:11:04.420 DEBUG (MainThread) [custom_components.hacs] <Integration Vaskivskyi/ha-asusrouter> Did not update, content was not modified
2024-11-10 13:11:04.420 DEBUG (MainThread) [custom_components.hacs] <Integration Vaskivskyi/ha-asusrouter> Local path is set to /config/custom_components/asusrouter
2024-11-10 13:11:04.420 DEBUG (MainThread) [custom_components.hacs] <Integration Vaskivskyi/ha-asusrouter> Remote path is set to custom_components/asusrouter
2024-11-10 13:11:04.420 DEBUG (MainThread) [custom_components.hacs] <Integration Vaskivskyi/ha-asusrouter> Version to install: 0.34.1
2024-11-10 13:11:04.421 INFO (MainThread) [custom_components.hacs] <Integration Vaskivskyi/ha-asusrouter> Downloading repository archive
2024-11-10 13:11:04.421 DEBUG (MainThread) [custom_components.hacs] Trying to download https://github.com/Vaskivskyi/ha-asusrouter/archive/refs/tags/0.34.1.zip
2024-11-10 13:11:05.095 DEBUG (SyncWorker_39) [custom_components.hacs] <Integration Vaskivskyi/ha-asusrouter> Cleaning up /tmp/tmpatkqeser
2024-11-10 13:11:05.102 INFO (MainThread) [custom_components.hacs] <Integration Vaskivskyi/ha-asusrouter> Content was extracted to /config/custom_components/asusrouter
2024-11-10 13:11:05.102 INFO (MainThread) [custom_components.hacs] <Integration Vaskivskyi/ha-asusrouter> Installation steps completed
2024-11-10 13:11:05.102 INFO (MainThread) [custom_components.hacs] <Integration Vaskivskyi/ha-asusrouter> Running post installation steps
2024-11-10 13:11:05.103 INFO (MainThread) [custom_components.hacs] Reloading custom_component cache
2024-11-10 13:11:05.107 WARNING (SyncWorker_36) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-11-10 13:11:05.110 WARNING (SyncWorker_36) [homeassistant.loader] We found a custom integration asusrouter which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-11-10 13:11:05.112 WARNING (SyncWorker_36) [homeassistant.loader] We found a custom integration perfectgym which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-11-10 13:11:05.113 INFO (MainThread) [custom_components.hacs] Custom_component cache reloaded
2024-11-10 13:11:05.113 DEBUG (MainThread) [custom_components.hacs] <Integration Vaskivskyi/ha-asusrouter> Creating restart_required issue
2024-11-10 13:11:05.114 INFO (MainThread) [custom_components.hacs] <Integration Vaskivskyi/ha-asusrouter> Post installation steps completed
2024-11-10 13:11:05.136 DEBUG (MainThread) [custom_components.hacs] <HacsData async_write> Saving data

After the installation it asked for restart so I did it with debug logging still enabled.

2024-11-10 13:11:50.015 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-11-10 13:11:50.016 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration asusrouter which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-11-10 13:11:50.016 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration perfectgym which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-11-10 13:11:53.713 INFO (MainThread) [custom_components.hacs] 
-------------------------------------------------------------------
HACS (Home Assistant Community Store)

Version: 2.0.1
This is a custom integration
If you have any issues with this you need to open an issue here:
https://github.com/hacs/integration/issues
-------------------------------------------------------------------

2024-11-10 13:11:53.770 INFO (MainThread) [custom_components.hacs] <HacsData restore> Restore started
2024-11-10 13:11:53.878 INFO (MainThread) [custom_components.hacs] <HacsData restore> Restore done
2024-11-10 13:11:53.879 INFO (MainThread) [custom_components.hacs] Enable category: integration
2024-11-10 13:11:53.880 INFO (MainThread) [custom_components.hacs] Enable category: plugin
2024-11-10 13:11:53.880 INFO (MainThread) [custom_components.hacs] Enable category: template
2024-11-10 13:11:53.881 INFO (MainThread) [custom_components.hacs] Enable category: theme
2024-11-10 13:11:53.881 INFO (MainThread) [custom_components.hacs] Enable category: appdaemon
2024-11-10 13:11:53.918 INFO (MainThread) [custom_components.hacs] Setting up plugin endpoint
2024-11-10 13:11:53.918 INFO (MainThread) [custom_components.hacs] <HacsFrontend> storage mode, cache for /hacsfiles/: True
2024-11-10 13:11:55.547 INFO (MainThread) [custom_components.hacs] Stage changed: setup
2024-11-10 13:11:55.548 INFO (MainThread) [custom_components.hacs] Stage changed: waiting
2024-11-10 13:11:55.548 INFO (MainThread) [custom_components.hacs] Setup complete, waiting for Home Assistant before startup tasks starts
2024-11-10 13:11:55.817 INFO (MainThread) [custom_components.hacs] Stage changed: startup
2024-11-10 13:11:55.820 DEBUG (MainThread) [custom_components.hacs] There are 6 scheduled recurring tasks
2024-11-10 13:11:55.821 INFO (MainThread) [custom_components.hacs] Loading removed repositories
2024-11-10 13:11:55.948 INFO (MainThread) [custom_components.hacs] Loading known repositories
2024-11-10 13:11:55.948 DEBUG (MainThread) [custom_components.hacs] Fetching updated content for template
2024-11-10 13:11:55.949 DEBUG (MainThread) [custom_components.hacs] Fetching updated content for integration
2024-11-10 13:11:55.949 DEBUG (MainThread) [custom_components.hacs] Fetching updated content for appdaemon
2024-11-10 13:11:55.950 DEBUG (MainThread) [custom_components.hacs] Fetching updated content for plugin
2024-11-10 13:11:55.950 DEBUG (MainThread) [custom_components.hacs] Fetching updated content for theme
2024-11-10 13:11:56.230 INFO (MainThread) [custom_components.hacs] Stage changed: running
2024-11-10 13:11:56.272 DEBUG (MainThread) [custom_components.hacs] <QueueManager> The queue is empty
2024-11-10 13:11:56.273 DEBUG (MainThread) [custom_components.hacs] <HACSStore async_save_to_store> Did not store data for 'hacs.critical'. Content did not change
2024-11-10 13:11:56.273 DEBUG (MainThread) [custom_components.hacs] Nothing in the queue
2024-11-10 13:11:56.759 ERROR (SyncWorker_1) [aiodhcpwatcher] Cannot watch for dhcp packets: [Errno 1] Operation not permitted
2024-11-10 13:12:38.186 ERROR (MainThread) [homeassistant.config_entries] Error occurred loading flow for integration asusrouter: No module named 'asusrouter'

Also checked HA container logs using docker logs, nothing outstanding there unfortunately.

Decided to go for a bruteforce and installing the dependency manually:

docker exec -it <container> bash
pip list | grep asus # "asusrouter" wasn't there
pip install asusrouter

The installation went smoothly and I was able to add the integration afterwards.

Clearly HACS / my setup issue but I wonder why it didn't automatically install the requirements (asusrouter package in this case), otherwise there would be a log entry for that, right?

Sorry for the confusion, I think this can be closed unless anyone has anything to add.