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.21k stars 30.57k forks source link

Secrets Not Supported Error when using "include_dir_named" in configuration.yaml #48735

Closed bholdmeyer closed 3 years ago

bholdmeyer commented 3 years ago

The problem

I went to restart HA and noticed the following error in the config check: "Error loading /config/configuration.yaml: Secrets not supported in this YAML file".

I noticed PR #47034 and then a follow up PR #47350 that mentions fixing secrets in files included via include_dir_list, but it appears to still be an issue with using "include_dir_named".

If I pull the 2 integrations that I use secrets in (amcrest & withings) out of their individual files in the referenced directory and add them directly in the configuration.yaml file, the config check passes with no errors.

What is version of Home Assistant Core has the issue?

2021.4.0b4

What was the last working version of Home Assistant Core?

2021.3.4

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Any integration using secrets. The two I have currently are amcrest and withings.

Link to integration documentation on our website

No response

Example YAML snippet

##configuration.yaml file:

homeassistant:
  packages: !include_dir_named integrations

##amcrest.yaml file in directory named integrations:

amcrest:
  host: !secret amcrest_host
  # port: !secret amcrest_port
  username: !secret amcrest_user
  password: !secret amcrest_password

Anything in the logs that might be useful for us?

No response

balloob commented 3 years ago

I am unable to reproduce this. Are you using lovelace_gen or Dwain's dashboard?

bholdmeyer commented 3 years ago

I do have Dwain's Dashboard installed, but haven't really configured or been using it and noticed that it is actually showing an "Unknown error" right now. I went ahead and uninstalled it re-did the separate files with secrets with the "include_dir_named" in configuration.yaml and config check now passes. Thanks!

frenck commented 3 years ago

Glad that resolved it @bholdmeyer 👍