Dashboards not working

Environment:
Raspberry pi with Rasbian Stretch, homeassistant and appdaemon installed in virtualenv.

Appdaemon startup:

/srv/homeassistant/bin/appdaemon -c /home/homeassistant/.homeassistant/.appdaemon/conf

Appdaemon config:

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

Logs
appdaemon logs:

2018-03-16 14:50:09.745893 INFO AppDaemon Version 3.0.0b5 starting
2018-03-16 14:50:09.747390 INFO Configuration read from: /home/homeassistant/.homeassistant/.appdaemon/conf/appdaemon.yaml
2018-03-16 14:50:09.749731 INFO AppDaemon: Starting Apps
2018-03-16 14:50:09.755904 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2018-03-16 14:50:09.994060 INFO AppDaemon: HASS: HASS Plugin Initializing
2018-03-16 14:50:09.995363 INFO AppDaemon: HASS: HASS Plugin initialization complete
2018-03-16 14:50:09.996234 INFO Starting Dashboards
2018-03-16 14:50:10.012147 INFO API is disabled
2018-03-16 14:50:10.016274 WARNING AppDaemon: HASS: Disconnected from Home Assistant, retrying in 5 seconds
2018-03-16 14:50:15.021919 WARNING AppDaemon: HASS: Disconnected from Home Assistant, retrying in 5 seconds
2018-03-16 14:50:20.027556 WARNING AppDaemon: HASS: Disconnected from Home Assistant, retrying in 5 seconds
2018-03-16 14:50:25.031871 WARNING AppDaemon: HASS: Disconnected from Home Assistant, retrying in 5 seconds
2018-03-16 14:50:36.889636 WARNING AppDaemon: HASS: Disconnected from Home Assistant, retrying in 5 seconds
2018-03-16 14:50:41.895097 WARNING AppDaemon: HASS: Disconnected from Home Assistant, retrying in 5 seconds
2018-03-16 14:50:46.900757 WARNING AppDaemon: HASS: Disconnected from Home Assistant, retrying in 5 seconds
2018-03-16 14:50:52.523531 INFO AppDaemon: HASS: Connected to Home Assistant 0.65.5
2018-03-16 14:50:53.370161 INFO AppDaemon: Adding /home/homeassistant/.homeassistant/.appdaemon/apps to module import path
2018-03-16 14:50:53.371015 INFO AppDaemon: Processing restart for HASS
2018-03-16 14:50:54.719539 INFO AppDaemon: App initialization complete

access logs:

2018-03-16 14:23:37.925459 INFO Compiling dashboard 'FirePanel'
2018-03-16 14:23:38.450140 WARNING Dashboard 'FirePanel' not found
2018-03-16 14:23:38.451005 WARNING ------------------------------------------------------------
2018-03-16 14:23:38.451428 WARNING Unexpected error during DASH creation
2018-03-16 14:23:38.451844 WARNING ------------------------------------------------------------
2018-03-16 14:23:38.453765 WARNING Traceback (most recent call last):
  File "/srv/homeassistant/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/.homeassistant/.appdaemon/conf/compiled/html/default/firepanel_head.html'

2018-03-16 14:23:38.454280 WARNING ------------------------------------------------------------
2018-03-16 14:23:38.454664 INFO function [get_dashboard] finished in 547 ms

After the upgrade to v3 I was having some trouble and while troubleshooting I deleted my compiled dir, but now AD does not compile the dashboards looks like.

File structure:

.appdaemon/
├── apps
├── conf
│ └── compiled
│ ├── css
│ ├── html
│ └── javascript
├── dashboards
└── logs

Tried:

dash_force_compile: 1

and

dash_compile_on_start: 1

no luck.

I tried to uninstall AD, deleted all config and then reinstall, cannot seem to make it work again. Please help.

Thanks,
Angelo.

you deleted the dirs, and they are back there, but do they have the right rights?
appdaemon should have full control in the dirs. (and the complete conf dir)

this dir structure “.homeassistant/.appdaemon” is what unusaual, but shouldnt give problems if setup correctly.

Hi Rene,

Thanks for your reply. Yes, I deleted the content of the compiled dir and at restart of app the system created css and javascript directories but I had to manually create html dir to try resolve the error above. Also, the owner is the homeassistant user, same one I use to run AD.

Regarding the file structure, appdaemon used to work properly prior the upgrade to v3, so I thought it would not be the problem.

Thanks again,
Angelo

to make sure that nothing is hanging somewhere do these steps in this order:

||close all dashboards|
||clear the cash from the browsers that you use the dashboards in|
||close appdaemon|
||clear your logfiles|
||clear the subdirectories that are in conf/compiled but leave the structure|
||close the device that is running appdaemon|
||restart the device that is running appdaemon|
||restart appdaemon|
||open 1 dashboard in google chrome|
||if you still have problems then look at the java console (CTRL Shift I) in chrome for errors and look in your logfiles for errors. |
|o|which python version you are running|
|o|the logfiles from the start|
|o|the java console error(s)|

I also had the same problem what I did is leaving the config as it was the key got automaticly created

Running HASSIO btw

secrets: /config/secrets.yaml
log:
  logfile: STDOUT
  errorfile: STDERR
appdaemon:
  threads: 10
  app_dir: /config/appdaemon/apps
  plugins:
    HASS:
      type: hass
      ha_url: http://hassio/homeassistant
      ha_key: *************************
hadashboard:
  dash_url: http://127.0.0.1:5050
  dash_dir: /config/appdaemon/dashboards

Thanks Rene,

I already saw this suggestion in another post and I already tried it few times. The AP page does not load at all, it just returns a white page when I go to http://IP_ADDRESS:5050 and I’m afraid that b/c I have no content at all in the compiled directory.

houtknots, I don’t use hassio, but I believe that my issue is related to the config that never gets created/compiled.

Thanks,
Angelo.

i would try to lose the dot before appdaemon
by the way, which version from python do you use?
and is the homeassistant user owner from the compiled dir and does it have wtiting access in the complete structure?
and i noticed that the css, html and js directories are in the conf dir, they need to be in the compiled dir.

I can try to remove the . from the appdaemon directory.

However the file structure as the confing, did not come out with the right spacing, so it does not reflect the proper structures. See below for the response to your questions:

$ ls -la .appdaemon/
total 24
drwxr-xr-x 6 homeassistant casa 4096 Mar 16 14:20 .
drwxr-xr-x 12 homeassistant casa 4096 Mar 17 12:20 …
drwxr-xr-x 2 homeassistant casa 4096 Mar 16 14:20 apps
drwxr-xr-x 3 homeassistant casa 4096 Mar 16 20:00 conf
drwxr-xr-x 2 homeassistant casa 4096 Mar 16 19:58 dashboards
drwxr-xr-x 2 homeassistant casa 4096 Mar 16 14:22 logs
$ ls -la .appdaemon/conf/
total 20
drwxr-xr-x 3 homeassistant casa 4096 Mar 16 20:00 .
drwxr-xr-x 6 homeassistant casa 4096 Mar 16 14:20 …
-rwxr-xr-x 1 homeassistant casa 919 Mar 16 19:56 appdaemon.yaml
drwxr-xr-x 5 homeassistant casa 4096 Mar 16 14:35 compiled
-rw-r–r-- 1 homeassistant casa 25 Mar 16 14:22 secrets.yaml
$ ls -la .appdaemon/conf/compiled/
total 20
drwxr-xr-x 5 homeassistant casa 4096 Mar 16 14:35 .
drwxr-xr-x 3 homeassistant casa 4096 Mar 16 20:00 …
drwxr-xr-x 2 homeassistant casa 4096 Mar 16 14:22 css
drwxr-xr-x 2 homeassistant casa 4096 Mar 16 14:35 html
drwxr-xr-x 2 homeassistant casa 4096 Mar 16 14:22 javascript
$ python --version
Python 3.5.3

Thanks,
Angelo.

changing .appdaemon to appdaemon did not help

2018-03-17 12:30:46.201470 INFO Compiling dashboard ‘FirePanel’
2018-03-17 12:30:46.767727 WARNING Dashboard ‘FirePanel’ not found
2018-03-17 12:30:46.768678 WARNING ------------------------------------------------------------
2018-03-17 12:30:46.774620 WARNING Unexpected error during DASH creation
2018-03-17 12:30:46.775117 WARNING ------------------------------------------------------------
2018-03-17 12:30:46.779521 WARNING Traceback (most recent call last):
File “/srv/homeassistant/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/.homeassistant/appdaemon/conf/compiled/html/default/firepanel_head.html’

2018-03-17 12:30:46.780111 WARNING ------------------------------------------------------------
2018-03-17 12:30:46.780509 INFO function [get_dashboard] finished in 617 ms

and the html dir is still empty…

$ ls -la /home/homeassistant/.homeassistant/appdaemon/conf/compiled/html/
total 8
drwxr-xr-x 2 homeassistant casa 4096 Mar 16 14:35 .
drwxr-xr-x 5 homeassistant casa 4096 Mar 16 14:35 …

do you have a file “FirePanel.dash” in your dashboards dir with the right filerights?
and dont forget to check out capitals.

the FirePanel dashboard cant be found.

did you also change your appdaemon.yaml?

Yes, FirePanel dashboard is there:

$ ls -la appdaemon/dashboards/
total 24
drwxr-xr-x 2 homeassistant casa 4096 Mar 16 19:58 .
drwxr-xr-x 6 homeassistant casa 4096 Mar 16 14:20 …
-rwxr-xr-x 1 homeassistant casa 7673 Mar 16 19:58 FirePanel.dash
-rwxr-xr-x 1 homeassistant casa 200 Mar 16 19:58 hello.dash.disabled
-rwxr-xr-x 1 homeassistant casa 1029 Mar 16 19:58 IPCameras.dash
[/details]

and I did adjust the appdaemon.yaml accordingly:

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
  #dash_force_compile: 1

Both FirePanel and IPCameras dashboards used to work with no problems on v2.12

when you dont show yaml as codeblock i cant read it. :wink:
your yaml seems correct, but i cant be sure.

what do you get at the url:
http://10.1.190.49:5050
without any dashboards?
screenshot please if it isnt easy to describe.

Sorry for the formatting, I fixed it now.
Also I get nothing when I go to http://10.1.190.49:5050, white empty page, that’s it. With 2.12 I used to get the AppDaemon home page with the links to my dashboards.

then your dashboard server isnt running correct.
the whitscreen in google chrome also probably has an error.
so go to the java console to see that error. (ctrl shift I)

and after you have changed things like directories and have problems, its wise to do the whole list again:
||close all dashboards
||clear the cash from the browsers that you use the dashboards in
||close appdaemon
||clear your logfiles
||clear the subdirectories that are in conf/compiled but leave the structure
||close the device that is running appdaemon
||restart the device that is running appdaemon
||restart appdaemon
||open 1 dashboard in google chrome
||if you still have problems then look at the java console (CTRL Shift I) in chrome for errors and look in your logfiles for errors.
|o|show the logfiles from the start
|o|show the java console error(s)

This is the errors I see with chrome dev tools:

Thanks

seems you have no right to access the server.
what is in the logs (from the start till the end) now?

no logs whatsoever on any of the AD logs…

nothing in the logs?
not even a single line?
then you didnt start AD, i guess.
if you start a programm you will always get some kind of feedback.

i am not asking about errors, but everything that is in the logs.

Not even a line during my tests against http://10.1.190.49:5050

appdaemon is running, see below:

[email protected] - AppDaemon
   Loaded: loaded (/etc/systemd/system/[email protected]; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2018-03-19 19:53:21 PDT; 4min 54s ago
 Main PID: 524 (appdaemon)
   CGroup: /system.slice/system-appdaemon.slice/[email protected]
           └─524 /srv/homeassistant/bin/python3 /srv/homeassistant/bin/appdaemon -c /home/homeassistant/.homeassistant/appdaemon/conf

Mar 19 19:53:21 hass49 systemd[1]: Started AppDaemon.

I have the logs if you want me to share them, but they are just the same as the ones above.

Thanks,
Angelo.

It may help sharing the systemd service configuration as well:

[Unit]
Description=AppDaemon
[email protected]
[email protected]

[Service]
Type=simple
User=homeassistant
ExecStart=/srv/homeassistant/bin/appdaemon -c /home/homeassistant/.homeassistant/appdaemon/conf

[Install]
WantedBy=multi-user.target