home-assistant / hassbian-scripts

Scripts used in the Hassbian image.
Other
123 stars 98 forks source link

home-assistant fails to install - pip is too old #269

Closed jasonblewis closed 5 years ago

jasonblewis commented 5 years ago

I installed hassbian from the latest image: https://github.com/home-assistant/pi-gen/releases/tag/v.1.5.0

but then it fails to install home-assistant

root@hassbian:/home/homeassistant# systemctl status install_homeassistant.service 
● install_homeassistant.service - Install Home Assistant
   Loaded: loaded (/etc/systemd/system/install_homeassistant.service; disabled; vendor preset: enabled)
   Active: active (running) since Fri 2019-04-26 07:16:45 AEST; 45s ago
  Process: 2919 ExecStartPre=/usr/local/bin/hassbian-config upgrade hassbian-script (code=exited, status=0/SUCCESS)
 Main PID: 3044 (hassbian-config)
   CGroup: /system.slice/install_homeassistant.service
           ├─3044 /bin/bash /usr/local/bin/hassbian-config install homeassistant --force
           ├─3053 /bin/bash /usr/local/bin/hassbian-config install homeassistant --force
           ├─3054 tee /tmp/hassbian.log
           ├─3056 sudo -u homeassistant -H /bin/bash
           ├─3060 /bin/bash
           └─3172 python3 -m pip install homeassistant

Apr 26 07:16:54 hassbian hassbian-config[3044]: Setting correct premissions
Apr 26 07:16:54 hassbian hassbian-config[3044]: Changing to the homeassistant user
Apr 26 07:16:54 hassbian hassbian-config[3044]: Creating Home Assistant venv
Apr 26 07:17:01 hassbian hassbian-config[3044]: Changing to Home Assistant venv
Apr 26 07:17:01 hassbian hassbian-config[3044]: Installing latest version of Home Assistant
Apr 26 07:17:08 hassbian hassbian-config[3044]: Requirement already satisfied: setuptools in /srv/homeassistant/lib
Apr 26 07:17:08 hassbian hassbian-config[3044]: Requirement already satisfied: wheel in /srv/homeassistant/lib/pyth
Apr 26 07:17:15 hassbian hassbian-config[3044]: Collecting homeassistant
Apr 26 07:17:24 hassbian hassbian-config[3044]:   Using cached https://files.pythonhosted.org/packages/bb/94/dd2d56
Apr 26 07:17:28 hassbian hassbian-config[3044]: Collecting jinja2>=2.10 (from homeassistant)
root@hassbian:/home/homeassistant# journalctl -f -u install_homeassistant.service
-- Logs begin at Thu 2019-04-25 12:05:14 AEST. --
Apr 26 07:17:46 hassbian sudo[3056]: pam_unix(sudo:session): session closed for user homeassistant
Apr 26 07:17:46 hassbian hassbian-config[3044]: Enabling Home Assistant service
Apr 26 07:17:46 hassbian systemd[1]: [/etc/systemd/system/install_homeassistant.service:12] Unknown lvalue 'TimeOutSec' in section 'Service'
Apr 26 07:17:53 hassbian hassbian-config[3044]: Disabling the Home Assistant install script
Apr 26 07:17:53 hassbian systemd[1]: [/etc/systemd/system/install_homeassistant.service:12] Unknown lvalue 'TimeOutSec' in section 'Service'
Apr 26 07:17:53 hassbian systemd[1]: [/etc/systemd/system/install_homeassistant.service:12] Unknown lvalue 'TimeOutSec' in section 'Service'
Apr 26 07:17:53 hassbian hassbian-config[3044]: Starting Home Assistant
Apr 26 07:17:53 hassbian hassbian-config[3044]: Checking the installation...
Apr 26 07:17:53 hassbian hassbian-config[3044]: Installation failed...
Apr 26 07:17:53 hassbian hassbian-config[3044]: If you have issues with this script, please say something in the #devs_hassbian channel on Discord.

The solution seems to be to update pip in the virtual environment - via the forums: https://community.home-assistant.io/t/home-assistant-service-not-starting-on-new-hassbian-install/77869/26

sudo -u homeassistant -H -s
cd /srv/homeassistant
python3 -m venv .
source bin/activate
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
ludeeus commented 5 years ago

Your logs have nothing to do with pip being too old. But a wrong key used in the install service, that has been corrected and will be in an upcoming release. https://github.com/home-assistant/hassbian-scripts/pull/260