core: Dependency for mqtt component does not work as expected
The problem
Change https://github.com/home-assistant/core/pull/92296 was needed to make sure the snips integration set’s up.
It failed because mqtt was not available, while that should not be possible.
It is known that if an integration is set up as a platform it could be triggered by the mqtt platform setup.
But snips is an integration component that should wait for the mqtt integration component as a dependency.
Issue https://github.com/home-assistant/core/issues/92236 proves this does not work.
What version of Home Assistant Core has the issue?
core-dev-2023.5.b0
What was the last working version of Home Assistant Core?
core-dev-2023.4.0
What type of installation are you running?
Home Assistant OS
Integration causing the issue
mqtt
Link to integration documentation on our website
No response
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
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 32 (29 by maintainers)
What happens is that
async_setupis awaited for, but notasync_setup_entry. There were recent changes where we do not useasync_setupanymore. Theafter_dependenciesmight work, but only ifmqttwas set up manually andmqttis optional. So forsnipsthe added check is a good solution. Thedependencywill make suremqttis set up or the integration with the dependency will fail.snips takes 1.66 seconds to start up. i’ll have a look in the log files and see what i can find after i set he logs to more verbose reporting (as per default setting integration startup is not logged).
@jbouwh asked in https://github.com/home-assistant/core/issues/92236#issuecomment-1529058634
i do, actually. first came the fritz integration to my mind, which takes about 140 seconds. when i looked again, there’s the xiaomi_miio_fan integration that takes a staggerin 862 seconds — although it was deactivated in the frontend. also, since i use a lot of command line sensors, the command line integration takes 23 seconds.
as far as i understand, none of the above mentioned intergrations use mqtt and after startup, mqtt usally is up shortly after the fritz integration is up. i never see any mention of the xiaomi_miio_fan integration in the startup notificaton („HA has not initialized completly, starting xxx“).