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.51k stars 30.71k forks source link

HA Core not loading any/all custom integrations/components after 0.105.2 #31660

Closed JHenzi closed 4 years ago

JHenzi commented 4 years ago

The problem

HA (in docker, latest tag/stable/dev) will not load any custom integrations, custom components.

Environment

Problem-relevant configuration.yaml

N/A - see logs below

Traceback/Error logs

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 389, in _load_file
    module = importlib.import_module(path)
  File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/config/custom_components/__init__.py", line 11, in <module>
    from integrationhelper.const import CC_STARTUP_VERSION
ModuleNotFoundError: No module named 'integrationhelper'

Additional information

Upgraded to latest by pulling the newest docker latest image, upon reboot started seeing failures to load Node Red and HACS integrations. Everything else that came from HACS is also disabled (i.e. Lovelace plugsins). I've removed the custom_integrations folder and restarted, replaced it, restarted with/without this 100 times it feels like. I've checked, docker should be able to see the directories (chown to the user/to root/etc). Deleted HACS files in storage. Deps folder in config gets recreated upon reboot but nothing ever seems to go into it. HACS issue tracker points back to a core HA issue. Other than this things seem fine, but causing headaches with NR automations (where I read TV state, etc).

Olen commented 4 years ago

Getting lots of errors on starting 105.2 here as well. Downgrading docker-image to 105.1 works fine.

JHenzi commented 4 years ago

@Olen I'll try 105.1, but even going back to .104 doesn't fix it.

JHenzi commented 4 years ago

I nuked init.py and it feels like everything is back - is this safe?

springstan commented 4 years ago

I nuked init.py and it feels like everything is back - is this safe?

What do you mean by nuking?

JHenzi commented 4 years ago

I moved it out of this folder, all the integrations remain.

springstan commented 4 years ago

How is the file structure now?

JHenzi commented 4 years ago

I moved custom_components back, but without the init file, everything is back to 'normal'. Is this file usually cleaned up after HACS/another install?

springstan commented 4 years ago

I am not sure what went wrong but you should not have a init.py file directly in the custom_components folder e.g. .../custom_components/init.py.

This is the usual file structure:

If I am understanding you correctly, you moved the init file back into the respective folder and therefore cleaned up the issue manually. Yes, that is the correct way since this file seems to be out of place or rather its folder.

I am going to close this issue now, if you have any other issues concerning custom_components and their installation with HACS please open an issue there.

JHenzi commented 4 years ago

I figured it out anyway, sorry I didn't update.

Somehow I think I pushed old files back to the production config, including init.py. Once I removed it HA was back to normal.