After 10 minutes hass killed - NameError: name 'sys' is not defined

Hi all,

Hfter 10 minutes hass killed, i have this log:
17-03-22 08:40:07 ERROR (MainThread) [homeassistant.components.sensor] Error while update entity from systemmonitor in sensor
Traceback (most recent call last):
File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py”, line 428, in _update_entity_states
yield from update_coro
File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity.py”, line 207, in async_update_ha_state
yield from self.hass.loop.run_in_executor(None, self.update)
File “/usr/lib/python3.4/asyncio/futures.py”, line 388, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.4/asyncio/tasks.py”, line 286, in _wakeup
value = future.result()
File “/usr/lib/python3.4/asyncio/futures.py”, line 277, in result
raise self._exception
File “/usr/lib/python3.4/concurrent/futures/thread.py”, line 54, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/sensor/systemmonitor.py”, line 170, in update
psutil.boot_time())
File “/home/homeassistant/.homeassistant/deps/psutil/init.py”, line 2264, in boot_time
return _psplatform.boot_time()
File “/home/homeassistant/.homeassistant/deps/psutil/_pslinux.py”, line 1226, in boot_time
with open_binary(’%s/stat’ % get_procfs_path()) as f:
File “/home/homeassistant/.homeassistant/deps/psutil/_pslinux.py”, line 214, in get_procfs_path
return sys.modules[‘psutil’].PROCFS_PATH
NameError: name ‘sys’ is not defined
17-03-22 08:40:07 ERROR (MainThread) [homeassistant.components.sensor] Error while update entity from systemmonitor in sensor
Traceback (most recent call last):
File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py”, line 428, in _update_entity_states
yield from update_coro
File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity.py”, line 207, in async_update_ha_state
yield from self.hass.loop.run_in_executor(None, self.update)
File “/usr/lib/python3.4/asyncio/futures.py”, line 388, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.4/asyncio/tasks.py”, line 286, in _wakeup
value = future.result()
File “/usr/lib/python3.4/asyncio/futures.py”, line 277, in result
raise self._exception
File “/usr/lib/python3.4/concurrent/futures/thread.py”, line 54, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/sensor/systemmonitor.py”, line 125, in update
self._state = psutil.virtual_memory().percent
File “/home/homeassistant/.homeassistant/deps/psutil/init.py”, line 1985, in virtual_memory
ret = _psplatform.virtual_memory()
File “/home/homeassistant/.homeassistant/deps/psutil/_pslinux.py”, line 386, in virtual_memory
with open_binary(’%s/meminfo’ % get_procfs_path()) as f:
File “/home/homeassistant/.homeassistant/deps/psutil/_pslinux.py”, line 214, in get_procfs_path
return sys.modules[‘psutil’].PROCFS_PATH
NameError: name ‘sys’ is not defined

can you help me ?

A quick workaround probably would be to disable the systemmonitor sensor you have. There seems to be some problem with the dependency, so removing that sensor should keep your HASS running.

Same Problem :frowning:
Mar 26 03:00:59 RaspiCucina systemd[1]: home-assistant.service: main process exited, code=killed, status=11/SEGV
Mar 26 03:00:59 RaspiCucina systemd[1]: Unit home-assistant.service entered failed state.