Help installing HASS on Freenas 11 FreeBSD Jail

I followed this guide other than the ZWave stuff: HASS virtualenv in jail on FreeNAS 11 with auto-start and zwave

I have gotten so far as to where I can launch HASS and connect to its web interface but it seems to have issues installing any dependencies, thus Discovery is not working, and I edited my config file to enable Wemo and it gives me the same errors.

Here is the log generated from the web interface:

2017-09-05 11:58:51 WARNING (MainThread) [homeassistant.setup] Setup of sensor is taking over 10 seconds. 2017-09-05 11:58:52 ERROR (Thread-7) [homeassistant.util.package] Unable to install package netdisco==1.1.0: Command "/srv/homeassistant/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/var/tmp/pip-build-um_ffcjo/netifaces/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/tmp/pip-c6t5tqzy-record/install-record.txt --single-version-externally-managed --compile --install-headers /srv/homeassistant/include/site/python3.5/netifaces" failed with error code 1 in /var/tmp/pip-build-um_ffcjo/netifaces/ 2017-09-05 11:58:52 ERROR (MainThread) [homeassistant.setup] Not initializing discovery because could not install dependency netdisco==1.1.0 2017-09-05 11:58:52 ERROR (MainThread) [homeassistant.setup] Setup failed for discovery: Could not install all requirements. 2017-09-05 11:59:02 WARNING (MainThread) [homeassistant.setup] Setup of tts is taking over 10 seconds. 2017-09-05 11:59:02 ERROR (Thread-18) [homeassistant.util.package] Unable to install package pywemo==0.4.19: Command "/srv/homeassistant/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/var/tmp/pip-build-3hgnhnyl/netifaces/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/tmp/pip-ouq17ui8-record/install-record.txt --single-version-externally-managed --compile --install-headers /srv/homeassistant/include/site/python3.5/netifaces" failed with error code 1 in /var/tmp/pip-build-3hgnhnyl/netifaces/ 2017-09-05 11:59:02 ERROR (MainThread) [homeassistant.setup] Not initializing wemo because could not install dependency pywemo==0.4.19 2017-09-05 11:59:02 ERROR (MainThread) [homeassistant.setup] Setup failed for wemo: Could not install all requirements.

I am unsure where the error falls, I imagine its permissions/dependencies along with the fact I am working in a virutalenv

I am not too bad with Linux/FreeBSD and have done a lot of manual jail setup via SSH but this is my first endeavor into using python and virtualenv’s as well as creating new users/groups within those environments.

I have tried to add root to the homeassistant group and homeassistant to the wheel group and other such things to see if it was permissions based, no luck so far.

does anybody have ideas?

If I try to manually install here is what I get I think this will help:

Collecting netdisco
  Downloading netdisco-1.1.0-py2.py3-none-any.whl
Collecting zeroconf==0.19 (from netdisco)
  Downloading zeroconf-0.19.0-py2.py3-none-any.whl
Requirement already satisfied: requests>=2.0 in /usr/local/lib/python3.5/site-packages (from netdisco)
Collecting netifaces<=0.10.4 (from zeroconf==0.19->netdisco)
  Downloading netifaces-0.10.4.tar.gz
Collecting six (from zeroconf==0.19->netdisco)
  Downloading six-1.10.0-py2.py3-none-any.whl
Collecting enum-compat (from zeroconf==0.19->netdisco)
  Downloading enum-compat-0.0.2.tar.gz
Installing collected packages: netifaces, six, enum-compat, zeroconf, netdisco
  Running setup.py install for netifaces ... error
    Complete output from command /usr/local/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-a0c9ctxu/netifaces/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-xgyn_buy-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    checking for getifaddrs...found.
    checking for getnameinfo...not found.
    checking for optional header files...net/if_dl.h.
    checking whether struct sockaddr has a length field...yes.
    checking for routing socket support...yes.
    checking for sysctl(CTL_NET...) support...yes.
    checking for netlink support...no.
    will use sysctl() to read routing table
    building 'netifaces' extension
    cc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fPIC -DNETIFACES_VERSION=0.10.4 -DHAVE_GETIFADDRS=1 -DHAVE_NET_IF_DL_H=1 -DHAVE_SOCKADDR_SA_LEN=1 -DHAVE_PF_ROUTE=1 -DHAVE_SYSCTL_CTL_NET=1 -I/usr/local/include/python3.5m -c netifaces.c -o build/temp.freebsd-11.0-STABLE-amd64-3.5/netifaces.o
    c++: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
    netifaces.c:333:13: error: assigning to 'struct sockaddr *' from incompatible type 'void *'
        bigaddr = calloc(1, gnilen);
                ^ ~~~~~~~~~~~~~~~~~
    netifaces.c:390:16: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
        if (buflen < 3 * len)
            ~~~~~~ ^ ~~~~~~~
    netifaces.c:1730:9: error: assigning to 'char *' from incompatible type 'void *'
        ptr = realloc(buffer, len);
            ^ ~~~~~~~~~~~~~~~~~~~~
    netifaces.c:1816:21: error: cannot initialize a variable of type 'PyObject *' (aka '_object *') with an rvalue of type 'Py_ssize_t' (aka 'long')
              PyObject *isdefault = Py_INCREF(Py_True);
                        ^           ~~~~~~~~~~~~~~~~~~
    1 warning and 3 errors generated.
    error: command 'cc' failed with exit status 1

    ----------------------------------------
Command "/usr/local/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-a0c9ctxu/netifaces/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-xgyn_buy-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-a0c9ctxu/netifaces/```

Maybe below link has hint? Can’t help much with Freenas jails…tried for a while but docker/debian much easier for me

Freenas 11 supports docker does it not?
Would a HASS docker install be easier?
IIRC jails are heading towards obsolescence.

docker is dead simple once you understand basics.

  1. create location for VM storage on HOSTt; i.e. /srv/raid/docker/homeassistant/config
  2. after install docker on HOST, create the docker VM
    docker create --restart=always -p 8123:8123 -v /srv/raid/docker/homeassistant/config:/config --name=hass_Version# homeassistant/homeassistant:Version#

3.start the Docker VM from command line or if there is GUI use that.

-p 8123:8123
this means HOST Port 8123 will be used for VM port 8123
you need only define ports for incoming connections…outgoing traffic just works

-v is similar to port telling that Host folder /srv…/config will be VM folder /config
this is persistent data that you want saved. Anything not defined is basically wiped at Container Restart

That is basically it.
Define incoming ports
Define storage
RUN

zwave and all other components are included. Just need to add into config.yaml
upgrade is as easy as “docker stop hass_version” and run above commands with new version numbers. Delete old container or keep it in case of errors after upgrade.

Just one thing to add is to also delete the old images.
HA images are 1+ Gb.
You can install portainer which is a very easy lightweight docker web UI.
Easily allows to delete stopped containers and old images:

docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer

more here:

Have a look at cockpit
It is lightweight manage console with docker UI(good for monitoring,stop,start,delete and log check…not build)

EDIT: Ignore…I forgot this was freenas

Freenas 10 had native docker, freenas 11 currently does not. People that use them/like them are building linux vm’s and then doing docker inside of that.

I hate adding extra layers of complexity but being that the jail is not working for me, I will look into it.

If I am already going to do a Linux VM I may as well just sort of do the native linux install of HASS IMO, but if there are any solid reasons to also add the docker layer inside the VM I would be willing to entertain it.

I’m running freenas (9.x) in a VM on ESXi, so I have the option to create other VMs in parallel.
I held off from updating to freenas 11 due to the debacle with v10/coral.
Do you think it’s currently worth upgrading from 9.x to 10?

No, 10 is considered a failure 11 is what you would/should upgrade too if you have any reason to do so.
If 9x is working fine and doing all you need you have no real reason to upgrade.

It was a typo in my post. I meant 9 to 11 :slight_smile:
Yeah v10 really was a massive failure. I wonder how many people deserted (or were put off adopting) the platform after that?

I think I will hold off upgrade until 11.1 when the docker and UI overhaul comes.

I love my FreeNAS jails.
One thing is if you migrated to 11 and created a new jail using IOCAGE - I’ve found they often don’t create a working resolv.conf file in the jail for some reason.
In the jail in question

ee /etc/resolv.conf

And for a generic google dns lookup,

nameserver 8.8.8.8
nameserver 8.8.4.4

Press ESCAPE then enter to end, enter to save, and that’s all, you don’t even have to reboot.