Just migrated my setup to a new machine running Ubuntu. I installed the Docker Image 0.45 and everything except speedtest is running perfectly (Also ZWave). My previous installation was a AIO installation.
Before moving to a Docker installation SpeedTest was working fine, and I have not changed my configuration files, but now I get the below error.
Error is: 2017-05-22 21:30:00 ERROR (<concurrent.futures.thread.ThreadPoolExecutor object at 0x7f189cc95ac8>_1) [homeassistant.components.sensor.speedtest] Error executing speedtest: Command '['/usr/local/bin/python', '/usr/local/lib/python3.6/site-packages/speedtest.py', '--simple', '--server', '5669']' returned non-zero exit status 1.
Try to run /usr/local/bin/python /usr/local/lib/python3.6/site-packages/speedtest.py --server 5669 from inside your docker container.
Not giving the --simple argument should give you more information about what’s the error. (see here for more information).
To connect to the docker, use this: docker exec -it CONTAINER-NAME bash
While you’re at it, try to run /usr/local/bin/python --version from inside the container to see if the python command is associated with Python 3.6 (or 3.6.1)
The speed test python library that HA uses is only compatible with python 2.6-3.5 so that is why it is complaining. Not sure how to fix but I’ve asked in the dev chat.
# /usr/local/bin/python /usr/local/lib/python3.6/site-packages/speedtest.py --server 5669
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/speedtest.py", line 19, in <module>
import re
File "/usr/local/lib/python3.6/re.py", line 142, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
So after some googling it looks like the issue is an incompatibility with the enum34 library and python 3.6. Here is what I did to fix my issue, however it may break other things so please use at your own risk! So I connected to my docker container using toullloup’s instructions: docker exec -it CONTAINER-NAME bash
After connecting, run pip freeze
see that enum34==1.1.6 or similar is in the dependencies list pip uninstall enum34
restart the docker container. This fixed my issue, however removing dependencies like this can have unintended consequences, so be careful. I will try to spend some more time this week looking into this to see if I can suggest a long term fix for the docker image for future releases, but don’t know enough about how HA works under the hood for that yet. Hope this helps!
I haven’t had any issues yet as well. It’s strange that @touliloup did not have the dependency, I don’t know enough about how docker works to understand that, but it would seem that the dependency is not necessary and is just left over from previous versions.
I’ve created my own Docker container, I don’t like the main docker container. It just install too much dependencies and unnecessary script/fix (for me).
My Docker container simply proceed to a standard installation of home-assistant.
Here is the Dockerfile I use:
FROM python:3.6
MAINTAINER Touli Loup <[email protected]>
VOLUME /config
RUN python3 --version
RUN echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list
RUN apt-get update && apt-get upgrade -y && apt-get install -y net-tools nmap git && apt-get install -y certbot -t jessie-backports
RUN pip3 install --upgrade mysqlclient
RUN pip3 install netdisco==1.0.0rc3
RUN pip3 install --upgrade homeassistant
COPY ./docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
Yes, I guess it’s a transitive dependency as there is no direct reference to it in the github repo.
And why does the github docker always install every dependencies? The missing one will be installed by hass on startup, no?
I understand the point if it’s only a development container, it allow to detect dependencies conflict faster, but it’s not appropriate for production usage.