Dashboard Loading Error

Had AppDaemon/HADashboard running perfectly but now I see this warning when starting up.

I’m running on a Synology NAS in Docker. Any idea whats causing this?

2017-10-04 12:53:15.751572 WARNING ------------------------------------------------------------
stdout
12:53:15
2017-10-04 12:53:15.751653 WARNING Unexpected error in dashboard thread
stdout
12:53:15
2017-10-04 12:53:15.751712 WARNING ------------------------------------------------------------
stdout
12:53:15
2017-10-04 12:53:15.752243 WARNING Traceback (most recent call last):
stdout
12:53:15
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_urldispatcher.py", line 401, in __init__
stdout
12:53:15
raise ValueError('Not a directory')
stdout
12:53:15
ValueError: Not a directory
stdout
12:53:15
stdout
12:53:15
The above exception was the direct cause of the following exception:
stdout
12:53:15
stdout
12:53:15
Traceback (most recent call last):
stdout
12:53:15
  File "/usr/local/lib/python3.6/site-packages/appdaemon/rundash.py", line 318, in run_dash
stdout
12:53:15
setup_routes(conf.dashboard_obj)
stdout
12:53:15
  File "/usr/local/lib/python3.6/site-packages/appdaemon/rundash.py", line 288, in setup_routes
stdout
12:53:15
app.router.add_static('/compiled_javascript', dashboard.compiled_javascript_dir)
stdout
12:53:15
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_urldispatcher.py", line 845, in add_static
stdout
12:53:15
follow_symlinks=follow_symlinks)
stdout
12:53:15
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_urldispatcher.py", line 404, in __init__
stdout
12:53:15
"No directory exists at '{}'".format(directory)) from error
stdout
12:53:15
ValueError: No directory exists at '/conf/compiled/javascript'
stdout
12:53:15
stdout
12:53:15
2017-10-04 12:53:15.752314 WARNING ------------------------------------------------------------

Ok I now have my Dashboards generating again after re-creating the structure of the compiled folder.

But I am back to my original errors of the Java Console displaying.

[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (state, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (materialdesignicons.min.css.map, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (jquery.gridster.css.map, line 0)

i guess you have changed some parts or reinstalled? (or else your dir structure couldnt be gone)

whats your version from AD?
how does your appdaemon.yaml look?
how does your apps.yaml look?
did you restart appdaemon completely?
what was in the logs after restart?

Hi @ReneTode no changes or reinstalls I did do a container update but that was in attempt to rectify this issue.

Version is 2.1.9 I believe at least thats what the container says (pulled :latest)

appdaemon.yaml

AppDaemon:
  logfile: STDOUT
  errorfile: STDERR
  threads: 10
HASS:
  ha_url: https://domain:8123
  ha_key: password
HADashboard:
  dash_url: http://$192.000.0.000:5050
# Apps
hello_world:
  module: hello
  class: HelloWorld

apps.yaml

hello_world:
  module: hello
  class: HelloWorld

I have really only dipped my toe in app functionality and currently have nothing enabled. Using only for HADashboard I have restarted the container and this just regenerates the same log.

2017-10-04 20:44:49.487082 WARNING ------------------------------------------------------------
stdout
19:44:49
2017-10-04 20:44:49.487154 WARNING Unexpected error in dashboard thread
stdout
19:44:49
2017-10-04 20:44:49.487204 WARNING ------------------------------------------------------------
stdout
19:44:49
2017-10-04 20:44:49.487733 WARNING Traceback (most recent call last):
stdout
19:44:49
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_urldispatcher.py", line 401, in __init__
stdout
19:44:49
    raise ValueError('Not a directory')
stdout
19:44:49
ValueError: Not a directory
stdout
19:44:49
stdout
19:44:49
The above exception was the direct cause of the following exception:
stdout
19:44:49
stdout
19:44:49
Traceback (most recent call last):
stdout
19:44:49
  File "/usr/local/lib/python3.6/site-packages/appdaemon/rundash.py", line 318, in run_dash
stdout
19:44:49
    setup_routes(conf.dashboard_obj)
stdout
19:44:49
  File "/usr/local/lib/python3.6/site-packages/appdaemon/rundash.py", line 288, in setup_routes
stdout
19:44:49
    app.router.add_static('/compiled_javascript', dashboard.compiled_javascript_dir)
stdout
19:44:49
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_urldispatcher.py", line 845, in add_static
stdout
19:44:49
    follow_symlinks=follow_symlinks)
stdout
19:44:49
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_urldispatcher.py", line 404, in __init__
stdout
19:44:49
    "No directory exists at '{}'".format(directory)) from error
stdout
19:44:49
ValueError: No directory exists at '/conf/compiled/javascript'
stdout
19:44:49
stdout
19:44:49
2017-10-04 20:44:49.487802 WARNING ------------------------------------------------------------
stdout
19:44:49
2017-10-04 20:44:49.487854 INFO API is disabled
stdout
19:44:49
2017-10-04 20:44:49.530295 INFO Connected to Home Assistant 0.54.0

that isnt the cmplete log (there is no start) but you dont have any logfiles set so you cant see all errors.

  logfile: STDOUT
  errorfile: STDERR

tells the log to go to the screen or nowhere. you can set your own logfiles there in a dir where appdaemon has writing acces.

but the first thing i noticed in your error:

No directory exists at '/conf/compiled/javascript

its something i see coming by a lot.
please create the following directories:

/conf/compiled/javascript
/conf/compiled/html
/conf/compiled/css

and make sure that appdaemon has writing rights in those directories and its subdirectories.

Thanks again for the reply @ReneTode I have followed your steps…

A couple of things I should maybe point out when launching the container initially I have no permission to edit the appdaemon.yaml I must fist adjust permissions for my user account. All files in the dir are owned by Root…

I have added the extra logging options and re-created the compiled structure as I did before. I’m now back to the the Java Console throwing the below errors.

[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (state, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (materialdesignicons.min.css.map, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (jquery.gridster.css.map, line 0) 

Log now looks like this…

2017-10-05 08:37:06.714768 INFO AppDaemon Version 2.1.9 starting
2017-10-05 08:37:06.714955 INFO Configuration read from: /conf/appdaemon.yaml
2017-10-05 08:37:06.789400 INFO Starting Apps
2017-10-05 08:37:06.908667 INFO Got initial state
2017-10-05 08:37:06.909120 INFO Loading Module: /conf/apps/hello.py
2017-10-05 08:37:06.909553 INFO Loading Object hello_world using class HelloWorld from module hello
2017-10-05 08:37:06.944248 INFO hello_world: Hello from AppDaemon
2017-10-05 08:37:06.944843 INFO hello_world: You are now ready to run Apps!
2017-10-05 08:37:06.944929 INFO App initialization complete
2017-10-05 08:37:06.945089 INFO Starting dashboard
2017-10-05 08:37:06.947615 INFO API is disabled
2017-10-05 08:37:06.984414 INFO Connected to Home Assistant 0.54.0
2017-10-05 08:37:24.284757 INFO AppDaemon Version 2.1.9 starting
2017-10-05 08:37:24.284938 INFO Configuration read from: /conf/appdaemon.yaml
2017-10-05 08:37:24.355238 INFO Starting Apps
2017-10-05 08:37:24.453383 INFO Got initial state
2017-10-05 08:37:24.453835 INFO Loading Module: /conf/apps/hello.py
2017-10-05 08:37:24.454251 INFO Loading Object hello_world using class HelloWorld from module hello
2017-10-05 08:37:24.487869 INFO hello_world: Hello from AppDaemon
2017-10-05 08:37:24.488494 INFO hello_world: You are now ready to run Apps!
2017-10-05 08:37:24.488575 INFO App initialization complete
2017-10-05 08:37:24.488743 INFO Starting dashboard
2017-10-05 08:37:24.491261 INFO API is disabled
2017-10-05 08:37:24.541878 INFO Connected to Home Assistant 0.54.0
2017-10-05 08:37:36.094094 INFO New dashboard connected: Family Room
2017-10-05 08:37:36.561697 INFO New dashboard connected: Family Room
2017-10-05 08:37:46.861448 INFO New dashboard connected: Master Bedroom
2017-10-05 08:38:08.202987 INFO New dashboard connected: Family Room
2017-10-05 08:38:20.134013 INFO function [get_dashboard] finished in 95 ms
2017-10-05 08:38:20.143362 INFO Dashboard disconnected
2017-10-05 08:38:22.454473 INFO New dashboard connected: Master Bedroom
2017-10-05 08:38:22.584680 INFO function [get_dashboard] finished in 13 ms
2017-10-05 08:38:22.597285 INFO Dashboard disconnected
2017-10-05 08:38:24.671297 INFO New dashboard connected: Master Bedroom

Nothing has been generated in the error log file.

seems like that the dashboard is running correctly.
how does the screen you get look in the browser?
how do you call the dashboard in the browser?
do you have passwords set?

seems like you still have fileright problems. but i have no experience in docker at all

Dashboards load up with a pop up.

Error getting state, check Java Console for details

I call either direct or select from the main HADashboard menu. No passwords I have stripped this install right back to nothing.

Once I click OK on the pop up 5+ times it will go away but ill have icons missing and lack of functionality state updates etc presumably due to the CSS maps not loading.

what is in the compiled dirs after you tried loading the dashboard?
are the rights for those dirs set correctly?
try creating a dashboard with just one switch and look what error that gives.

Everything in them is owned by root. Which seems to be the norm no matter what I do…

Just loaded up a one switch board as you suggested. The JavaConsole reports the below errors…

[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (materialdesignicons.min.css.map, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (jquery.gridster.css.map, line 0)
[Error] WebSocket connection to 'ws://IP:5050/stream' failed: Unexpected response code: 400 (x6)

that can only be right if you run appdaemon as root (which seems unlikely to me)
you need to set the filerights from the directory compiled so that Appdaemon has reading/writing access for all files, subdirs and everything that gets created in there.

My Synology box forces running as sudo through ssh. With that in mind I just cleared the config folder started the container manually through the docker gui and everything built is once again owned by root.

As a test I just gave the whole config dir full r/w permissions to everyone. Restarted and loaded up a dashboard and still the same errors.

[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (jquery.gridster.css.map, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (materialdesignicons.min.css.map, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (state, line 0)
[Error] WebSocket connection to 'ws://IP:5050/stream' failed: Unexpected response code: 400 (x5)

I’m unsure where to go from here.

oke, at least i know now that the filerights in that dir are right.
and we know appdaemon is running as it should be.

is there anything in the ERRORlog?

Error log still empty. Just re-built the config structure by hand and tried launching the container without -e credentials in the docker run command. Still the same outcome.

i have no idea what that means :wink:
like i said i have no exp in docker.

i know there are others who had problems with docker.
but most get connection errors.

error log still empy shouldnt be right.
to what file did you set the error in your appdaemon.yaml and has appdaemon writing acces there?

Error log is set too errorfile: /conf/logs/error.log

i googled a bit on this error and i found that it could be related to your platform.
what browser/ device do you use?

can you try on another browser/ device?

in this topic there are the exact same errors,

but i also found it on a site which was before appdaemon existed.
but there was no solution there.

Thanks @ReneTode appreciate all the help.

Tried on another browser (Chrome) apposed to Safari. Still no joy same errors/problem…

This problem literally spawned from nowhere. I have had HADashboard up and running perfectly previously.

So strange…

did you try other device?
PC, tablet, mobile?

Yes, same problem on mobile and tablet. :frowning: