Install issues - please advise

i think the last option is the right one.
could be that you are right about the requests version.

but i dont know how you could get around the “owned by OS” part.

creating a virtual env with appdaemon in it?

I guess another option I could try would be to install it via Docker, on a different machine on my network. Any idea if any of these are current, aka, version 2.0.0beta3.5?

i hope so but i dont know for sure. i never used docker.

but i created a venv a few days ago and that worked like a charm (allthough i am not a fan from it, but i needed differen AD versions running at the same time on the same RPI :wink: )

So… I just managed to build, create, configure, and run a docker container for hadashboard, if I open the log, I’m still getting the same messages I was getting before:

2017-05-04 00:37:06.379077 INFO AppDaemon Version 2.0.0beta3.5 starting
stdout
00:37:06
2017-05-04 00:37:06.417171 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
stdout
00:37:11
2017-05-04 00:37:11.430298 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
stdout
00:37:16
2017-05-04 00:37:16.441067 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
stdout
00:37:21
2017-05-04 00:37:21.449387 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
stdout
00:37:26
2017-05-04 00:37:26.460525 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
stdout
00:37:31
2017-05-04 00:37:31.471518 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
stdout
00:37:36
2017-05-04 00:37:36.480847 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
stdout
00:37:41
2017-05-04 00:37:41.491092 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
stdout
00:37:46
2017-05-04 00:37:46.502554 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
stdout
00:37:51
2017-05-04 00:37:51.513881 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
stdout
00:37:56
2017-05-04 00:37:56.525161 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
stdout
00:38:01
2017-05-04 00:38:01.536867 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
stdout
00:38:06
2017-05-04 00:38:06.544887 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
stdout
00:38:11
2017-05-04 00:38:11.556518 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
stdout
00:38:16
2017-05-04 00:38:16.569357 WARNING Unable to connect to Home Assistant, retrying in 5 seconds

This is from an entirely different machine, on the same network, via docker.
Do I need to change anything within HA to allow HADashboard to connect to it? Seems like a url & password should suffice to me. I’ve got to be missing something here…

So I made some more progress.
Before I had the ha_url set to: https://external.domain.name:8123
Got to thinking about it, and that’s not correct, because externally HA is accessed by going to: https://external.domain.name (minus the port) and the router is doing port forwarding from 443 → 8123. So changing ha_url to: https://external.domain.name helped a lot!

It seems that HADashboard is running! (yay!)

2017-05-04 01:20:43.253605 INFO AppDaemon Version 2.0.0beta3.5 starting
2017-05-03 19:20:48.755775 INFO Got initial state
2017-05-03 19:20:48.756880 INFO Loading Module: /conf/apps/hello.py
2017-05-03 19:20:48.759555 INFO Loading Object hello_world using class HelloWorld from module hello
2017-05-03 19:20:48.903928 INFO hello_world: Hello from AppDaemon
2017-05-03 19:20:48.906181 INFO hello_world: You are now ready to run Apps!
2017-05-03 19:20:48.906443 INFO App initialization complete
2017-05-03 19:20:49.074631 INFO Connected to Home Assistant 0.43.0

But one thing I’m not seeing, is something like this:
INFO Listening on ('192.168.1.20', 5050)

And when I go to the external docker url, for this container, I get a 404, like nothing is listening…
So is there a way to tell hadashboard to listen on 5050? I don’t see a runtime flag for it, nor do I see it mentioned in the config file. If i run a port scan against the docker-host, I do see that the port for the container is open. Just seems like it’s not listening for connections.

Success!

Here’s what I did to fix the issues, maybe it will help someone else.
If your HA is using LetsEncrypt, and you’re doing router port forwarding from 443 → 8123, then set your ha_url: https://external.domain.name (no port necessary)

This forum post talks about setting dash_url to the LAN IP of the docker host, when I tried this, I got the following errror:

OSError: [Errno 99] error while attempting to bind on address ('192.168.x.x', 5050): cannot assign requested address

Basically, permission denied. So instead of trying to assign an IP address, I set to 0.0.0.0, which should tell the process to listen on any available IP address, and not specifically try to bind to one.
So, if you’re running HADashboard in a docker image, and everything seems to be working fine, but you’re not seeing the dashboard, like you’d expect…
Add this to your appdaemon.cfg file:
dash_url = http://0.0.0.0:5050

Start up the container, and you should see something like this in your appdaemon log:

2017-05-03 19:57:12.766450 INFO Listening on ('0.0.0.0', 5050)

Finally, open your browser and go to: http://docker-lan-ip:5050 and you should be greated with the HADashboard HelloWorld module!

EDIT: Well, almost…
going to: http://docker-lan-ip:5050 works, but the “hello” link from that page points to: http://0.0.0.0:5050/Hello which obviously won’t work… Hmm…

I had an issue with running on docker until i did this as someone else pointed out in another thread:

Before building docker image:

Modify appdaemon/appdash.py and change the create_server line under run_dash to:
f = loop.create_server(handler, “0.0.0.0”, int(conf.dash_port))

Also I found it to be easier to set up a nginx reverse proxy for ssl and in my internal network i dont use SSL for home assistant

now you know how you need to edit the url in your config, you could go back to your original install :wink:
unless you did an uninstall off course :wink:

Thanks, I’ll get this configured, and rebuilt.

In the meantime, do you have any idea about the relationship between “f = loop.create_server(handler, “0.0.0.0”, int(conf.dash_port))” and “dash_url = http://0.0.0.0:5050”?

I mean, currently appdash.py has the following line:
f = loop.create_server(handler, conf.dash_host, int(conf.dash_port))

Which would tell me it’s getting “dash_host” from the “conf” file, right?
So if the conf file, has “dash_url = http://0.0.0.0:5050” why would we need to change the appdash.py file at all? Does “dash_url = http://0.0.0.0:5050” set “conf.dash_host”?

So I’ve modified the appdash.py file, and updated the line, so it reads:
f = loop.create_server(handler, "0.0.0.0", int(conf.dash_port))

Rebuilt the container, and modified the conf file.
Now if I remove dash_url = http://0.0.0.0:5050
and start the container, it doesn’t bind to an address, and thus the url returns a 404.

But If I add dash_url = http://0.0.0.0:5050
It does bind to an address, and I get the main page, but when I click on “Hello”, I get the url: http://0.0.0.0:5050/Hello which obviously won’t work.

Finally, if I add dash_url = http://docker-lan-ip:5050
It starts up, but errors out with the following:

2017-05-04 16:45:30.272340 INFO AppDaemon Version 2.0.0beta3.5 starting
2017-05-04 10:45:36.078630 INFO Got initial state
2017-05-04 10:45:36.079715 INFO Loading Module: /conf/apps/hello.py
2017-05-04 10:45:36.086468 INFO Loading Object hello_world using class HelloWorld from module hello
2017-05-04 10:45:36.246972 INFO hello_world: Hello from AppDaemon
2017-05-04 10:45:36.249196 INFO hello_world: You are now ready to run Apps!
2017-05-04 10:45:36.249471 INFO App initialization complete
2017-05-04 10:45:36.250012 INFO Starting dashboard
2017-05-04 10:45:36.260184 WARNING ------------------------------------------------------------
2017-05-04 10:45:36.260527 WARNING Unexpected error in dashboard thread
2017-05-04 10:45:36.260698 WARNING ------------------------------------------------------------
2017-05-04 10:45:36.263732 WARNING Traceback (most recent call last):
  File "/usr/local/lib/python3.4/asyncio/base_events.py", line 946, in create_server
    sock.bind(sa)
OSError: [Errno 99] Cannot assign requested address
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/site-packages/appdaemon/appdash.py", line 254, in run_dash
    srv = loop.run_until_complete(f)
  File "/usr/local/lib/python3.4/asyncio/base_events.py", line 373, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.4/asyncio/futures.py", line 274, in result
    raise self._exception
  File "/usr/local/lib/python3.4/asyncio/tasks.py", line 240, in _step
    result = coro.send(None)
  File "/usr/local/lib/python3.4/asyncio/base_events.py", line 950, in create_server
    % (sa, err.strerror.lower()))
OSError: [Errno 99] error while attempting to bind on address ('docker-lan-ip', 5050): cannot assign requested address.

So, basically every option I can think of, still fails. Suggestions?

Anyone have any idea how to fix this:
bottom_panel: Error opening dashboard file './conf/dashboards/./conf/dashboards/bottom_panel.yaml'

dash_url is used for generating URLs and because of CORS issues it needs to exactly match what you put into your browser. Been bugging him to work on changing that up a bit, but it is what it is for now, it’s not the easiest thing to solve for and for most people you can get what you need working.

The source code assumes no virtual IPs, and then takes dash_url and extracts the hostname for a bind. Honestly, there’s no reason to ever do that, 0.0.0.0 will work for 99.9999% of everyone. So I was the one who suggested that mod

By the time 2.0 is done, I have a pull request in for a better Docker file and a readme on how to use Docker, and hopefully we’ll have the auto-build setup under home-assistant’s hub account. It’s extremely streamlined if you play with my fork right now, although I’m sure it’s behind upstream on the appdaemon version by now :slight_smile:

Thanks man, your contributions, at least on the forum have helped me make quite a bit of progress.

For the time being, I’ve scratched the docker instance, as I couldn’t get the url working right. But once 2.0 is done, and your pull request is merged, I’ll take another look at it.

1 Like

Yes, with @quadportnick 's assistance I am hoping to improve the Docker experience, it just isn’t a priority for the Beta.

After 3 (almost full) days of messing with this, I finally got it working, and looking pretty good too!

4 Likes

Would you mind elaborating on this? I’ve got nginx setup, but I’m still using ssl internally (and don’t need to be).

I followed this guide:

then i got inspiration for my nginx configuration from this guide:
https://deviantengineer.com/2015/05/nginx-reverseproxy-centos7/

After that i had issues when i tried to login to home assistant.
This was fixed by changing the proxy pass location to this:

 location  / {
     proxy_pass  http://10.0.0.80:8123/;
     proxy_set_header Host $host;
     proxy_set_header X-Real-IP $remote_addr;
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_http_version 1.1;
         proxy_set_header Upgrade $http_upgrade;
         proxy_set_header Connection $connection_upgrade;
   }
1 Like

Finally got mine up and running on my FreeNAS Corral setup (yes… i know… it’s a dead system base but it’s what i’ve got til docker is in the new FN 11).
Had to manually copy over the conf directory, and add dash_url to the config yaml (container is bridged so put http://containerip:5050)
All working and a happy chappy :slight_smile: now to get config’ing…

1 Like

Could I get some help please? I did have HADashboard v1 up and running, using the manual install, but it wasn’t updating so I spent ages getting all the bugs out of my install of HApush. I finally got that playing ball but I’ve somehow buggered my HADashboard!! Here’s what I get when I start dashing:-

pi@hadashboard:~/hadashboard $ dashing start
/home/pi/.rvm/gems/ruby-2.4.0/gems/thin-1.6.4/lib/thin/server.rb:107: warning: constant ::Fixnum is deprecated
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/psych.rb:377:in `parse': (history.yml): invalid leading UTF-8 octet at line 1 column 1 (Psych::SyntaxError)
        from /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/psych.rb:377:in `parse_stream'
        from /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/psych.rb:325:in `parse'
        from /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/psych.rb:252:in `load'
        from /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/psych.rb:473:in `block in load_file'
        from /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/psych.rb:472:in `open'
        from /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/psych.rb:472:in `load_file'
        from /home/pi/.rvm/gems/ruby-2.4.0/gems/dashing-1.3.7/lib/dashing/app.rb:44:in `<top (required)>'
        from /home/pi/.rvm/gems/ruby-2.4.0/gems/dashing-1.3.7/lib/dashing.rb:3:in `require'
        from /home/pi/.rvm/gems/ruby-2.4.0/gems/dashing-1.3.7/lib/dashing.rb:3:in `<top (required)>'
        from config.ru:1:in `require'
        from config.ru:1:in `block in <main>'
        from /home/pi/.rvm/gems/ruby-2.4.0/gems/rack-1.5.5/lib/rack/builder.rb:55:in `instance_eval'
        from /home/pi/.rvm/gems/ruby-2.4.0/gems/rack-1.5.5/lib/rack/builder.rb:55:in `initialize'
        from config.ru:1:in `new'
        from config.ru:1:in `<main>'
        from /home/pi/.rvm/gems/ruby-2.4.0/gems/thin-1.6.4/lib/rack/adapter/loader.rb:33:in `eval'
        from /home/pi/.rvm/gems/ruby-2.4.0/gems/thin-1.6.4/lib/rack/adapter/loader.rb:33:in `load'
        from /home/pi/.rvm/gems/ruby-2.4.0/gems/thin-1.6.4/lib/thin/controllers/controller.rb:182:in `load_rackup_config'
        from /home/pi/.rvm/gems/ruby-2.4.0/gems/thin-1.6.4/lib/thin/controllers/controller.rb:72:in `start'
        from /home/pi/.rvm/gems/ruby-2.4.0/gems/thin-1.6.4/lib/thin/runner.rb:200:in `run_command'
        from /home/pi/.rvm/gems/ruby-2.4.0/gems/thin-1.6.4/lib/thin/runner.rb:156:in `run!'
        from /home/pi/.rvm/gems/ruby-2.4.0/gems/thin-1.6.4/bin/thin:6:in `<top (required)>'
        from /home/pi/.rvm/gems/ruby-2.4.0/bin/thin:23:in `load'
        from /home/pi/.rvm/gems/ruby-2.4.0/bin/thin:23:in `<main>'
        from /home/pi/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:15:in `eval'
        from /home/pi/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:15:in `<main>'
pi@hadashboard:~/hadashboard $

I’ve followed all the advice I can find including modifying the specifications.rb file. I haven’t changed my config from when it was working, I’ve just spent my time updating Ruby with rvm and making sure it uses the most up-to-date version. I just cannot find the problem! I’ve re-installed bundler and run bundle loads of times, as well as re-installing dashing. I’ve even cleansed all the Gems but nothing seems to be working. Note-to-self, do a backup of a semi-working version before messing about!

I’m also getting

2017-08-14 23:34:15.511076 WARNING Unable to connect to Home Assistant, retrying in 5 seconds

and this the debug log:

2017-08-14 23:34:40.179257 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
2017-08-14 23:34:40.179996 WARNING ------------------------------------------------------------
2017-08-14 23:34:40.180738 WARNING Unexpected error:
2017-08-14 23:34:40.181412 WARNING ------------------------------------------------------------
2017-08-14 23:34:40.183829 WARNING Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/requests/utils.py", line 868, in check_header_validity
    if not pat.match(value):
TypeError: expected string or buffer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/appdaemon/appdaemon.py", line 1779, in main
    ha_config = ha.get_ha_config()
  File "/usr/local/lib/python3.4/dist-packages/appdaemon/homeassistant.py", line 263, in get_ha_config
    r = requests.get(apiurl, headers=headers, verify=conf.certpath)
  File "/usr/local/lib/python3.4/dist-packages/requests/api.py", line 72, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 494, in request
    prep = self.prepare_request(req)
  File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 437, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/usr/local/lib/python3.4/dist-packages/requests/models.py", line 306, in prepare
    self.prepare_headers(headers)
  File "/usr/local/lib/python3.4/dist-packages/requests/models.py", line 440, in prepare_headers
    check_header_validity(header)
  File "/usr/local/lib/python3.4/dist-packages/requests/utils.py", line 872, in check_header_validity
    "not %s" % (value, type(value)))
requests.exceptions.InvalidHeader: Header value 93129498 must be of type str or bytes, not <class 'int'>

2017-08-14 23:34:40.184761 WARNING ------------------------------------------------------------

what is going on?