Home Assistant Community

Home assistant service not starting on new hassbian install

#21

i get error no have start home assistant, i wait 2 hour:
[email protected]:~ $ sudo systemctl status [email protected]
[email protected] - Home Assistant for homeassistant
Loaded: loaded (/etc/systemd/system/[email protected]; enabled; vendor preset: enabled)
Active: active (running) since Wed 2019-03-20 20:34:21 UTC; 2h 7min ago
Main PID: 491 (hass)
CGroup: /system.slice/system-home\x2dassistant.slice/[email protected]
└─491 /srv/homeassistant/bin/python3 /srv/homeassistant/bin/hass

Mar 20 20:34:59 hassbian hass[491]: timeout=timeout
Mar 20 20:34:59 hassbian hass[491]: File “/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py”, line 643, in urlopen
Mar 20 20:34:59 hassbian hass[491]: _stacktrace=sys.exc_info()[2])
Mar 20 20:34:59 hassbian hass[491]: File “/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/retry.py”, line 315, in increment
Mar 20 20:34:59 hassbian hass[491]: total -= 1
Mar 20 20:34:59 hassbian hass[491]: TypeError: unsupported operand type(s) for -=: ‘Retry’ and ‘int’
Mar 20 20:34:59 hassbian hass[491]: 2019-03-20 20:34:59 ERROR (MainThread) [homeassistant.requirements] Not initializing homeassistant.auth.mfa_modules.totp because cou
Mar 20 20:34:59 hassbian hass[491]: 2019-03-20 20:34:59 ERROR (MainThread) [homeassistant.bootstrap] Home Assistant core failed to initialize. Further initialization ab
Mar 20 20:34:59 hassbian hass[491]: 2019-03-20 20:34:59 INFO (MainThread) [homeassistant.core] Starting Home Assistant
Mar 20 20:34:59 hassbian hass[491]: 2019-03-20 20:34:59 INFO (MainThread) [homeassistant.core] Timer:starting

Please help!

#22

I am getting the same issue with trying to do a clean install using 2018-10-27-Hassbian img

It has been driving me absolutely potty. I have a new SD card (SanDisk) and am also behind a double NAT. I have tried the suggestion by @gpbenton but am getting absolutely nowhere.

[email protected]:~ $ sudo chown homeassistant:homeassistant /srv/homeassistant
[email protected]:~ $ sudo hassbian-config install homeassistant --force
Home Assistant install script for Hassbian.
Copyright© 2017 Fredrik Lindqvist https://github.com/Landrash.

Changing to the homeassistant user
Creating Home Assistant venv
Changing to Home Assistant venv
Installing latest version of Home Assistant
Requirement already satisfied: setuptools in /srv/homeassistant/lib/python3.5/si te-packages
Collecting wheel
Downloading https://files.pythonhosted.org/packages/96/ba/a4702cbb6a3a485239fb e9525443446203f00771af9ac000fa3ef2788201/wheel-0.33.1-py2.py3-none-any.whl
Installing collected packages: wheel
Successfully installed wheel-0.33.1
Collecting homeassistant
Downloading https://files.pythonhosted.org/packages/d2/6d/6ffc1882cc4492ed7f2c 5acb88c6299729f4462c8c86e542c037c659ce36/homeassistant-0.91.4-py3-none-any.whl ( 4.2MB)
Collecting pytz>=2018.07 (from homeassistant)
Downloading https://files.pythonhosted.org/packages/3d/73/fe30c2daaaa0713420d0 382b16fbb761409f532c56bdcc514bf7b6262bb6/pytz-2019.1-py2.py3-none-any.whl (510kB )
Collecting voluptuous-serialize==2.1.0 (from homeassistant)
Exception:
Traceback (most recent call last):
File “/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.w hl/urllib3/connectionpool.py”, line 594, in urlopen
chunked=chunked)
File “/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.w hl/urllib3/connectionpool.py”, line 391, in _make_request
six.raise_from(e, None)
File “”, line 2, in raise_from
File “/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.w hl/urllib3/connectionpool.py”, line 387, in _make_request
httplib_response = conn.getresponse()
File “/usr/lib/python3.5/http/client.py”, line 1198, in getresponse
response.begin()
File “/usr/lib/python3.5/http/client.py”, line 297, in begin
version, status, reason = self._read_status()
File “/usr/lib/python3.5/http/client.py”, line 266, in _read_status
raise RemoteDisconnected(“Remote end closed connection without”
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/pip/basecommand.py”, line 215, in main
status = self.run(options, args)
File “/srv/homeassistant/lib/python3.5/site-packages/pip/commands/install.py”, line 353, in run
wb.build(autobuilding=True)
File “/srv/homeassistant/lib/python3.5/site-packages/pip/wheel.py”, line 749, in build
self.requirement_set.prepare_files(self.finder)
File “/srv/homeassistant/lib/python3.5/site-packages/pip/req/req_set.py”, line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File “/srv/homeassistant/lib/python3.5/site-packages/pip/req/req_set.py”, line 554, in _prepare_file
require_hashes
File “/srv/homeassistant/lib/python3.5/site-packages/pip/req/req_install.py”, line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File “/srv/homeassistant/lib/python3.5/site-packages/pip/index.py”, line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File “/srv/homeassistant/lib/python3.5/site-packages/pip/index.py”, line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File “/srv/homeassistant/lib/python3.5/site-packages/pip/index.py”, line 568, in _get_pages
page = self._get_page(location)
File “/srv/homeassistant/lib/python3.5/site-packages/pip/index.py”, line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File “/srv/homeassistant/lib/python3.5/site-packages/pip/index.py”, line 792, in get_page
“Cache-Control”: “max-age=600”,
File “/srv/homeassistant/share/python-wheels/requests-2.12.4-py2.py3-none-any. whl/requests/sessions.py”, line 501, in get
return self.request(‘GET’, url, **kwargs)
File “/srv/homeassistant/lib/python3.5/site-packages/pip/download.py”, line 38 6, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File “/srv/homeassistant/share/python-wheels/requests-2.12.4-py2.py3-none-any. whl/requests/sessions.py”, line 488, in request
resp = self.send(prep, **send_kwargs)
File “/srv/homeassistant/share/python-wheels/requests-2.12.4-py2.py3-none-any. whl/requests/sessions.py”, line 609, in send
r = adapter.send(request, **kwargs)
File “/srv/homeassistant/share/python-wheels/CacheControl-0.11.7-py2.py3-none- any.whl/cachecontrol/adapter.py”, line 47, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File “/srv/homeassistant/share/python-wheels/requests-2.12.4-py2.py3-none-any. whl/requests/adapters.py”, line 423, in send
timeout=timeout
File “/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.w hl/urllib3/connectionpool.py”, line 643, in urlopen
_stacktrace=sys.exc_info()[2])
File “/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.w hl/urllib3/util/retry.py”, line 315, in increment
total -= 1
TypeError: unsupported operand type(s) for -=: ‘Retry’ and ‘int’
Deactivating virtualenv
Enabling Home Assistant service
Disabling the Home Assistant install script
Starting Home Assistant
Checking the installation…

Installation failed…

If you have issues with this script, please say something in the #devs_hassbian channel on Discord.

#23

Looks like there was a network problem or too much traffic at this time. I would just try again later.

#24

Got the same problem while installing using image_2018-10-27-Hassbian.

http.client.RemoteDisconnected: Remote end closed connection without response

Look like homeassistant installed but not started somehow

systemctl status [email protected]
[email protected] - Home Assistant for homeassistant
   Loaded: loaded (/etc/systemd/system/[email protected]; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2019-04-24 00:45:45 AEST; 1min 3s ago
  Process: 22076 ExecStart=/srv/homeassistant/bin/hass (code=exited, status=203/EXEC)
 Main PID: 22076 (code=exited, status=203/EXEC)

Apr 24 00:45:45 hassbian systemd[1]: Started Home Assistant for homeassistant.
Apr 24 00:45:45 hassbian systemd[1]: [email protected]: Main process exited, code=exited, status=203/EXEC
Apr 24 00:45:45 hassbian systemd[1]: [email protected]: Unit entered failed state.
Apr 24 00:45:45 hassbian systemd[1]: [email protected]: Failed with result 'exit-code'.

Then I worked around this by upgrading homeassistant manually
sudo hassbian-config upgrade homeassistant

The service started successfully after the upgrade.

systemctl status [email protected][email protected] - Home Assistant for homeassistant
   Loaded: loaded (/etc/systemd/system/[email protected]; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2019-04-24 00:57:53 AEST; 2min 18s ago
 Main PID: 22387 (hass)
   CGroup: /system.slice/system-home\x2dassistant.slice/[email protected]
           ├─22387 /srv/homeassistant/bin/python3 /srv/homeassistant/bin/hass
           └─22493 /srv/homeassistant/bin/python3 -m pip install --quiet distro==1.4.0 --upgrade --constraint /srv/homeassistant/lib/python3.5/site-packages/homeassistant/package_constraints.txt

Apr 24 00:59:52 hassbian hass[22387]: 2019-04-24 00:59:52 INFO (MainThread) [homeassistant.setup] Setting up webhook
Apr 24 00:59:52 hassbian hass[22387]: 2019-04-24 00:59:52 INFO (MainThread) [homeassistant.setup] Setup of domain webhook took 0.0 seconds.
Apr 24 00:59:52 hassbian hass[22387]: 2019-04-24 00:59:52 INFO (MainThread) [homeassistant.setup] Setup of domain person took 0.3 seconds.
Apr 24 00:59:52 hassbian hass[22387]: 2019-04-24 00:59:52 ERROR (MainThread) [homeassistant.components.device_tracker] Unable to load /home/homeassistant/.homeassistant/known_devices.yaml: Config file not f
Apr 24 00:59:55 hassbian hass[22387]: 2019-04-24 00:59:55 INFO (MainThread) [homeassistant.setup] Setup of domain device_tracker took 3.0 seconds.
Apr 24 00:59:55 hassbian hass[22387]: 2019-04-24 00:59:55 INFO (MainThread) [homeassistant.setup] Setup of domain config took 3.0 seconds.
Apr 24 00:59:55 hassbian hass[22387]: 2019-04-24 00:59:55 INFO (Thread-21) [homeassistant.util.package] Attempting install of netdisco==2.5.0
Apr 24 01:00:07 hassbian hass[22387]: 2019-04-24 01:00:07 INFO (MainThread) [homeassistant.setup] Setting up discovery
Apr 24 01:00:07 hassbian hass[22387]: 2019-04-24 01:00:07 INFO (MainThread) [homeassistant.setup] Setup of domain discovery took 0.1 seconds.
Apr 24 01:00:07 hassbian hass[22387]: 2019-04-24 01:00:07 INFO (Thread-15) [homeassistant.util.package] Attempting install of distro==1.4.0
#25

I have just given this a whirl but am getting the same thing…

[email protected]:~ $ sudo hassbian-config upgrade homeassistant
Home Assistant install script for Hassbian.
Copyright© 2017 Fredrik Lindqvist https://github.com/Landrash.

Checking current version
Changing to the homeassistant user
Changing to Home Assistant venv
Upgrading Home Assistant
Requirement already up-to-date: setuptools in /srv/homeassistant/lib/python3.5/s ite-packages
Requirement already up-to-date: wheel in /srv/homeassistant/lib/python3.5/site-p ackages
Collecting homeassistant==0.91.4
Using cached https://files.pythonhosted.org/packages/d2/6d/6ffc1882cc4492ed7f2c5acb88c6299729f4462c8c86e542c037c659ce36/homeassistant-0.91.4-py3-none-any.whl
Collecting pytz>=2018.07 (from homeassistant==0.91.4)
Downloading https://files.pythonhosted.org/packages/3d/73/fe30c2daaaa0713420d0382b16fbb761409f532c56bdcc514bf7b6262bb6/pytz-2019.1-py2.py3-none-any.whl (510kB)
Collecting aiohttp==3.5.4 (from homeassistant==0.91.4)
Downloading https://www.piwheels.org/simple/aiohttp/aiohttp-3.5.4-cp35-cp35m-linux_armv7l.whl (1.1MB)
Collecting astral==1.10.1 (from homeassistant==0.91.4)
Using cached https://files.pythonhosted.org/packages/ff/5d/261f49822b7f77c265197d46cdbaaaaf06f458734e9ac55a140dd75bdf29/astral-1.10.1-py2.py3-none-any.whl
Collecting pip>=8.0.3 (from homeassistant==0.91.4)
Downloading https://files.pythonhosted.org/packages/d8/f3/413bab4ff08e1fc4828dfc59996d721917df8e8583ea85385d51125dceff/pip-19.0.3-py2.py3-none-any.whl (1.4MB)
Collecting PyJWT==1.6.4 (from homeassistant==0.91.4)
Downloading https://files.pythonhosted.org/packages/93/d1/3378cc8184a6524dc92993090ee8b4c03847c567e298305d6cf86987e005/PyJWT-1.6.4-py2.py3-none-any.whl
Collecting voluptuous-serialize==2.1.0 (from homeassistant==0.91.4)
Downloading https://www.piwheels.org/simple/voluptuous-serialize/voluptuous_serialize-2.1.0-py3-none-any.whl
Collecting async-timeout==3.0.1 (from homeassistant==0.91.4)
Downloading https://files.pythonhosted.org/packages/e1/1e/5a4441be21b0726c4464f3f23c8b19628372f606755a9d2e46c187e65ec4/async_timeout-3.0.1-py3-none-any.whl
Collecting certifi>=2018.04.16 (from homeassistant==0.91.4)
Downloading https://files.pythonhosted.org/packages/60/75/f692a584e85b7eaba0e03827b3d51f45f571c2e793dd731e598828d380aa/certifi-2019.3.9-py2.py3-none-any.whl (158kB)
Collecting python-slugify==1.2.6 (from homeassistant==0.91.4)
Downloading https://www.piwheels.org/simple/python-slugify/python_slugify-1.2.6-py2.py3-none-any.whl
Collecting requests==2.21.0 (from homeassistant==0.91.4)
Downloading https://files.pythonhosted.org/packages/7d/e3/20f3d364d6c8e5d2353c72a67778eb189176f08e873c9900e10c0287b84b/requests-2.21.0-py2.py3-none-any.whl (57kB)
Collecting ruamel.yaml==0.15.89 (from homeassistant==0.91.4)
Downloading https://files.pythonhosted.org/packages/89/a9/1b4f0b97cd19162b3b95bf9622e5cd8419dbd8d4f8cfab4be17a2babe074/ruamel.yaml-0.15.89.tar.gz (306kB)
Collecting voluptuous==0.11.5 (from homeassistant==0.91.4)
Downloading https://files.pythonhosted.org/packages/59/95/fa6218477c6999c9b7fdfab7c12c1bd4da2d5930f5eb2b232ec74eb344e7/voluptuous-0.11.5-py2.py3-none-any.whl
Collecting cryptography==2.5 (from homeassistant==0.91.4)
Using cached https://www.piwheels.org/simple/cryptography/cryptography-2.5-cp35-cp35m-linux_armv7l.whl
Collecting jinja2>=2.10 (from homeassistant==0.91.4)
Exception:
Traceback (most recent call last):
File “/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py”, line 594, in urlopen
chunked=chunked)
File “/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py”, line 391, in _make_request
six.raise_from(e, None)
File “”, line 2, in raise_from
File “/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py”, line 387, in _make_request
httplib_response = conn.getresponse()
File “/usr/lib/python3.5/http/client.py”, line 1198, in getresponse
response.begin()
File “/usr/lib/python3.5/http/client.py”, line 297, in begin
version, status, reason = self._read_status()
File “/usr/lib/python3.5/http/client.py”, line 266, in _read_status
raise RemoteDisconnected(“Remote end closed connection without”
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/pip/basecommand.py”, line 215, in main
status = self.run(options, args)
File “/srv/homeassistant/lib/python3.5/site-packages/pip/commands/install.py”, line 353, in run
wb.build(autobuilding=True)
File “/srv/homeassistant/lib/python3.5/site-packages/pip/wheel.py”, line 749, in build
self.requirement_set.prepare_files(self.finder)
File “/srv/homeassistant/lib/python3.5/site-packages/pip/req/req_set.py”, line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File “/srv/homeassistant/lib/python3.5/site-packages/pip/req/req_set.py”, line 554, in _prepare_file
require_hashes
File “/srv/homeassistant/lib/python3.5/site-packages/pip/req/req_install.py”, line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File “/srv/homeassistant/lib/python3.5/site-packages/pip/index.py”, line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File “/srv/homeassistant/lib/python3.5/site-packages/pip/index.py”, line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File “/srv/homeassistant/lib/python3.5/site-packages/pip/index.py”, line 568, in _get_pages
page = self._get_page(location)
File “/srv/homeassistant/lib/python3.5/site-packages/pip/index.py”, line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File “/srv/homeassistant/lib/python3.5/site-packages/pip/index.py”, line 792, in get_page
“Cache-Control”: “max-age=600”,
File “/srv/homeassistant/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py”, line 501, in get
return self.request(‘GET’, url, **kwargs)
File “/srv/homeassistant/lib/python3.5/site-packages/pip/download.py”, line 386, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File “/srv/homeassistant/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py”, line 488, in request
resp = self.send(prep, **send_kwargs)
File “/srv/homeassistant/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py”, line 609, in send
r = adapter.send(request, **kwargs)
File “/srv/homeassistant/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py”, line 47, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File “/srv/homeassistant/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/adapters.py”, line 423, in send
timeout=timeout
File “/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py”, line 643, in urlopen
_stacktrace=sys.exc_info()[2])
File “/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/retry.py”, line 315, in increment
total -= 1
TypeError: unsupported operand type(s) for -=: ‘Retry’ and ‘int’
Deactivating virtualenv
cat: /home/homeassistant/.homeassistant/.HA_VERSION: No such file or directory
/bin/bash: line 2: hass: command not found
Restarting Home Assistant
Checking the installation…

Upgrade failed…

If you have issues with this script, please say something in the #devs_hassbian channel on Discord.

Is there any way to test this theory? Is it something elsewhere? I have been trying to get a fresh install up and running for about two days. I am nearly all out of ideas.

I have also tried the 2019 img. Which I did get up and runnning, but that version is having issues with the mosquitto hassbian-script.

#26

A genius called @ludeeus helped on discord.

Needed to activate the virtual environment and reinstall the latest pip.

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

It upgraded from v 9.0.1 to 19.1

4 Likes
#27

i had the same issue - this fixed it for me!
thx @ludeeus

#28

I’m not sure where this board falls on the profanity rules (Reddit vs Stack Exchange) but @ludeeus you are the mutha effing man! Manually updating PIP fixed the issues I was having getting Home Assistant running on my Pi Zero. I’m not sure if my initial problems were caused by the fact that I ONLY have wireless on it (nothing downloaded after having it up on the network for over a day, even though I had the wpa_supplicant.conf setup and it was online almost immediately after first boot.) After several failed attempts to force install_homeassistant.service, I went ahead and did the manual venv setup and it choked when trying to install aiohttp_cors. Somehow DuckDuck led me here, to you, you brilliant man.

Looks like it even automagically found some of my stuff just during the first boot.

Now I’m off to add the rest.

#29

I want to report that I have the same exact issue with the 2019-04-14 image using Etcher on a Rpi 3b. Fixing permission and force install is the solution but this just didn’t work out of the box which is what it should be.

#30

This work for me. Active the homeassistant.service => The front-end can be accessed.

#31

Thanks. Upgrading pip also helped me solving this same problem on raspberry pi installation