Fed up, 4th wrecked sd card


#1

The longest time I had HA running on my raspberry pi 3b was 2 months. After that all kinds op problems started resulting in lost history and f*cked up sd cards.
The raspberry pi was used for over a year for another project, no problems and no wrecked sd cards.

I tried HA in all different ways. The latest 4 installations were all hassio .
The longest run I had with hassio was 8 days. The last time the os was still reachable but the application does not work anymore.
Using good quality 32Gb sd cards
Today I tried to upgrade to hassio 85.1, system became unresponsive and is no longer working. And another wrecked card as a result.
When I reboot the PI I can see that the supervisor starts, I can reach it at :22222 and can login. But the application does not run.
os info gives me: Get http://hassio/hassoss/info: dial tcp 172.30.32.2:80: connect: connection refused

When will there be a reliable version of hassio?


I give up, just is not worth the time and effort
#2

It is most probably a result of the number of entities you have and how their history is written to the database. You indicated that you had another project running on a pi for over a year, that doesn’t mean much if that app doesn’t write to the SD card constantly like HA does. If you want a reliable home Assistant rpi your best bet would be to disable history and recording or offload those functions to another full fledged system. You could also look in to getting a raspberry pi hard drive. The Western digital pi drive.


I give up, just is not worth the time and effort
#3

look at switching to a flash drive or even a powered usb hard drive…


#4

Doing

journalctl -fu hassos-supervisor

Jan 16 18:00:08 hassio hassos-supervisor[11018]: 19-01-16 18:00:08 ERROR (MainThread) [asyncio] Unclosed client session
Jan 16 18:00:08 hassio hassos-supervisor[11018]: client_session: <aiohttp.client.ClientSession object at 0x750762f0>
Jan 16 18:00:08 hassio hassos-supervisor[11018]: 19-01-16 18:00:08 ERROR (MainThread) [asyncio] Unclosed client session
Jan 16 18:00:08 hassio hassos-supervisor[11018]: client_session: <aiohttp.client.ClientSession object at 0x75076410>
Jan 16 18:00:11 hassio hassos-supervisor[11018]: hassos_supervisor
Jan 16 18:00:19 hassio hassos-supervisor[11018]: 19-01-16 18:00:19 INFO (MainThread) [main] Initialize Hass.io setup
Jan 16 18:00:20 hassio hassos-supervisor[11018]: 19-01-16 18:00:20 INFO (MainThread) [main] Setup HassIO
Jan 16 18:00:20 hassio hassos-supervisor[11018]: 19-01-16 18:00:20 INFO (SyncWorker_0) [hassio.docker.supervisor] Attach to Supervisor homeassistant/armhf-hassio-supervisor with version 142
Jan 16 18:00:21 hassio hassos-supervisor[11018]: 19-01-16 18:00:21 INFO (MainThread) [hassio.utils.gdbus] Introspect org.freedesktop.systemd1 on /org/freedesktop/systemd1
Jan 16 18:00:21 hassio hassos-supervisor[11018]: 19-01-16 18:00:21 INFO (MainThread) [hassio.utils.gdbus] Connect to dbus: org.freedesktop.systemd1 - /org/freedesktop/systemd1
Jan 16 18:00:21 hassio hassos-supervisor[11018]: 19-01-16 18:00:21 INFO (MainThread) [hassio.utils.gdbus] Introspect org.freedesktop.hostname1 on /org/freedesktop/hostname1
Jan 16 18:00:21 hassio hassos-supervisor[11018]: 19-01-16 18:00:21 INFO (MainThread) [hassio.utils.gdbus] Connect to dbus: org.freedesktop.hostname1 - /org/freedesktop/hostname1
Jan 16 18:00:21 hassio hassos-supervisor[11018]: 19-01-16 18:00:21 INFO (MainThread) [hassio.utils.gdbus] Introspect de.pengutronix.rauc on /
Jan 16 18:00:21 hassio hassos-supervisor[11018]: 19-01-16 18:00:21 INFO (MainThread) [hassio.utils.gdbus] Connect to dbus: de.pengutronix.rauc - /
Jan 16 18:00:21 hassio hassos-supervisor[11018]: 19-01-16 18:00:21 INFO (MainThread) [hassio.host.info] Update local host information
Jan 16 18:00:21 hassio hassos-supervisor[11018]: 19-01-16 18:00:21 INFO (MainThread) [hassio.utils.gdbus] Call org.freedesktop.DBus.Properties.GetAll on /org/freedesktop/hostname1
Jan 16 18:00:22 hassio hassos-supervisor[11018]: 19-01-16 18:00:22 INFO (MainThread) [hassio.host.services] Update service information
Jan 16 18:00:22 hassio hassos-supervisor[11018]: 19-01-16 18:00:22 INFO (MainThread) [hassio.utils.gdbus] Call org.freedesktop.systemd1.Manager.ListUnits on /org/freedesktop/systemd1
Jan 16 18:00:22 hassio hassos-supervisor[11018]: 19-01-16 18:00:22 INFO (MainThread) [hassio.host.apparmor] Load AppArmor Profiles: {‘hassio-supervisor’}
Jan 16 18:00:22 hassio hassos-supervisor[11018]: 19-01-16 18:00:22 INFO (MainThread) [hassio.host.services] Reload local service hassos-apparmor.service
Jan 16 18:00:22 hassio hassos-supervisor[11018]: 19-01-16 18:00:22 INFO (MainThread) [hassio.utils.gdbus] Call org.freedesktop.systemd1.Manager.ReloadOrRestartUnit on /org/freedesktop/systemd1
Jan 16 18:00:22 hassio hassos-supervisor[11018]: 19-01-16 18:00:22 INFO (MainThread) [hassio.hassos] Detect HassOS 1.13 on host system
Jan 16 18:00:22 hassio hassos-supervisor[11018]: 19-01-16 18:00:22 INFO (SyncWorker_1) [hassio.docker.hassos_cli] Found HassOS CLI homeassistant/armhf-hassio-cli with version 8
Jan 16 18:00:22 hassio hassos-supervisor[11018]: 19-01-16 18:00:22 INFO (SyncWorker_0) [hassio.docker.interface] Attach to image homeassistant/raspberrypi3-homeassistant with version 0.85.1
Jan 16 18:00:23 hassio hassos-supervisor[11018]: Traceback (most recent call last):
Jan 16 18:00:23 hassio hassos-supervisor[11018]: File “/usr/local/lib/python3.7/runpy.py”, line 193, in _run_module_as_main
Jan 16 18:00:23 hassio hassos-supervisor[11018]: “main”, mod_spec)
Jan 16 18:00:23 hassio hassos-supervisor[11018]: File “/usr/local/lib/python3.7/runpy.py”, line 85, in _run_code
Jan 16 18:00:23 hassio hassos-supervisor[11018]: exec(code, run_globals)
Jan 16 18:00:23 hassio hassos-supervisor[11018]: File “/usr/local/lib/python3.7/site-packages/hassio/main.py”, line 40, in
Jan 16 18:00:23 hassio hassos-supervisor[11018]: loop.run_until_complete(coresys.core.setup())
Jan 16 18:00:23 hassio hassos-supervisor[11018]: File “uvloop/loop.pyx”, line 1446, in uvloop.loop.Loop.run_until_complete
Jan 16 18:00:23 hassio hassos-supervisor[11018]: File “/usr/local/lib/python3.7/site-packages/hassio/core.py”, line 41, in setup
Jan 16 18:00:23 hassio hassos-supervisor[11018]: await self.sys_addons.load()
Jan 16 18:00:23 hassio hassos-supervisor[11018]: File “/usr/local/lib/python3.7/site-packages/hassio/addons/init.py”, line 55, in load
Jan 16 18:00:23 hassio hassos-supervisor[11018]: self.data.reload()
Jan 16 18:00:23 hassio hassos-supervisor[11018]: File “/usr/local/lib/python3.7/site-packages/hassio/addons/data.py”, line 70, in reload
Jan 16 18:00:23 hassio hassos-supervisor[11018]: self._read_git_repository(repository_element)
Jan 16 18:00:23 hassio hassos-supervisor[11018]: File “/usr/local/lib/python3.7/site-packages/hassio/addons/data.py”, line 94, in _read_git_repository
Jan 16 18:00:23 hassio hassos-supervisor[11018]: self._read_addons_folder(path, slug)
Jan 16 18:00:23 hassio hassos-supervisor[11018]: File “/usr/local/lib/python3.7/site-packages/hassio/addons/data.py”, line 100, in _read_addons_folder
Jan 16 18:00:23 hassio hassos-supervisor[11018]: addon_config = read_json_file(addon)
Jan 16 18:00:23 hassio hassos-supervisor[11018]: File “/usr/local/lib/python3.7/site-packages/hassio/utils/json.py”, line 21, in read_json_file
Jan 16 18:00:23 hassio hassos-supervisor[11018]: return json.loads(cfile.read())
Jan 16 18:00:23 hassio hassos-supervisor[11018]: File “/usr/local/lib/python3.7/codecs.py”, line 322, in decode
Jan 16 18:00:23 hassio hassos-supervisor[11018]: (result, consumed) = self._buffer_decode(data, self.errors, final)
Jan 16 18:00:23 hassio hassos-supervisor[11018]: UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xff in position 0: invalid start byte
Jan 16 18:00:23 hassio hassos-supervisor[11018]: 19-01-16 18:00:23 ERROR (MainThread) [asyncio] Unclosed client session
Jan 16 18:00:23 hassio hassos-supervisor[11018]: client_session: <aiohttp.client.ClientSession object at 0x750b7390>
Jan 16 18:00:23 hassio hassos-supervisor[11018]: 19-01-16 18:00:23 ERROR (MainThread) [asyncio] Unclosed client session
Jan 16 18:00:23 hassio hassos-supervisor[11018]: client_session: <aiohttp.client.ClientSession object at 0x750b7490>

So it seems it is an unclosed session. But what is the fix?


#5

It is silly to not use the history functions. Kinda defeats the purpose of me monitoring dsmr and the Nefit thermostat.
32Gb should be plenty of room to let the sd-card ‘self-heal’.
Will be hooking up a ssd card to the pi soon, that was in the works already.


#6
/usr/sbin # systemctl status hassos-supervisor

● hassos-supervisor.service - HassOS supervisor
Loaded: loaded (/usr/lib/systemd/system/hassos-supervisor.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2019-01-16 18:15:48 UTC; 28s ago
Process: 23333 ExecStartPre=/usr/bin/docker stop hassos_supervisor (code=exited, status=0/SUCCESS)
Main PID: 23342 (hassos-supervis)
Tasks: 13 (limit: 2201)
CGroup: /system.slice/hassos-supervisor.service
├─23342 /bin/sh /usr/sbin/hassos-supervisor
└─23582 docker run --name hassos_supervisor --security-opt apparmor=hassio-supervisor -v /var/run/docker.sock:/var/run/docker.sock -v /var/run/dbus:/var/run/dbus -v /etc/machine-id:/etc/machine-id:ro -v /mnt/data/supervisor:/data -e SUPERVISOR_SHARE=/mnt/data/supervisor -e SUPERVISOR_NAME=hassos_supervisor -e HOMEASSISTANT_REPOSITORY=homeassistant/raspberrypi3-homeassistant homeassistant/armhf-hassio-supervisor

Jan 16 18:16:14 hassio hassos-supervisor[23342]: addon_config = read_json_file(addon)
Jan 16 18:16:14 hassio hassos-supervisor[23342]: File “/usr/local/lib/python3.7/site-packages/hassio/utils/json.py”, line 21, in read_json_file
Jan 16 18:16:14 hassio hassos-supervisor[23342]: return json.loads(cfile.read())
Jan 16 18:16:14 hassio hassos-supervisor[23342]: File “/usr/local/lib/python3.7/codecs.py”, line 322, in decode
Jan 16 18:16:14 hassio hassos-supervisor[23342]: (result, consumed) = self._buffer_decode(data, self.errors, final)
Jan 16 18:16:14 hassio hassos-supervisor[23342]: UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xff in position 0: invalid start byte
Jan 16 18:16:14 hassio hassos-supervisor[23342]: 19-01-16 18:16:14 ERROR (MainThread) [asyncio] Unclosed client session
Jan 16 18:16:14 hassio hassos-supervisor[23342]: client_session: <aiohttp.client.ClientSession object at 0x7510f270>
Jan 16 18:16:14 hassio hassos-supervisor[23342]: 19-01-16 18:16:14 ERROR (MainThread) [asyncio] Unclosed client session
Jan 16 18:16:14 hassio hassos-supervisor[23342]: client_session: <aiohttp.client.ClientSession object at 0x7510f390>