Can't remove Maria db due to error in configuration.yaml

Due to a hickup last night I decided to skip Maria db for a while and start over with stock recorder.

Removed Maria db add-on, deleted this in my configuration.yaml:

# mariadb
recorder:
 db_url: !secret mariadb_url
 purge_keep_days: 30

But when I try to delete the secret key in secret.yaml I get this error:
Error loading /config/configuration.yaml: Secret mariadb_url not defined

Don’t know how to proceed, any suggestions please?

Did you reboot after removing Maria and that configuration change?

Yes, leaving mariadb_url: 'mysql://homeassistant:password@core-mariadb/homeassistant?charset=utf8mb4'remaining in secrets.yaml. Otherwise HA wouldn’t restart… When I comment out this line again after rebooting I just get the same error.

You can’t leave all keys in there. You’d have to comment out purge_key_days too, or completely comment out recorder and all it’s sub fields.

Yes, that’s exactly what I did, remove the whole recorder thing in configuration.yaml. Then in configuration validation i got:

Error loading /config/configuration.yaml: Secret mariadb_url not defined

because I also removed the maria db secret in secrets.yaml. As long as it stays in secrets, out-commented, I can reboot.

Don’t use the one in the UI, use the config check via SSH and restart that way. When you remove yaml configurations, you may get errors via the UI one.

I have never used Web terminal or SSH. Can someone please enlighten me how to do?

I have reverted to a backup but problem still remains when checking validation i the UI.

Can you post your entire configuration for recorder? With things commented out.

recorder:
  db_url: 'mysql://homeassistant:password@core-mariadb/homeassistant?charset=utf8mb4'
  purge_keep_days: 30

I have done it like this:
Stop add-on
Uninstall add-on
Comment out recorder, db_url, purge_keep_days

Upon validation = error as above

if you want to comment out recorder, this is what you do

recorder:
#  db_url: 'mysql://homeassistant:password@core-mariadb/homeassistant?charset=utf8mb4'
#  purge_keep_days: 30

Exactly like that, but when I used secrets.yaml it didn’t work (have worked before).
I solved it by moving the db_url outside the secrets.yaml and into configuration.yaml.

Rebooted
Uninstalled maria db add-on
Commented out as above
and voilá!
Maria db is gone and stock recorder took over.
Thank you for taking your time, really appreciate the support :rose:

It’s possible secrets are plopped into commented lines and that’s what’s causing the error.

1 Like