Error with SSL certificate: Invalid config for [http]: file not readable for dictionary value @ data['http']['ssl_key']

Hi all,

today my SSL certificate ran out. While installing I followed this tutorial: https://www.home-assistant.io/docs/ecosystem/certificates/lets_encrypt/. Usually renewal worked like a charm, however this time I got the following problem:

Certbot has problem setting up the virtual environment.

We were not be able to guess the right solution from your pip 
output.

I managed to solve this, but only after I deleted my certbot and /etc/letsencrypt/ folder, which wouldn’t have been necessary. Therefore I followed the instructions again and now all I am getting is:

2019-05-06 14:55:23 WARNING (MainThread) [homeassistant.components.http] Configuring api_password via the http component has been deprecated. Use the legacy api password auth provider instead. For instructions, see https://www.home-assistant.io/docs/authentication/providers/#legacy-api-password
2019-05-06 14:55:23 ERROR (MainThread) [homeassistant.config] Invalid config for [http]: file not readable for dictionary value @ data['http']['ssl_key']. Got '/etc/letsencrypt/live/cloud.xxxx.de/privkey.pem'. (See /home/homeassistant/.homeassistant/configuration.yaml, line 55). Please check the docs at https://home-assistant.io/components/http/
2019-05-06 14:55:23 ERROR (MainThread) [homeassistant.setup] Setup failed for http: Invalid config.
2019-05-06 14:55:23 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of system_log. Setup failed for dependencies: http
2019-05-06 14:55:23 ERROR (MainThread) [homeassistant.setup] Setup failed for system_log: Could not set up all dependencies.
2019-05-06 14:55:23 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of api. Setup failed for dependencies: http
2019-05-06 14:55:23 ERROR (MainThread) [homeassistant.setup] Setup failed for api: Could not set up all dependencies.
2019-05-06 14:55:23 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of websocket_api. Setup failed for dependencies: http
2019-05-06 14:55:23 ERROR (MainThread) [homeassistant.setup] Setup failed for websocket_api: Could not set up all dependencies.
2019-05-06 14:55:23 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of auth. Setup failed for dependencies: http
2019-05-06 14:55:23 ERROR (MainThread) [homeassistant.setup] Setup failed for auth: Could not set up all dependencies.
2019-05-06 14:55:23 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of onboarding. Setup failed for dependencies: auth, http
2019-05-06 14:55:23 ERROR (MainThread) [homeassistant.setup] Setup failed for onboarding: Could not set up all dependencies.
2019-05-06 14:55:23 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of frontend. Setup failed for dependencies: api, websocket_api, http, system_log, auth, onboarding
2019-05-06 14:55:23 ERROR (MainThread) [homeassistant.setup] Setup failed for frontend: Could not set up all dependencies.
2019-05-06 14:55:25 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of history. Setup failed for dependencies: http
2019-05-06 14:55:25 ERROR (MainThread) [homeassistant.setup] Setup failed for history: Could not set up all dependencies.
2019-05-06 14:55:26 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of tts. Setup failed for dependencies: http
2019-05-06 14:55:26 ERROR (MainThread) [homeassistant.setup] Setup failed for tts: Could not set up all dependencies.
2019-05-06 14:55:26 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of system_health. Setup failed for dependencies: http
2019-05-06 14:55:26 ERROR (MainThread) [homeassistant.setup] Setup failed for system_health: Could not set up all dependencies.
2019-05-06 14:55:26 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of logbook. Setup failed for dependencies: frontend
2019-05-06 14:55:26 ERROR (MainThread) [homeassistant.setup] Setup failed for logbook: Could not set up all dependencies.
2019-05-06 14:55:26 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of media_player. Setup failed for dependencies: http
2019-05-06 14:55:26 ERROR (MainThread) [homeassistant.setup] Setup failed for media_player: Could not set up all dependencies.
2019-05-06 14:55:26 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of config. Setup failed for dependencies: http
2019-05-06 14:55:26 ERROR (MainThread) [homeassistant.setup] Setup failed for config: Could not set up all dependencies.

Any ideas? Thanks! :slight_smile:

Read the first 2 lines and act on them?

  1. Change your handling of api_password

  2. Home Assistant cannot read the ssl key file. Perhaps a file, path, or permission issue.

Thanks! I guess the first error has nothing to do with the issue at hand, so I will solve this later.

I checked path and permissions before writing (should have said that). The file is under the correct path and I did a chown 755 logged in as the homeassistant user as per instructions.

Edit: I did a 755 directly on the privkey.pem and now it works…Weird.

1 Like

If you were a level above you could have done chmod -R to change recursively. Perhaps you did chown instead of chmod the first time.
chown - change ownership
chmod change permissions

This solution worked! Thanks!

cd ssl
chmod 755 privkey.pem

Then you probably have to restart DuckDNS Addon. Now the configuration.yaml with the DuckDNS is valid.

This was incredibly helpful because I did’t have to do this on 2 previous HA installations, but on the 3rd one today this problem suddenly appeared.