Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tradfri dependencies not installed in docker container #10376

Closed
rubenbe opened this issue Nov 5, 2017 · 13 comments · Fixed by #12662
Closed

Tradfri dependencies not installed in docker container #10376

rubenbe opened this issue Nov 5, 2017 · 13 comments · Fixed by #12662

Comments

@rubenbe
Copy link
Contributor

rubenbe commented Nov 5, 2017

Home Assistant release (hass --version):
0.57.1
docker containter: docker.io/homeassistant/home-assistant 0.57.1 5444bcc80f82

Python release (python3 --version):
Python 3.6.3

Component/platform:
Tradfri

Description of problem:
Starting from the default config, the gateway is discovered, but when trying to configure the security code, I get the backtrace below.

Expected:

Work as expected

Problem-relevant configuration.yaml entries and steps to reproduce:

  1. Empty configuration using docker container
  2. Wait for discovery component to find the gateway (probably reproducible by setting the IP too)
  3. Try to configure the security code
  4. Backtrace fun! ;)

Traceback (if applicable):

2017-11-05 16:18:17 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=configurator, service=configure, service_data=configure_id=140311349316968-1, fields=key=AQT0xbJrkTMgsgEu, service_call_id=140312263957752-4>
2017-11-05 16:18:17 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=140312263957752-4>
2017-11-05 16:18:17 ERROR (MainThread) [homeassistant.components.tradfri] Looks like something isn't installed!
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/components/tradfri.py", line 60, in configuration_callback
    from pytradfri.api.aiocoap_api import APIFactory
  File "/usr/local/lib/python3.6/site-packages/pytradfri/api/aiocoap_api.py", line 6, in <module>
    from aiocoap import Message, Context
ModuleNotFoundError: No module named 'aiocoap'

@rubenbe
Copy link
Contributor Author

rubenbe commented Nov 5, 2017

Manually adding the dependencies fixes the issue:

sudo docker exec <ID> pip install DTLSSocket==0.1.4
sudo docker exec <ID> pip install https://github.com/chrysn/aiocoap/archive/3286f48f0b949901c8b5c04c0719dc54ab63d431.zip

@MartinHjelmare
Copy link
Member

MartinHjelmare commented Nov 5, 2017

I don't know much about docker. Is autoconf apt package available in the container.

@rubenbe
Copy link
Contributor Author

rubenbe commented Nov 5, 2017

I suspect this is introduced by #9875 which comments out the two missing dependencies (the PR contains a discussion wrt these deps)

@MartinHjelmare autoconf is available in the docker container

@MartinHjelmare
Copy link
Member

MartinHjelmare commented Nov 5, 2017

Ahh, yes, I think we should add a docker script back for coap install where it just installs the two tradfri requirements that are commented in requirements_all.txt.

CC @lwis

@lwis
Copy link
Member

lwis commented Nov 5, 2017

@MartinHjelmare yeah, alternatively just install cython and let HA install the dependency itself?

@mbrrg
Copy link
Contributor

mbrrg commented Nov 5, 2017

Duplicate of #10048

@MartinHjelmare
Copy link
Member

MartinHjelmare commented Nov 5, 2017

@lwis I think that's what's failing now. I'm not a docker wiz, but I thought that installing deps during run time doesn't work in docker, and that's why all deps in requirements_all.txt are installed before starting home assistant in docker.

@lwis
Copy link
Member

lwis commented Nov 6, 2017

Ok, I just wanted to avoid us having to maintain those dependency versions.

@jokerigno
Copy link

Tried to install those packages

sudo docker exec <ID> pip install DTLSSocket==0.1.4
sudo docker exec <ID> pip install https://github.com/chrysn/aiocoap/archive/3286f48f0b949901c8b5c04c0719dc54ab63d431.zip

in 0.59 docker without success.

@entilldaniel
Copy link

With the latest tag 0.61 it finally started working again for me.

@BenOoi
Copy link

BenOoi commented Feb 25, 2018

I have the dependency problem running in Docker with version 0.63.3. pytradfri is missing. I noticed the dependencies are located in /config/deps/lib/python3.6/site-packages/, but they are obviously not loaded. I scrolled through the code and found this bit in requirements.py

if not pkg_util.running_under_virtualenv():
        kwargs['target'] = os.path.join(config_dir, 'deps')

Looks like that has to define the /config/deps. Is there something going wrong with the detection of this virtualenv?

For me a workaround to get it to work was running this inside the docker image:

cp -R /config/deps/lib/python3.6/site-packages/* /usr/local/lib/python3.6/site-packages

@MartinHjelmare
Copy link
Member

Docker install is not using a virtual environment. All requirements besides the commented ones are installed before home assistant is started.

I'm not sure if installing requirements during runtime as home assistant normally does works for docker.

@lwis
Copy link
Member

lwis commented Feb 25, 2018

#12662 should close this, pending builds.

@home-assistant home-assistant locked and limited conversation to collaborators May 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants