AppDaemon won't start - complains about secrets.yaml

Something happened, and AppDaemon won’t start anymore. I get an error about opening secrets.yaml, but I haven’t changed anything here since May 5th.

I did open the HA config in PyCharm, and accidentally clicked “add interpreter”, but afterwards deleted the venv folder. Other than that, I can’t think of anything that changed when it stopped working (well, updated ESPHome, but pretty sure that isn’t it?)

This is what I see in the AppDAemon logs:

ERROR Error loading secrets file: /config/secrets.yaml
Traceback (most recent call last):
  File "/usr/bin/appdaemon", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/appdaemon/__main__.py", line 417, in main
    admain.main()
  File "/usr/lib/python3.11/site-packages/appdaemon/__main__.py", line 276, in main
    if "appdaemon" not in config:
       ^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable
[15:47:03] INFO: Service AppDaemon exited with code 1 (by signal 0)
6 Likes

Same problem here.

Same here. I updated to latest AppDaemon and now it wont start with the same error as Aephir.

Edit: it also cleared my appdaemon folder in /homeassistant/ and put it into /addon_configs/a0d7b954_appdaemon. Tried to put it back but no difference.

Forum search?

3 Likes

Thanks, @VDRainer.

For anyone else that didn’t do a thorough search (ahem, like me…), basically, you need to:

  1. Mount the new addon_config where all your old AppDaemon stuff is.
  2. There, in the appdaemon.yaml, you need to change /config/secrets.yaml to /homeassistant/secrets.yaml.
2 Likes

My entire appdaemon folder appears to be blown away after the update so i don’t have an appdaemon.yaml file anymore.

mine to :slight_smile:
untar backup and i find appdeamon.yaml
what next
where should i do the new appyaml config directory ?

There is definitely something broken now. The logs say it’s loading config/appdaemon.yaml and no such file exists. I’m not sure what is going on. I’ll guess i’ll try and revert back to v14

I would revert back to version 14 and restore your yaml file. This version is broken.

@Bxsteez @przemsi Read the linked thread (or point #1 in my last post).

Everything AppDaemon has moved.

Restoring a backup will only work until you upgrade again, since it is on purpose that it has moved.

which backup you restore , in unziped appdemon a don’t see appdeamon.yaml

i don’t understand

:warning: With this release, the appdaemon data folder will migrate/move out of the Home Assistant configuration folder into a dedicated folder for this add-on. You can access add-on configuration folders using SSH, Samba, VSCode, and similar add-ons by accessing the addon_configs folder/share.
If you have this in your appdaemon.yaml file:
secrets: /config/secrets.yaml
You will need to adjust this to:
secrets: /homeassistant/secrets.yaml

where is that folder or where should create it

1 Like

Read my post: AppDaemon won't start - complains about secrets.yaml - #5 by Aephir

Or the linked thread therein.

You need to mount the new mountable “addon_configs”, which is where everything AppDAemon (incl. the appdaemon.yaml) is now located.

It is no longer in the “config” mount, but has been moved “as is”, you still have all your stuff. So: DON’T RESTORE ANY BACKUPS.

Screenshot 2023-11-15 at 20.56.29

I undid my restore and did as suggested with the addon configs folder and got it working. Probably should’ve read through before jumping off the ship haha

mtab

/dev/sda8 /addon_configs ext4 rw,relatime,commit=30 0 0

df -h

/dev/sda8                30.8G     17.4G     12.1G  59% /addon_configs

ls -l /addon_configs/a0d7b954_appdaemon

total 28
-rw-r--r--    1 root     root           232 Nov 15 11:52 appdaemon.yaml
-rw-r--r--    1 root     root           504 Jun 23 06:43 appdaemon.yaml_back
drwxr-xr-x    4 root     root          4096 Nov 15 11:52 apps
drwxr-xr-x    5 root     root          4096 Jun 25 10:28 compiled
drwxr-xr-x    2 root     root          4096 Nov 15 11:52 dashboards
drwxr-xr-x    2 root     root          4096 May 24 14:31 namespaces
drwxr-xr-x    2 root     root          4096 May 24 14:31 www

where should i mount it ?

edit
remove and install appdeamon
directory is mounted
change

There, in the `appdaemon.yaml`, you need to change `/config/secrets.yaml` to /homeassistant/secrets.yaml`.

appdeamon wotks fine
i have to check nspanel config , is doesn’t refresh

1 Like

@Bxsteez Don’t feel bad, I managed to install a completely new VM to restore and copy my Appdaemon config from before realizing…

@przemsi However you mount the “config” where the AppDaemon config used to be. I use the SambaShare addon, but how you do doesn’t really matter. If you (as it seems) have CLI access, you might as well just open and modify the appdaemon.yaml with nano, vi, or whatever you use in CLI.

remove and install appdeamon
directory is mounted
change

There, in the `appdaemon.yaml`, you need to change `/config/secrets.yaml` to /homeassistant/secrets.yaml`.

appdeamon wotks fine
i have to check nspanel config , it doesn’t refresh

thanks for help

a nspanel w dupie nie działa , bo zawsze coś trzeba namieszać, manual jak dla mały kopiuj/wklej a jak trzeba naprawić to nie wiadomo o co chodzi

2 Likes

In my case the only thing I did was edit the appdaemon.yaml file in its new directory.

The error was it could find /config/secrets.yaml and I noticed the config files were moved to addon_config/a0d7b954_appdaemon when I opened the network folder via SAMBA so I just edited the file there, restarted and it worked just fine.

So if you can try that first to see if it works for you too.

2 Likes

Couldn’t figure out why it wouldn’t create a file, and there it was. Thank you!

Hello,

Same here and my AppDaemon has been deleted.

What I did to restore my NSPANEL app

  • Download and open a backup and extract the “homeassistant” archive/folder located at the root of the archive.
  • Locate the folder /root/addon_configs/XXX-appdaemon (XXX seems to be a dynamic name that you are to replace with your app ID)
  • copy homeassistant/data/appdaemon/appdaemon.yml to /root/addon_configs/XXX-appdaemon/appdaemon.yml
  • copy homeassistant/data/appdaemon/apps/apps.yml.yml to /root/addon_configs/XXX-appdaemon/apps/apps.yml
  • Edit file /root/addon_configs/XXX-appdaemon/appdaemon.yml and replace “/config/secrets.yml” by “/homeassistant/secrets.yml”
  • restart the add-on and check the logs
1 Like

I will reiterate the post above:

DO NOT RESTORE.

Just read the post. I also started with trying to restore to get the AppDaemon config because I didn’t read what was going on.

To make it easier for people finding this thread (instead of the older one that also solves the problem, the one I didn’t search for before creating this), I’ve marked the post as solution: