{"action":"created","issue":{"url":"https://api.github.com/repos/home-assistant/home-assistant/issues/14309","repository_url":"https://api.github.com/repos/home-assistant/home-assistant","labels_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/14309/labels{/name}","comments_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/14309/comments","events_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/14309/events","html_url":"https://github.com/home-assistant/home-assistant/issues/14309","id":320569785,"number":14309,"title":"MQTT discovery broken with 0.69.0","user":{"login":"OttoWinter","id":6833237,"avatar_url":"https://avatars1.githubusercontent.com/u/6833237?v=4","gravatar_id":"","url":"https://api.github.com/users/OttoWinter","html_url":"https://github.com/OttoWinter","followers_url":"https://api.github.com/users/OttoWinter/followers","following_url":"https://api.github.com/users/OttoWinter/following{/other_user}","gists_url":"https://api.github.com/users/OttoWinter/gists{/gist_id}","starred_url":"https://api.github.com/users/OttoWinter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OttoWinter/subscriptions","organizations_url":"https://api.github.com/users/OttoWinter/orgs","repos_url":"https://api.github.com/users/OttoWinter/repos","events_url":"https://api.github.com/users/OttoWinter/events{/privacy}","received_events_url":"https://api.github.com/users/OttoWinter/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-05-06T07:26:26Z","updated_at":"2018-05-06T14:40:32Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"**Home Assistant release with the issue:** 0.69.0b0\r\n**Last working Home Assistant release (if known):** 0.68.1\r\n**Operating environment (Hass.io/Docker/Windows/etc.):** Docker container with `rc` tag.\r\n\r\n**Component/platform:** [MQTT Discovery](https://www.home-assistant.io/docs/mqtt/discovery/), but probably related to the `discovery` loader code.\r\n\r\n**Description of problem:**\r\n\r\nSomething in the discovery loading code is wrong and causing full Home Assistant restarts every ~30 seconds if MQTT Discovery is enabled.\r\n\r\nHow I'm seeing this issue: I have MQTT discovery enabled with about ~100 devices. Every time Home Assistant restarts, it first takes a while until the MQTT client receives all discovery messages. When the core then goes ahead and loads the individual sensors/actuators, an exception in the loader is thrown.\r\n\r\nAn interesting thing about this is that *one* sensor always shows up correctly, but no others do. \r\n\r\nProbably due to  #14211. I will take a closer look at this issue soon, but I currently really have to learn for my next final exam in maths, sorry. So just dropping this traceback here to hopefully help resolve this issue.\r\n\r\n**Problem-relevant `configuration.yaml` entries and (fill out even if it seems unimportant):**\r\n```yaml\r\nmqtt:\r\n  # ...\r\n  discovery: True\r\n```\r\n\r\nPossible steps to reproduce (there are other ways too probably):\r\n 1. Enable MQTT discovery.\r\n 2. Set up a few MQTT discovery messages.\r\n 3. Start Home Assistant\r\n 4. See a bunch of stack traces like the one below in the error log. Eventually Home Assistant also seems to restart itself.\r\n\r\n**Traceback (if applicable):**\r\n```\r\n2018-05-06 09:13:59 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved\r\nTraceback (most recent call last):\r\nFile \"/usr/src/app/homeassistant/helpers/entity_component.py\", line 91, in component_platform_discovered\r\n   await self._async_setup_platform(platform, {}, info)\r\nFile \"/usr/src/app/homeassistant/helpers/entity_component.py\", line 148, in _async_setup_platform\r\n  self.hass, self.config, self.domain, platform_type)\r\nFile \"/usr/src/app/homeassistant/setup.py\", line 196, in async_prepare_setup_platform\r\n   platform = loader.get_platform(hass, domain, platform_name)\r\nFile \"/usr/src/app/homeassistant/loader.py\", line 64, in get_platform\r\n  return get_component(hass, PLATFORM_FORMAT.format(domain, platform))\r\nFile \"/usr/src/app/homeassistant/loader.py\", line 76, in get_component\r\n  comp_or_platform)\r\nFile \"/usr/src/app/homeassistant/loader.py\", line 107, in _load_module\r\n  spec = _find_spec([path], name)\r\nFile \"/usr/src/app/homeassistant/loader.py\", line 96, in _find_spec\r\n  spec = finder.find_spec(name, path=path)\r\nFile \"<frozen importlib._bootstrap_external>\", line 1166, in find_spec\r\nFile \"<frozen importlib._bootstrap_external>\", line 963, in __init__\r\nFile \"<frozen importlib._bootstrap_external>\", line 978, in _get_parent_path\r\nKeyError: 'sensor'\r\n```\r\n\r\n**Additional information:**\r\n\r\nCC @balloob "},"comment":{"url":"https://api.github.com/repos/home-assistant/home-assistant/issues/comments/386884272","html_url":"https://github.com/home-assistant/home-assistant/issues/14309#issuecomment-386884272","issue_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/14309","id":386884272,"user":{"login":"balloob","id":1444314,"avatar_url":"https://avatars3.githubusercontent.com/u/1444314?v=4","gravatar_id":"","url":"https://api.github.com/users/balloob","html_url":"https://github.com/balloob","followers_url":"https://api.github.com/users/balloob/followers","following_url":"https://api.github.com/users/balloob/following{/other_user}","gists_url":"https://api.github.com/users/balloob/gists{/gist_id}","starred_url":"https://api.github.com/users/balloob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balloob/subscriptions","organizations_url":"https://api.github.com/users/balloob/orgs","repos_url":"https://api.github.com/users/balloob/repos","events_url":"https://api.github.com/users/balloob/events{/privacy}","received_events_url":"https://api.github.com/users/balloob/received_events","type":"User","site_admin":false},"created_at":"2018-05-06T14:40:32Z","updated_at":"2018-05-06T14:40:32Z","author_association":"OWNER","body":"This is related to the cleanup of custom component loading #14211 "}}
{"actor":{"display_login":"balloob"}}