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.28k stars 30.6k forks source link

Something is blocking Home Assistant from wrapping up the startup phase #94977

Closed smarthomejunkie closed 1 year ago

smarthomejunkie commented 1 year ago

The problem

Some integrations are not starting up anymore.

What version of Home Assistant Core has the issue?

core-2023.6.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

YouTube, Matter (beta), Google sheets

Link to integration documentation on our website

https://www.home-assistant.io/integrations/youtube/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.core
Source: core.py:361
First occurred: 12:38:43 PM (1 occurrences)
Last logged: 12:38:43 PM

Something is blocking Home Assistant from wrapping up the start up phase. We're going to continue anyway. Please report the following info at https://github.com/home-assistant/core/issues: camera.browser_mod, switch.synology_dsm, binary_sensor.tod, input_boolean, esphome, localtuya, binary_sensor.hassio, switch.adaptive_lighting, youtube, energyscore, onboarding, light.localtuya, alexa, zone, remote.harmony, climate.mqtt, map, tile, button.reolink, sensor.esphome, panel_custom, binary_sensor.mobile_app, number.esphome, openweathermap, media_player.fullykiosk, sensor.time_date, bluetooth_adapters, switch.zha, notify.ios, history, select.mqtt, alarm_control_panel.mqtt, neerslag, adaptive_lighting, rtsp_to_webrtc, switch.switchbot, calendar, sensor.neerslag, sensor.template, sensor.energyscore, media_player.group, system_log, wyoming, notify.whatspie, version, lovelace, switch.adguard, notify.rest, homeassistant_sky_connect, google_assistant, radio_browser, switch.localtuya, button.plex, logbook, input_datetime, influxdb, adguard, discovery, switch.harmony, counter, media_player.apple_tv, switch.template, binary_sensor.browser_mod, dreamscreen, climate, lock.zha, gree, sensor.co2signal, fan.mqtt, config, stream, binary_sensor.cloud, octoprint, tts.cloud, device_automation, homeassistant_alerts, calendar.local_calendar, ios, sensor.octoprint, camera.reolink, remote.apple_tv, person, device_tracker, weather, search, update.reolink, zha, update.hassio, weather.openweathermap, input_number, light.browser_mod, sensor.browser_mod, light.group, trace, select.esphome, sensor.ios, climate.evohome, camera.ring, nordpool, fan.zha, persistent_notification, humidifier.mqtt, update.synology_dsm, alarm_control_panel.zha, button.shelly, media_player.cast, script, repairs, homekit_controller, siren.mqtt, climate.zha, sensor.moon, cover.localtuya, device_tracker.ibeacon, entsoe, binary_sensor.group, network, cover.shelly, update, file_upload, humidifier, remote.broadlink, timer, vacuum, sensor.ring, switch.reolink, dhcp, sensor.mqtt, mobile_app, device_tracker.mobile_app, media_player.browser_mod, spotify, sensor.solaredge, input_text, browser_mod, camera.buienradar, switch.broadlink, lock.mqtt, my, number.fullykiosk, weather.met, tplink_deco, analytics, binary_sensor.esphome, sensor.waze_travel_time, sensor.nordpool, sensor.hacs, season, siren.ring, binary_sensor.switchbot, tag, binary_sensor.zha, generic, co2signal, sensor.buienradar, automation, sensor.rest, number.reolink, template, binary_sensor.octoprint, hardware, uptime, sensor.synology_dsm, light.fullykiosk, ring, binary_sensor.reolink, apple_tv, local_calendar, forecast_solar, sensor.version, ffmpeg, cover.homekit_controller, group, sensor.systemmonitor, wake_on_lan, recorder, number.zha, input_button, text, binary_sensor.mqtt, binary_sensor.synology_dsm, light.shelly, light, sensor.ipp, notify.mobile_app, vacuum.mqtt, switch_as_x, media_source, remote, media_player.esphome, media_player.spotify, sensor.shelly, sensor.fullykiosk, binary_sensor.ring, moon, select.harmony, select.reolink, command_line, sensor.switchbot, sensor.history_stats, hardkernel, thread, camera.local_file, number, homekit, select.roborock, multiscrape, ibeacon, synology_dsm, sensor.speedtestdotnet, tts.google_translate, sensor.sun, conversation, fullykiosk, sensor.roborock, energy, camera.generic, spotcast, switch.roborock, cover.mqtt, zonneplan_one, usb, sensor.command_line, sensor.zonneplan_one, sensor.homekit_controller, proximity, application_credentials, solaredge, button.mqtt, sensor.cryptostate, auth, siren.reolink, lock, http, update.mqtt, stt, camera.mqtt, bluetooth, diagnostics, siren.zha, emulated_hue, number.mqtt, harmony, cast, cover.group, google_sheets, media_player.plex, button.zha, camera, sensor.entsoe, sensor.multiscrape, rest_command, api, webrtc, sensor.group, sensor.plex, binary_sensor.version, logger, sensor.openweathermap, reolink, waze_travel_time, homeassistant_hardware, button.google_assistant, siren, climate.gree, sensor.hassio, light.esphome, camera.octoprint, button.esphome, button.fullykiosk, roborock, cover, select.zha, scene, sensor.broadlink, buienradar, text.mqtt, tts, sensor.mobile_app, notify, image_upload, utility_meter, media_player, homeassistant, rest, plex, scene.mqtt, webhook, input_select, ipp, mqtt, sensor.afvalwijzer, fan, sensor.forecast_solar, select, button, device_tracker.tplink_deco, button.synology_dsm, sensor.uptime, broadlink, tts.wyoming, update.shelly, cryptostate, switchbot, websocket_api, shelly, switch.fullykiosk, switch.esphome, speedtestdotnet, schedule, binary_sensor.fullykiosk, feedreader, sensor.zha, assist_pipeline, sensor.energy, sensor.ibeacon, button.homekit_controller, sensor.season, binary_sensor.shelly, frontend, zeroconf, system_health, sensor.utility_meter, evohome, alarm_control_panel.manual, switch.ring, sensor, stt.wyoming, vacuum.roborock, met, ssdp, cloud, camera.synology_dsm, binary_sensor.zonneplan_one, binary_sensor, default_config, light.switch_as_x, hassio, button.octoprint, light.reolink, matter, sun, switch, light.mqtt, weather.buienradar, cover.zha, light.ring, device_tracker.zha, switch.shelly, switch.mqtt, device_tracker.mqtt, hacs, switch.gree, sensor.adguard, blueprint, openai_conversation, cover.switchbot, scene.homeassistant, alarm_control_panel, tod, light.zha, device_tracker.tile

Additional information

No response

home-assistant[bot] commented 1 year ago

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

Code owner commands Code owners of `youtube` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign youtube` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


youtube documentation youtube source (message by IssueLinks)

smarthomejunkie commented 1 year ago

Might be an issue with another integration, but YouTube, Matter, and Google Sheets are failing to setup. Even rebooted the host without any solution.

joostlek commented 1 year ago

Are you mentioning YouTube, Matter and Google sheets because those integrations haven't loaded yet? Ah, just read your comment

joostlek commented 1 year ago

What can you find in the logs that might look interesting?

smarthomejunkie commented 1 year ago

Are you mentioning YouTube, Matter and Google sheets because those integrations haven't loaded yet?

Yes, they give errors like this:

image

smarthomejunkie commented 1 year ago

Everything worked fine before the latest subrelease as far as I know.

smarthomejunkie commented 1 year ago

What can you find in the logs that might look interesting?

Things that I can find are the message in the main topic and below messages:

Config entry 'Matter' for matter integration not ready yet: Failed to connect to matter server; Retrying in background
12:28:59 PM – (WARNING) config_entries.py - message first occurred at 12:28:55 PM and shows up 2 times

Logger: homeassistant.config_entries
Source: config_entries.py:429
First occurred: 12:28:55 PM (2 occurrences)
Last logged: 12:28:59 PM

Config entry 'Matter' for matter integration not ready yet: Failed to connect to matter server; Retrying in background
Config entry 'Home Assistant Website' for version integration not ready yet: Timeout of 10 seconds was reached while fetching version for haio; Retrying in background

===============================================

Error setting up entry Smart Home Junkie for youtube
12:33:28 PM – (ERROR) helpers/config_entry_oauth2_flow.py - message first occurred at 12:33:28 PM and shows up 2 times

Logger: homeassistant.config_entries
Source: helpers/config_entry_oauth2_flow.py:201
First occurred: 12:33:28 PM (2 occurrences)
Last logged: 12:33:28 PM

Error setting up entry Smart Home Junkie for youtube
Error setting up entry Google Sheets for google_sheets
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/youtube/__init__.py", line 29, in async_setup_entry
    await auth.check_and_refresh_token()
  File "/usr/src/homeassistant/homeassistant/components/youtube/api.py", line 34, in check_and_refresh_token
    await self.oauth_session.async_ensure_token_valid()
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 499, in async_ensure_token_valid
    new_token = await self.implementation.async_refresh_token(self.token)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 92, in async_refresh_token
    new_token = await self._async_refresh_token(token)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 182, in _async_refresh_token
    new_token = await self._token_request(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 201, in _token_request
    resp = await session.post(self.token_url, data=data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 536, in _request
    conn = await self._connector.connect(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 540, in connect
    proto = await self._create_connection(req, traces, timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 901, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 980, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore[return-value]  # noqa
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1069, in create_connection
    sock = await self._connect_sock(
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 973, in _connect_sock
    await self.sock_connect(sock, address)
  File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 634, in sock_connect
    return await fut
           ^^^^^^^^^
asyncio.exceptions.CancelledError
joostlek commented 1 year ago

I have no clue, but I am reading the messages and it seems that for some reason your HA instance can't reach Youtube, Matter nor the HA website. You look like you have other integrations that have outbound connections aswell (spotify for example). Could you maybe try to curl, wget or whatever to them from the command line? Just to verify that the pi can get a connection to those services?

smarthomejunkie commented 1 year ago

I have no clue, but I am reading the messages and it seems that for some reason your HA instance can't reach Youtube, Matter nor the HA website. You look like you have other integrations that have outbound connections aswell (spotify for example). Could you maybe try to curl, wget or whatever to them from the command line? Just to verify that the pi can get a connection to those services?

I just tried curl and can connect to https://www.youtube.com from my Home Assistant Blue.

smarthomejunkie commented 1 year ago

The problem seems to be solved. I disabled InfluxDB and AdGuard. One of those actions solved the issue for now.