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

[http]: None is not file for dictionary value @ data['http']['ssl_certificate'] #12541

Closed
selfisch opened this issue Feb 20, 2018 · 9 comments
Closed

Comments

@selfisch
Copy link

selfisch commented Feb 20, 2018

Home Assistant release (hass --version):
0.63.3

Python release (python3 --version):
3.5.2

Component/platform:
http

Description of problem:
2018-02-20 08:44:00 ERROR (MainThread) [homeassistant.config] Invalid config for [http]: None is not file for dictionary value @ data['http']['ssl_certificate']. Got None
None is not file for dictionary value @ data['http']['ssl_key']. Got None. (See /opt/homeassistant/configuration.yaml, line 26). Please check the docs at https://home-assistant.io/components/http/

Expected:
regular startup

Problem-relevant configuration.yaml entries and steps to reproduce:

  http:
    api_password: !secret api_password
    base_url: !secret host_ip
    server_port: 8123
    ip_ban_enabled: true
    login_attempts_threshold: 5

Additional info:
I just updated ha version from 0.63.2 to 0.63.3 before those error appeared.
There was never an ssl_key or ssl_certificate configured in my configuration.yaml.
I am running an nginx infront of home-assistant, where my certs are configured.

See attached, my complete configuration.yaml
configuration.txt

@selfisch
Copy link
Author

Info:
Downgrade to version 0.63.2 solved this issue. home-assistant is starting up again.
But this should not be the end solution.

@GrahamH68
Copy link

Seeing a similar issue with other components that seem to need defaults to be explicitly set.

@chennin
Copy link
Contributor

chennin commented Feb 20, 2018

Similarly, I cannot pass config vailidation without api_password and login_attempts_threshold set. I am on 0.62.1.
I am using nginx in front of HASS and do not want to set either.

(home-assistant) ~/home-assistant/config$ hass --script check_config 2>&1
Testing configuration at /home/hass/.homeassistant
# ...
2018-02-20 11:31:25 ERROR (MainThread) [homeassistant.config] Invalid config for [http]: string value is None for dictionary value @ data['http']['api_password']. Got None
value must be at least 0 for dictionary value @ data['http']['login_attempts_threshold']. Got None. (See /home/hass/.homeassistant/configuration.yaml, line 38). Please check the docs at https://home-assistant.io/components/http/
2018-02-20 11:31:25 ERROR (MainThread) [homeassistant.setup] Setup failed for http: Invalid config.
http:
  server_port: 8123
  ssl_certificate: !secret http_ssl_certificate
  ssl_key: !secret http_ssl_key
  cors_allowed_origins: !include cors.yaml
  use_x_forwarded_for: true
  trusted_networks:
    - 10.0.1.0/24
    - 127.0.0.1
    - ::1

@xehn
Copy link

xehn commented Feb 21, 2018

I just ran into the same thing, although not immediately after an upgrade to HASS. It happened after I installed the new AppDaemon beta. If you guys also recently did that, I can confirm that downgrading to 63.2, then reinstalling 63.3 fixes it.

I think there is a mix-match of dependencies that caused the error. Reinstalling HASS after AppDaemon seems to work around the problem. I haven't gone through all of the logs yet to see exactly which package caused the issue, but it's working for me. HTH.

@chennin
Copy link
Contributor

chennin commented Feb 21, 2018

So I do not use app daemon, but you led me to try reinstalling HASS, which fixed it. I then traced the problem to a newer voluptuous.

This should fix it for the rest of you:
pip install voluptuous==0.10.5

As of this writing, that is the version required by HASS, but I had done a blanket pip upgrade and got 0.11.1.

@chennin
Copy link
Contributor

chennin commented Feb 21, 2018

Note- previous applies to 0.62.1 and I did not check with 0.63.x

@selfisch
Copy link
Author

@xehn you made my day. Thats it. Never thought of issues with appdaemon, but yes. I first updated appdaemon and after that homeassistant, which lead to the startup issue.

After downgrading hass to 0.63.2 and another upgrade to 0.63.3, everythings is fine.
Strange.
Dont know if this issue can be closed because of this or if there have to be any more debugging.

@xehn
Copy link

xehn commented Feb 21, 2018

Since this seems to be a configuration issue, rather than an actual bug, I think closing it would be prudent.

While this was inconvenient, Home Assistant isn't really doing anything wrong here. It has clearly labeled dependencies, which we all carelessly replaced. A hook could be added to check that sort of thing, but it really isn't a HASS problem so much as an end user one.

The "right" fix would probably be running HASS, AD, and potentially anything else on the system in separate virtual containers (through virtualenv, docker, or other similar method). The complexity of managing dependencies is one of the primary reasons those programs exist, after all.

Glad you two got it going. Hopefully this thread will help anyone else who has a similar problem!

@loongyh
Copy link
Contributor

loongyh commented Apr 26, 2018

@chennin same here got this error too until I reverted voluptuous==0.10.5.

Since #12463 voluptuous was updated to 0.11.1. It breaks config validation if default values are invalid (i.e. set to None).

@home-assistant home-assistant locked and limited conversation to collaborators Jul 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants