AppDaemon won't start after OS upgrade

I finally bit the bullet and upgraded Ubuntu to get python upgraded for for Home Assistant. Everything is running fine except that after re-installing AppDaemon and re-formatting the config file for AD 3.0 I get this error.

I’m getting nothing in the log file. It just says it’s starting and then the log file stops without any errors.

Traceback (most recent call last):
  File "/usr/local/bin/appdaemon", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/dist-packages/appdaemon/admain.py", line 365, in main
    admain.main()
  File "/usr/local/lib/python3.6/dist-packages/appdaemon/admain.py", line 361, in main
    self.run(appdaemon, hadashboard)
  File "/usr/local/lib/python3.6/dist-packages/appdaemon/admain.py", line 60, in run
    self.AD = ad.AppDaemon(self.logger, self.error, self.diag, loop, **appdaemon)
  File "/usr/local/lib/python3.6/dist-packages/appdaemon/appdaemon.py", line 258, in __init__
    basename = self.plugins[name]["type"]
KeyError: 'type'

you didnt reconfigure your appdaemon.yaml right.

please read this part line by line and take care of all breaking changes.
http://appdaemon.readthedocs.io/en/latest/#upgrading-from-2-x

I looked through the docs already. Am I just missing something?

log:
  accessfile: /home/xbmc/.homeassistant/appdaemon/logs/access.log
  errorfile: /home/xbmc/.homeassistant/appdaemon/logs/error.log
  logfile: /home/xbmc/.homeassistant/appdaemon/logs/appdaemon.log
  log_generations: 3
  log_size: 1000000
appdaemon:
  threads: 10
  disable_apps: 1
  plugins:
    HASS:
      type: hass
      ha_key: redacted
      ha_url: https://redacted.duckdns.org:8123
    hadashboard:
      dash_force_compile: 1
      dash_url: http://10.0.0.115:8124
      dash_password: redacted

According to the docs, hadashboard is not a plugin but should be on the same indentation level as appdaemon.

See: http://appdaemon.readthedocs.io/en/latest/DASHBOARD_INSTALL.html

like @cgtobi says
this part

    hadashboard:
      dash_force_compile: 1
      dash_url: http://10.0.0.115:8124
      dash_password: redacted

should start with indention 0

1 Like

Thank you both that worked perfectly. But now I have a new problem, it will not run in daemon mode. It works perfectly unless i launch it with the -d at the end.

is there anything in the logs after you start with -d ?

Unfortunately there’s no errors or anything other than the normal startup in the logs. If I run it normally I can access and use it, if I run it in daemon mode it seems to start normally but the dashboard is inaccessible. It’s like the server sent running and my attempt to load it doesn’t show in the access log file.

so if you clear the logs
then start as daemon
the logs show that everything starts like normal?
no errors?
and you are sure appdaemon is running?

do you start it s deamon from a terminal or as a service?

I am starting appdaemon from the terminal

When I run it with the daemon (-d) tag all I get in the logs is this:

2018-04-01 18:42:50.573356 INFO AppDaemon Version 3.0.0 starting
2018-04-01 18:42:50.573680 INFO Configuration read from: /home/xbmc/.homeassistant/appdaemon/appdaemon.yaml

There does not appear to be a process running and I cannot access HADashboard through a web browser.

When I run it without the daemon tag I get this in the log:

2018-04-01 18:44:58.836749 INFO AppDaemon Version 3.0.0 starting
2018-04-01 18:44:58.837092 INFO Configuration read from: /home/xbmc/.homeassistant/appdaemon/appdaemon.yaml
2018-04-01 18:44:58.837954 INFO AppDaemon: Starting Apps
2018-04-01 18:44:58.841406 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2018-04-01 18:44:58.979636 INFO AppDaemon: HASS: HASS Plugin Initializing
2018-04-01 18:44:58.980486 INFO AppDaemon: HASS: HASS Plugin initialization complete
2018-04-01 18:44:58.981055 INFO Starting Dashboards
2018-04-01 18:44:59.011699 INFO API is disabled
2018-04-01 18:44:59.110410 INFO AppDaemon: HASS: Connected to Home Assistant 0.66.0
2018-04-01 18:44:59.175306 INFO AppDaemon: Got initial state from namespace default
2018-04-01 18:45:01.266190 INFO AppDaemon: Adding /home/xbmc/.homeassistant/appdaemon/apps to module import path
2018-04-01 18:45:01.267542 INFO AppDaemon: App initialization complete

I can clearly see the process and access HADashboard in a web browser, everything appears to work perfectly.

I have not tried running it as a service, I actually never had it setup that way before. I don’t restart my server very often so it wasn’t a big deal to just run the command.

i also use a terminal to start it, but never as deamon (i dont see the use of that)

did you try to combine -D and -d ?
and did you also check the error log?

There was never anything in the error log no matter what I did. I did never try running in debug mode because I assumed the logs would show anything I needed see.

But I did find a resolution. I set it up as as service and now it works. I did error out on me again but it was a simple permissions error with the error log file, I deleted the existing one and the service started.

Thank you again for all your help, I greatly appreciate you sticking with it to the end.

1 Like