Dashboards not working

did you restart your complete system after you changed and then tried to open the test?
i always make sure if nothing is hanging somewhere when i try to debug.

@akkaria appdaemon inside appdaemon is not strange.

@Rich_Paul with the newer versions from HA its no option to downgrade to AD 2 anymore. and AD 2 isnt supported anymore.

@angelo
if it still not runs then stop the process that is running appdaemon and try to run appdaemon like this:

in a terminal

sudo appdaemon - c /home/appdaemon/appdaemon/conf

and see what that comes up with.

if that doesnt work and doesnt provide new errors then try

sudo appdaemon - c /home/appdaemon/appdaemon/conf -D

appdaemon inside appdaemon is not strange.

Whilst it might not be strange, @angelo config file doesn’t point to this location. Only has one folder named appdeamon.

where did you see that, because in all the places i find 2x appdaemon. (i hope you are right, because then i missed that)

This is the config file

secrets: /home/homeassistant/.homeassistant/appdaemon/conf/secrets.yaml
log:
  #logfile: STDOUT
  #errorfile: STDERR
  accessfile: /home/homeassistant/.homeassistant/appdaemon/logs/access.log
  errorfile: /home/homeassistant/.homeassistant/appdaemon/logs/error.log
  logfile: /home/homeassistant/.homeassistant/appdaemon/logs/appdaemon.log
  logsize: 100000
  log_generations: 10
appdaemon:
  threads: 10
  disable_apps: 1
  app_dir: /home/homeassistant/.homeassistant/appdaemon/apps
  plugins:
    HASS:
      type: hass
      ha_url: http://10.1.190.49:8123
      ha_key: !secret dash_password
      namespace: default
hadashboard:
  dash_url: http://10.1.190.49:5050
  #dash_password: !secret dash_password
  dash_dir: /home/homeassistant/.homeassistant/appdaemon/dashboards
  accessfile: /home/homeassistant/.homeassistant/appdaemon/logs/dash_access.log
  dash_compile_on_start: 1

Everything refers to only one folder of appdaemon rather than 2.

that was before he changed his complete setup :wink:

i really love it when others also give their input, because they always can point me to things that i missed.
but if you dont read the complete conversation (and i wouldnt blame you if you did not, because this kind of debugging is boring as hell) then you add most of the times just noise to the thread.

so if you want to help (and i would greatly appreciate that) then please read the whole topic (or several times like i need to do everytime to keep track of what we tried and changed) and then come up with something i missed :wink:

and if you feel that i dont appreciate your input, then please forget that.
its 2:42 here, i have been in bed all day because i am not feeling well, and still try to help out someone.
so i love it when people get help. but please try to avoid extra noice to a debugging topic if it is possible :wink:

All good, no harm done :wink:

I did do a quick read however since the config file was posted and the only system change i noticed was the config file located in the appdaemon home directory and thought maybe an additional appdaemon directory was created on top of that. Otherwise i didnt see anything else changed.

Apologies for the noise.

Go get some sleep @ReneTode :wink:

your very welcome.
to sum up the things we tried:

  • lose the dot before appdaemon but the appdaemon config still inside the HA user home dir
  • restart everything
  • looking at chrome errors
  • creating new user and venv for AD
  • trying a test dash
  • changing the config dir from inside another users(HA) to inside the same users homedir
  • creating the compiled dir structure manually

now we are up to this:

if it still not runs then stop the process that is running appdaemon and try to run appdaemon like this:

in a terminal

sudo appdaemon - c /home/appdaemon/appdaemon/conf

and see what that comes up with.

if that doesnt work and doesnt provide new errors then try

sudo appdaemon - c /home/appdaemon/appdaemon/conf -D

I did completely restart the whole system before to try again. I do agree that I prefer start from scratch on every test while debugging.

I then tried to run it with elevated privileges, but no luck See below the logs with the debugging option enabled.

2018-03-27 18:31:59.799940 INFO AppDaemon Version 3.0.0 starting
2018-03-27 18:31:59.800626 INFO Configuration read from: /home/appdaemon/appdaemon/conf/appdaemon.yaml
2018-03-27 18:31:59.801081 DEBUG AppDaemon Section: None
2018-03-27 18:31:59.801426 DEBUG HADashboard Section: None
2018-03-27 18:31:59.803162 INFO AppDaemon: Starting Apps
2018-03-27 18:31:59.803787 DEBUG AppDaemon: Creating worker threads ...
2018-03-27 18:31:59.808604 DEBUG AppDaemon: Done
2018-03-27 18:31:59.809219 DEBUG AppDaemon: Entering run()
2018-03-27 18:31:59.809892 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2018-03-27 18:31:59.841966 INFO AppDaemon: HASS: HASS Plugin Initializing
2018-03-27 18:31:59.842976 INFO AppDaemon: HASS: HASS Plugin initialization complete
2018-03-27 18:31:59.843581 DEBUG AppDaemon: Starting utility loop
2018-03-27 18:31:59.844091 INFO Starting Dashboards
2018-03-27 18:31:59.856956 INFO API is disabled
2018-03-27 18:31:59.857564 DEBUG Start Loop
2018-03-27 18:31:59.878033 INFO AppDaemon: HASS: Connected to Home Assistant 0.65.6
2018-03-27 18:31:59.886818 DEBUG AppDaemon: HASS: get_ha_config()
2018-03-27 18:31:59.887425 DEBUG AppDaemon: HASS: get_ha_config: url is http://10.1.190.49:8123/api/config
2018-03-27 18:31:59.904695 DEBUG AppDaemon: HASS: get_ha_state: url is http://10.1.190.49:8123/api/states
2018-03-27 18:31:59.974235 DEBUG AppDaemon: HASS: Got state
2018-03-27 18:31:59.984511 INFO AppDaemon: Got initial state from namespace default
2018-03-27 18:32:00.056597 DEBUG AppDaemon: Event type:state_changed:
2018-03-27 18:32:00.057234 DEBUG AppDaemon: {'entity_id': 'sensor......
[...]

after this was just irrelevant entities updates from homeassistant that I did not include for this scope.

However, I’m sorry you don’t feel good and I hope you get better really soon. So just get some rest and we will continue troubleshooting this another day. :wink:

Thanks again for all your help with this!

its just a common cold, i am feeling a bit better already. but thx.
the startup seems quite normal.

but we need to see the debugging part from the moment you try to connect a dashboard.

Hello today i reinstall all system… install hassbian and without success appdaemon don’t compile dash! After this install raspbian and install appdaemon on virtual vend and same result dash don’t compile… tomorrow I post debug logs!

Thanks

Good morning here are my logs hope it helps

uname -a
Linux piserver 4.14.30-v7+ #1102 SMP Mon Mar 26 16:45:49 BST 2018 armv7l GNU/Linux

python3 --version
Python 3.5.3

pip3 --version
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.5)

appdaemon.yaml

#secrets: /some/path
log:
  accessfile: /home/homeassistant/appdaemon/logs/access.log
  errorfile: /home/homeassistant/appdaemon/logs/error.log
  logfile:  /home/homeassistant/appdaemon/logs/appdaemon.log
  log_generations: 3
  log_size: 1000000
appdaemon:
  threads: 10
  api_port: 5000
  plugins:
    HASS:
      type: hass
      ha_url: http://192.168.1.11:8123
#      ha_key: <some key>
      namespace: default

hadashboard:
  dash_url: http://192.168.1.11:5050

0

sudo service appdaemon@homeassistant status
● [email protected] - AppDaemon
   Loaded: loaded (/etc/systemd/system/[email protected]; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2018-03-30 11:14:16 WEST; 4min 11s ago
 Main PID: 1981 (appdaemon)
   CGroup: /system.slice/system-appdaemon.slice/[email protected]
           └─1981 /srv/appdaemon/bin/python3 /srv/appdaemon/bin/appdaemon -c /home/homeassistant/appdaemon/ -D DEBUG


ps aux | grep appdaemon
homeass+  1981  2.9  2.7 202300 25960 ?        Ssl  11:14   0:08 /srv/appdaemon/bin/python3 /srv/appdaemon/bin/appdaemon -c /home/homeassistant/appdaemon/ -D DEBUG

Appdaemon create the following structure

ls -la compiled/ -R
compiled/:
total 16
drwxr-xr-x 4 homeassistant homeassistant 4096 Mar 30 11:14 .
drwxr-xr-x 5 homeassistant homeassistant 4096 Mar 30 11:14 ..
drwxr-xr-x 2 homeassistant homeassistant 4096 Mar 30 11:14 css
drwxr-xr-x 2 homeassistant homeassistant 4096 Mar 30 11:14 javascript

compiled/css:
total 8
drwxr-xr-x 2 homeassistant homeassistant 4096 Mar 30 11:14 .
drwxr-xr-x 4 homeassistant homeassistant 4096 Mar 30 11:14 ..

compiled/javascript:
total 8
drwxr-xr-x 2 homeassistant homeassistant 4096 Mar 30 11:14 .
drwxr-xr-x 4 homeassistant homeassistant 4096 Mar 30 11:14 ..

change to

 ls -la compiled/ -R
compiled/:
total 20
drwxrwxrwx 5 homeassistant homeassistant 4096 Mar 30 11:19 .
drwxr-xr-x 5 homeassistant homeassistant 4096 Mar 30 11:14 ..
drwxrwxrwx 2 homeassistant homeassistant 4096 Mar 30 11:14 css
drwxrwxrwx 2 homeassistant homeassistant 4096 Mar 30 11:19 html
drwxrwxrwx 2 homeassistant homeassistant 4096 Mar 30 11:14 javascript

compiled/css:
total 8
drwxrwxrwx 2 homeassistant homeassistant 4096 Mar 30 11:14 .
drwxrwxrwx 5 homeassistant homeassistant 4096 Mar 30 11:19 ..

compiled/html:
total 8
drwxrwxrwx 2 homeassistant homeassistant 4096 Mar 30 11:19 .
drwxrwxrwx 5 homeassistant homeassistant 4096 Mar 30 11:19 ..

compiled/javascript:
total 8
drwxrwxrwx 2 homeassistant homeassistant 4096 Mar 30 11:14 .
drwxrwxrwx 5 homeassistant homeassistant 4096 Mar 30 11:19 ..

when I open the dashboard list page (nothing appears in the logs)

When I open dashboard

The error that appears is

2018-03-30 11:24:53.031531 INFO Compiling dashboard 'hello'
2018-03-30 11:24:53.911699 WARNING Dashboard 'hello' not found
2018-03-30 11:24:53.913238 WARNING ------------------------------------------------------------
2018-03-30 11:24:53.914005 WARNING Unexpected error during DASH creation
2018-03-30 11:24:53.914636 WARNING ------------------------------------------------------------
2018-03-30 11:24:53.918032 WARNING Traceback (most recent call last):
  File "/srv/appdaemon/lib/python3.5/site-packages/appdaemon/dashboard.py", line 822, in get_dashboard
    with open(include_path, "r") as include_file:
FileNotFoundError: [Errno 2] No such file or directory: '/home/homeassistant/appdaemon/compiled/html/default/hello_head.html'

2018-03-30 11:24:53.918955 WARNING ------------------------------------------------------------
2018-03-30 11:24:53.919691 INFO function [get_dashboard] finished in 920 ms

The complete logs are here https://pastebin.com/4N1u6QSa

Appdaemon install commands

sudo mkdir /srv/appdaemon
sudo chown -R homeassistant:homeassistant /srv/appdaemon
sudo -u homeassistant -H /bin/bash
python3 -m venv /srv/appdaemon
source /srv/appdaemon/bin/activate
mkdir /home/homeassistant/appdaemon
mkdir /home/homeassistant/appdaemon/apps
pip3 install wheel
pip3 install appdaemon

Thanks

all files in the directory /home/homeassistant/appdaemon and its subdirs are owned by homeassistant, but you try to read and write there as user appdaemon.

thanks for reply,

I did not have any user called appdaemon I created one and put in the sudo group , I changed the permissions of the compiled folder but even then it did not work… I am not understanding where it comes appdaemon user

could be that i did interprete it wrong.
i saw that you created a venv for appdaemon and thought you also created a user appdaemon.
can you show your error log and your appdaemon lo and your acces log?

Ok made some changes to my service script to ensure the run user is homeassistant

[Unit]
Description=AppDaemon
[email protected]

[Service]
Type=simple
#User=homeassistant
User=%i
ExecStart=/srv/appdaemon/bin/appdaemon -c /home/%i/appdaemon/ -D DEBUG

[Install]
WantedBy=multi-user.target

my status is

pi@piserver:/etc/systemd/system $ sudo service  appdaemon@homeassistant status
● [email protected] - AppDaemon
   Loaded: loaded (/etc/systemd/system/[email protected]; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2018-03-30 15:15:43 WEST; 7s ago
 Main PID: 7761 (appdaemon)
   CGroup: /system.slice/system-appdaemon.slice/[email protected]
           └─7761 /srv/appdaemon/bin/python3 /srv/appdaemon/bin/appdaemon -c /home/homeassistant/appdaemon/ -D DEBUG

Mar 30 15:15:43 piserver systemd[1]: Started AppDaemon.

the appdaemon is creating a compiled folder (css javascript) automatically with the homeassistant user. So I think it’s running with the right user, and the logs are working fine with user homeassistant

ls -la -R logs/
logs/:
total 3640
drwxr-xr-x 2 homeassistant homeassistant   4096 Mar 30 14:53 .
drwxr-xr-x 5 homeassistant homeassistant   4096 Mar 30 15:07 ..
-rw-r--r-- 1 homeassistant homeassistant  12741 Mar 30 15:18 access.log
-rw-r--r-- 1 homeassistant homeassistant 678606 Mar 30 15:23 appdaemon.log
-rw-r--r-- 1 homeassistant homeassistant 999713 Mar 30 14:53 appdaemon.log.1
-rw-r--r-- 1 homeassistant homeassistant 999737 Mar 30 13:51 appdaemon.log.2
-rw-r--r-- 1 homeassistant homeassistant 999547 Mar 30 13:23 appdaemon.log.3
-rw-r--r-- 1 homeassistant homeassistant    723 Mar 30 14:19 error.log

My logs
access : https://pastebin.com/BjTNZgZq
appdaemon: https://paste.ee/p/z1gUF

Thanks for assistance and patience

1 Like

Sorry for the late response guys, crazy last couple of days…

Unfortunately there is nothing related to the dashboard in the logs, just as the logs LaBoss posted, mine are just the same but I have few more entities updates from homeassistant.

I think LaBoss and I are having the exact same issue. This weekend I may be able to try a new install from scratch on a spare pi and I will report back what I find.

Thanks all

1 Like

i think it is the same problem to… I also think it’s strange do not give error or info msg while compiling the dashboard (on possible error is don’t create html folder)! only shows the errors on execute and no info msg!

On appdaemon 2 this setup works fines!

Thanks

i hope that its the same problem. that way we can solve 1 and have 2 happy people.
at this moment i cant think of anything why it shouldnt work.

but i have asked @aimc to add some extra debugging functions to appdaemon to make it easier to detect why things are not working.
he thought it was a good plan and hopes he can implement that this weekend.

so i hope you 2 have a little patience for that and we will find out what is going wrong.

Sweet! Some extra debugging logs will definitely be good! Hope it will shed some lights on this.

Thanks again for all your help

1 Like