Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logbook component broken after 72f336a (bisected) #29845

Closed
clapbr opened this issue Dec 11, 2019 · 6 comments · Fixed by #29908 or #30137
Closed

Logbook component broken after 72f336a (bisected) #29845

clapbr opened this issue Dec 11, 2019 · 6 comments · Fixed by #29908 or #30137

Comments

@clapbr
Copy link
Contributor

clapbr commented Dec 11, 2019

Home Assistant release with the issue: 0.104.0.dev0 (git)

Last working Home Assistant release (if known):

Operating environment (Hass.io/Docker/Windows/etc.):

Integration:

Description of problem:
Logbook doesn't load on current dev branch.

2019-12-11 10:19:14 ERROR (MainThread) [homeassistant.setup] Setup failed for logbook: Unable to import component
2019-12-11 10:19:14 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of default_config. Setup failed for dependencies: logbook
2019-12-11 10:19:14 ERROR (MainThread) [homeassistant.setup] Setup failed for default_config: Could not set up all dependencies.

Since logs doesn't say much I bisected the culprit: 72f336a
Since the changes are rather small and look completely unrelated I tested reverting only the commit locally in a clean venv+clean config and logbook loaded normally with no other errors.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

Traceback (if applicable):


Additional information:

@clapbr
Copy link
Contributor Author

clapbr commented Dec 12, 2019

@springstan, mind rechecking your PR ?

@springstan
Copy link
Member

@clapbr sure I will take a look at it as soon as possible

@springstan
Copy link
Member

springstan commented Dec 12, 2019

I can confirm that 72f336a caused this issue. However, only this line: from .accessories import HomeBridge, HomeDriver causes this issue, moving it back into the setup function resolves the error completely.
Not really sure what is actually causing this error since this is unrelated to the logbook component.

@pnbruckner
Copy link
Contributor

It appears the loading of logbook is broken again.

I was able to make a reproducible test case by doing a clean checkout of dev branch (84e1b3d), and then doing a clean venv (Python 3.7) install. I deleted everything from my config directory, then created configuration.yaml with just these lines:

frontend:
logbook:

Then running a config check I get:

hass --script check_config
Testing configuration at /home/phil/.homeassistant
INFO:homeassistant.util.package:Attempting install of home-assistant-frontend==20191204.1
INFO:homeassistant.util.package:Attempting install of aiohttp_cors==0.7.0
INFO:homeassistant.util.package:Attempting install of sqlalchemy==1.3.11
INFO:homeassistant.util.package:Attempting install of HAP-python==2.6.0
Failed config
  General Errors:
    - Component error: logbook - No module named 'PIL'

Successful config (partial)

After digging a bit I discovered that PIL is from the package named Pillow. That package is not getting installed. However if I run:

pip3 install -r requirements_test_all.txt -c homeassistant/package_constraints.txt

then it will now be installed & the config check succeeds.

It also succeeds if I start again and just have logbook: in configuration.yaml, or if I have default_config:.

@pnbruckner pnbruckner reopened this Dec 20, 2019
@springstan
Copy link
Member

@pnbruckner however installing pillow manually does not work for me. Still getting the same error you mentioned.

@balloob
Copy link
Member

balloob commented Dec 21, 2019

We should move the imports for homekit inside the function again in logbook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants