Dear Community,
I am really hoping someone might be able to save what hair I have left after spending too many hours on this now without resolution.
I’m running Docker on a Synology and have HASS working absolutely fine but do you think I can get the latest appdaemon docker image connected to it? You thought right, no
Would be realllllllyyyyy grateful if someone might be able to shed some light on this as I’m beginning to think it might be a bug or problem with the latest python response util module?
My appdaemon.yaml looks like this:
AppDaemon:
logfile: STDOUT
errorfile: STDERR
threads: 10
HASS:
ha_url: http://192.168.redacted:8123
ha_key: 111111
HADashboard:
dash_url: http://192.168.redacted:5050
#Apps
hello_world:
module: hello
class: HelloWorld
The following docker command is being used to create the container and I’ve tried many variants, both with and without the environment variables too. The strange thing is if I use the env variables they appear twice in the Synology Docker GUI. I’m currently leaving them out because all this information should be picked up from the configuration file, correct?
sudo docker run --name=appdaemon -d -p 5050:5050 \
--restart=always \
-e HA_URL="http://192.168.redacted:8123" \
-e HA_KEY="111111" \
-e DASH_URL="http://192.168.redacted:5050" \
-v /volume1/docker/appdaemon:/conf \
acockburn/appdaemon:latest
The container is created and runs but no matter what I do, it will not connect to the HASS instance, running in a separate Docker container. I’ve even tried removing the api_key and simplifying the HASS configuration but nothing seems to work.
If I use the EXTRA_CMD="-D DEBUG" variable this is the only thing that’s got slightly close to hinting at the problem but still does not make much sense to me but hopefully someone here maybe able to decipher better than me?
WARNING Unable to connect to Home Assistant, retrying in 5 seconds
2017-08-08 12:18:21.894482 WARNING ------------------------------------------------------------
2017-08-08 12:18:21.894666 WARNING Unexpected error:
2017-08-08 12:18:21.895332 WARNING ------------------------------------------------------------
2017-08-08 12:18:21.900090 WARNING Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/requests/utils.py", line 868, in check_header_validity
if not pat.match(value):
TypeError: expected string or bytes-like object
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/appdaemon/appdaemon.py", line 1727, in main
ha_config = ha.get_ha_config()
File "/usr/local/lib/python3.6/site-packages/appdaemon/homeassistant.py", line 233, in get_ha_config
r = requests.get(apiurl, headers=headers, verify=conf.certpath)
File "/usr/local/lib/python3.6/site-packages/requests/api.py", line 72, in get
return request('get', url, params=params, **kwargs)
File "/usr/local/lib/python3.6/site-packages/requests/api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 494, in request
prep = self.prepare_request(req)
File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 437, in prepare_request
hooks=merge_hooks(request.hooks, self.hooks),
File "/usr/local/lib/python3.6/site-packages/requests/models.py", line 306, in prepare
self.prepare_headers(headers)
File "/usr/local/lib/python3.6/site-packages/requests/models.py", line 440, in prepare_headers
check_header_validity(header)
File "/usr/local/lib/python3.6/site-packages/requests/utils.py", line 872, in check_header_validity
"not %s" % (value, type(value)))
requests.exceptions.InvalidHeader: Header value 111111 must be of type str or bytes, not <class 'int'>
2017-08-08 12:18:21.900506 WARNING ------------------------------------------------------------
Interestingly where it states near the bottom “Header value 111111” (i’ve changed the number for security) but that’s the ha_key value??? I’ve tried to validate the appdaemon.yaml file and added single quotes around any string data that contains special characters and tried without, and even used an online validator which validated it fine. I’ve then tried the old INI format but when you look in the docker log it doesn’t look like it ever attempts to look for the old style config any more. I’ve exhausted all the possibilities I think could be preventing this from working and now would really appreciate any help somebody can offer. I’m pretty clued up (obviously not enough) so I’m amazed that other’s presumably have this all working fine?
Thank’s if you’ve read this far. Standing on tool stool…Help?