Home Assistant crashing since upgrading to DietPi v8.12.1 and HA 2022.12.8

Creating a bug report/issue

Required Information

  • DietPi version | cat /boot/dietpi/.version

G_DIETPI_VERSION_CORE=8

G_DIETPI_VERSION_SUB=12

G_DIETPI_VERSION_RC=1

G_GITBRANCH=‘master’

G_GITOWNER=‘MichaIng’

G_LIVE_PATCH_STATUS[0]=‘not applied’

  • Distro version | echo $G_DISTRO_NAME $G_RASPBIAN

bullseye 0

  • Kernel version | uname -a

Linux DietPi 5.15.76-v8+ #1597 SMP PREEMPT Fri Nov 4 12:16:41 GMT 2022 aarch64 GNU/Linux

  • SBC model | echo $G_HW_MODEL_NAME or (EG: RPi3)

RPi 4 Model B (aarch64)

  • Power supply used | (EG: 5V 1A RAVpower)

5v 3A Official Raspberry Pi Power supply

  • SD card used | (EG: SanDisk ultra)

None, booting direct from USB SSD

Additional Information (if applicable)

  • Software title | (EG: Nextcloud)

Home Assistant

  • Was the software title installed freshly or updated/migrated?

Old install, DietPi was updated using dietpi-update
Home Assistant was from 2022.11.X to 2022.12.8 with the upgrade script provided by DietPi. Home Assistant started crashing after about 8 hours of running, so I reinstalled Home Assistant using dietpi-software reinstall 157
Home Assistant is still crashing after 8 hours or so.

I have noticed the Apple TV integration is not working and I am getting alot of errors in the logs. I do not know if this is causing the crash. I don’t use the Apple TV integration but I am unable to remove it.

  • Can this issue be replicated on a fresh installation of DietPi?

I don’t know, I do not have the hardware to test this.

← If you sent a “dietpi-bugreport”, please paste the ID here →

  • Bug report ID | echo $G_HW_UUID

Steps to reproduce

Expected behaviour

Actual behaviour

Extra details


Extract from journalctl -u home-assistant

-- Journal begins at Mon 2022-12-26 19:31:11 GMT, ends at Mon 2022-12-26 21:51:23 GMT. --
Dec 26 19:31:18 DietPi systemd[1]: Started Home Assistant (DietPi).
Dec 26 19:31:26 DietPi Home Assistant[942]: 2022-12-26 19:31:26.243 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration octopus_energy which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
Dec 26 19:31:26 DietPi Home Assistant[942]: 2022-12-26 19:31:26.247 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
Dec 26 19:31:37 DietPi Home Assistant[942]: 2022-12-26 19:31:37.162 WARNING (MainThread) [homeassistant.config_entries] Config entry 'DC:A6:32:76:1B:9F' for bluetooth integration not ready yet: Bluetooth adapter None with address DC:A6:32:76:1B:9F not found; Retrying in background
Dec 26 19:32:00 DietPi Home Assistant[942]: 2022-12-26 19:32:00.433 ERROR (MainThread) [homeassistant.components.automation] Platform automation does not generate unique IDs. ID 1668665615424 already exists - ignoring automation.doors_opened_notify_keith_mobile
Dec 26 19:32:01 DietPi Home Assistant[942]: 2022-12-26 19:32:01.466 ERROR (MainThread) [homeassistant.config] Platform error: tts - Integration 'picotts_remote' not found.
Dec 26 19:32:15 DietPi Home Assistant[942]: 2022-12-26 19:32:15.405 WARNING (MainThread) [homeassistant.components.button] Setup of button platform shelly is taking over 10 seconds.
Dec 26 19:32:15 DietPi Home Assistant[942]: 2022-12-26 19:32:15.407 WARNING (MainThread) [homeassistant.components.switch] Setup of switch platform shelly is taking over 10 seconds.
Dec 26 19:32:15 DietPi Home Assistant[942]: 2022-12-26 19:32:15.410 WARNING (MainThread) [homeassistant.components.cover] Setup of cover platform shelly is taking over 10 seconds.
Dec 26 19:32:15 DietPi Home Assistant[942]: 2022-12-26 19:32:15.413 WARNING (MainThread) [homeassistant.components.update] Setup of update platform shelly is taking over 10 seconds.
Dec 26 19:32:15 DietPi Home Assistant[942]: 2022-12-26 19:32:15.433 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Bathroom fan' for shelly integration not ready yet: DeviceConnectionError(); Retrying in background
Dec 26 19:32:15 DietPi Home Assistant[942]: 2022-12-26 19:32:15.444 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Dimmer 2' for shelly integration not ready yet: DeviceConnectionError(); Retrying in background
Dec 26 19:32:15 DietPi Home Assistant[942]: 2022-12-26 19:32:15.449 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Dimmer 1' for shelly integration not ready yet: DeviceConnectionError(); Retrying in background
Dec 26 19:32:15 DietPi Home Assistant[942]: 2022-12-26 19:32:15.455 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Bedroom light' for shelly integration not ready yet: DeviceConnectionError(); Retrying in background
Dec 26 19:32:15 DietPi Home Assistant[942]: 2022-12-26 19:32:15.483 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Top hall dimmer' for shelly integration not ready yet: DeviceConnectionError(); Retrying in background
Dec 26 19:32:34 DietPi Home Assistant[942]: 2022-12-26 19:32:34.200 ERROR (SyncWorker_6) [homeassistant.util.package] Unable to install package pyatv==0.10.3: error: subprocess-exited-with-error
Dec 26 19:32:34 DietPi Home Assistant[942]:   
Dec 26 19:32:34 DietPi Home Assistant[942]:   × python setup.py egg_info did not run successfully.
Dec 26 19:32:34 DietPi Home Assistant[942]:   │ exit code: 1
Dec 26 19:32:34 DietPi Home Assistant[942]:   ╰─> [34 lines of output]
Dec 26 19:32:34 DietPi Home Assistant[942]:       /home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
Dec 26 19:32:34 DietPi Home Assistant[942]:         warnings.warn(msg, warning_class)
Dec 26 19:32:34 DietPi Home Assistant[942]:       Traceback (most recent call last):
Dec 26 19:32:34 DietPi Home Assistant[942]:         File "<string>", line 2, in <module>
Dec 26 19:32:34 DietPi Home Assistant[942]:         File "<pip-setuptools-caller>", line 34, in <module>
Dec 26 19:32:34 DietPi Home Assistant[942]:         File "/tmp/pip-install-cl__xbv8/miniaudio_dc96870874ce4e61bb6ffbe12271a5fa/setup.py", line 20, in <module>
Dec 26 19:32:34 DietPi Home Assistant[942]:           setup(
Dec 26 19:32:34 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/setuptools/__init__.py", line 87, in setup
Dec 26 19:32:34 DietPi Home Assistant[942]:           return distutils.core.setup(**attrs)
Dec 26 19:32:34 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 147, in setup
Dec 26 19:32:34 DietPi Home Assistant[942]:           _setup_distribution = dist = klass(attrs)
Dec 26 19:32:34 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/setuptools/dist.py", line 475, in __init__
Dec 26 19:32:34 DietPi Home Assistant[942]:           _Distribution.__init__(
Dec 26 19:32:34 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 283, in __init__
Dec 26 19:32:34 DietPi Home Assistant[942]:           self.finalize_options()
Dec 26 19:32:34 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/setuptools/dist.py", line 899, in finalize_options
Dec 26 19:32:34 DietPi Home Assistant[942]:           ep(self)
Dec 26 19:32:34 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/setuptools/dist.py", line 919, in _finalize_setup_keywords
Dec 26 19:32:34 DietPi Home Assistant[942]:           ep.load()(self, ep.name, value)
Dec 26 19:32:34 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/cffi/setuptools_ext.py", line 219, in cffi_modules
Dec 26 19:32:34 DietPi Home Assistant[942]:           add_cffi_module(dist, cffi_module)
Dec 26 19:32:34 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/cffi/setuptools_ext.py", line 49, in add_cffi_module
Dec 26 19:32:34 DietPi Home Assistant[942]:           execfile(build_file_name, mod_vars)
Dec 26 19:32:34 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/cffi/setuptools_ext.py", line 25, in execfile
Dec 26 19:32:34 DietPi Home Assistant[942]:           exec(code, glob, glob)
Dec 26 19:32:34 DietPi Home Assistant[942]:         File "build_ffi_module.py", line 853, in <module>
Dec 26 19:32:34 DietPi Home Assistant[942]:           if check_linker_need_libatomic():
Dec 26 19:32:34 DietPi Home Assistant[942]:         File "build_ffi_module.py", line 832, in check_linker_need_libatomic
Dec 26 19:32:34 DietPi Home Assistant[942]:           cpp_test = subprocess.Popen(cxx + ['-x', 'c++', '-std=c++14', '-'],
Dec 26 19:32:34 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/subprocess.py", line 971, in __init__
Dec 26 19:32:34 DietPi Home Assistant[942]:           self._execute_child(args, executable, preexec_fn, close_fds,
Dec 26 19:32:34 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/subprocess.py", line 1847, in _execute_child
Dec 26 19:32:34 DietPi Home Assistant[942]:           raise child_exception_type(errno_num, err_msg, err_filename)
Dec 26 19:32:34 DietPi Home Assistant[942]:       FileNotFoundError: [Errno 2] No such file or directory: 'c++'
Dec 26 19:32:34 DietPi Home Assistant[942]:       [end of output]
Dec 26 19:32:34 DietPi Home Assistant[942]:   
Dec 26 19:32:34 DietPi Home Assistant[942]:   note: This error originates from a subprocess, and is likely not a problem with pip.
Dec 26 19:32:34 DietPi Home Assistant[942]: error: metadata-generation-failed
Dec 26 19:32:34 DietPi Home Assistant[942]: × Encountered error while generating package metadata.
Dec 26 19:32:34 DietPi Home Assistant[942]: ╰─> See above for output.
Dec 26 19:32:34 DietPi Home Assistant[942]: note: This is an issue with the package mentioned above, not pip.
Dec 26 19:32:34 DietPi Home Assistant[942]: hint: See above for details.
Dec 26 19:32:45 DietPi Home Assistant[942]: 2022-12-26 19:32:45.956 ERROR (SyncWorker_6) [homeassistant.util.package] Unable to install package pyatv==0.10.3: error: subprocess-exited-with-error
Dec 26 19:32:45 DietPi Home Assistant[942]:   
Dec 26 19:32:45 DietPi Home Assistant[942]:   × python setup.py egg_info did not run successfully.
Dec 26 19:32:45 DietPi Home Assistant[942]:   │ exit code: 1
Dec 26 19:32:45 DietPi Home Assistant[942]:   ╰─> [34 lines of output]
Dec 26 19:32:45 DietPi Home Assistant[942]:       /home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
Dec 26 19:32:45 DietPi Home Assistant[942]:         warnings.warn(msg, warning_class)
Dec 26 19:32:45 DietPi Home Assistant[942]:       Traceback (most recent call last):
Dec 26 19:32:45 DietPi Home Assistant[942]:         File "<string>", line 2, in <module>
Dec 26 19:32:45 DietPi Home Assistant[942]:         File "<pip-setuptools-caller>", line 34, in <module>
Dec 26 19:32:45 DietPi Home Assistant[942]:         File "/tmp/pip-install-ywfanwln/miniaudio_2bebd3e6dfcb47ccae33bd8cc358376a/setup.py", line 20, in <module>
Dec 26 19:32:45 DietPi Home Assistant[942]:           setup(
Dec 26 19:32:45 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/setuptools/__init__.py", line 87, in setup
Dec 26 19:32:45 DietPi Home Assistant[942]:           return distutils.core.setup(**attrs)
Dec 26 19:32:45 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 147, in setup
Dec 26 19:32:45 DietPi Home Assistant[942]:           _setup_distribution = dist = klass(attrs)
Dec 26 19:32:45 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/setuptools/dist.py", line 475, in __init__
Dec 26 19:32:45 DietPi Home Assistant[942]:           _Distribution.__init__(
Dec 26 19:32:45 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 283, in __init__
Dec 26 19:32:45 DietPi Home Assistant[942]:           self.finalize_options()
Dec 26 19:32:45 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/setuptools/dist.py", line 899, in finalize_options
Dec 26 19:32:45 DietPi Home Assistant[942]:           ep(self)
Dec 26 19:32:45 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/setuptools/dist.py", line 919, in _finalize_setup_keywords
Dec 26 19:32:45 DietPi Home Assistant[942]:           ep.load()(self, ep.name, value)
Dec 26 19:32:45 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/cffi/setuptools_ext.py", line 219, in cffi_modules
Dec 26 19:32:45 DietPi Home Assistant[942]:           add_cffi_module(dist, cffi_module)
Dec 26 19:32:45 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/cffi/setuptools_ext.py", line 49, in add_cffi_module
Dec 26 19:32:45 DietPi Home Assistant[942]:           execfile(build_file_name, mod_vars)
Dec 26 19:32:45 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/cffi/setuptools_ext.py", line 25, in execfile
Dec 26 19:32:45 DietPi Home Assistant[942]:           exec(code, glob, glob)
Dec 26 19:32:45 DietPi Home Assistant[942]:         File "build_ffi_module.py", line 853, in <module>
Dec 26 19:32:45 DietPi Home Assistant[942]:           if check_linker_need_libatomic():
Dec 26 19:32:45 DietPi Home Assistant[942]:         File "build_ffi_module.py", line 832, in check_linker_need_libatomic
Dec 26 19:32:45 DietPi Home Assistant[942]:           cpp_test = subprocess.Popen(cxx + ['-x', 'c++', '-std=c++14', '-'],
Dec 26 19:32:45 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/subprocess.py", line 971, in __init__
Dec 26 19:32:45 DietPi Home Assistant[942]:           self._execute_child(args, executable, preexec_fn, close_fds,
Dec 26 19:32:45 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/subprocess.py", line 1847, in _execute_child
Dec 26 19:32:45 DietPi Home Assistant[942]:           raise child_exception_type(errno_num, err_msg, err_filename)
Dec 26 19:32:45 DietPi Home Assistant[942]:       FileNotFoundError: [Errno 2] No such file or directory: 'c++'
Dec 26 19:32:45 DietPi Home Assistant[942]:       [end of output]
Dec 26 19:32:45 DietPi Home Assistant[942]:   
Dec 26 19:32:45 DietPi Home Assistant[942]:   note: This error originates from a subprocess, and is likely not a problem with pip.
Dec 26 19:32:45 DietPi Home Assistant[942]: error: metadata-generation-failed
Dec 26 19:32:45 DietPi Home Assistant[942]: × Encountered error while generating package metadata.
Dec 26 19:32:45 DietPi Home Assistant[942]: ╰─> See above for output.
Dec 26 19:32:45 DietPi Home Assistant[942]: note: This is an issue with the package mentioned above, not pip.
Dec 26 19:32:45 DietPi Home Assistant[942]: hint: See above for details.
Dec 26 19:32:58 DietPi Home Assistant[942]: 2022-12-26 19:32:58.365 ERROR (SyncWorker_6) [homeassistant.util.package] Unable to install package pyatv==0.10.3: error: subprocess-exited-with-error
Dec 26 19:32:58 DietPi Home Assistant[942]:   
Dec 26 19:32:58 DietPi Home Assistant[942]:   × python setup.py egg_info did not run successfully.
Dec 26 19:32:58 DietPi Home Assistant[942]:   │ exit code: 1
Dec 26 19:32:58 DietPi Home Assistant[942]:   ╰─> [34 lines of output]
Dec 26 19:32:58 DietPi Home Assistant[942]:       /home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
Dec 26 19:32:58 DietPi Home Assistant[942]:         warnings.warn(msg, warning_class)
Dec 26 19:32:58 DietPi Home Assistant[942]:       Traceback (most recent call last):
Dec 26 19:32:58 DietPi Home Assistant[942]:         File "<string>", line 2, in <module>
Dec 26 19:32:58 DietPi Home Assistant[942]:         File "<pip-setuptools-caller>", line 34, in <module>
Dec 26 19:32:58 DietPi Home Assistant[942]:         File "/tmp/pip-install-fmky5l4h/miniaudio_233f705fddb54bbc8b774be9b1c5c2b0/setup.py", line 20, in <module>
Dec 26 19:32:58 DietPi Home Assistant[942]:           setup(
Dec 26 19:32:58 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/setuptools/__init__.py", line 87, in setup
Dec 26 19:32:58 DietPi Home Assistant[942]:           return distutils.core.setup(**attrs)
Dec 26 19:32:58 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 147, in setup
Dec 26 19:32:58 DietPi Home Assistant[942]:           _setup_distribution = dist = klass(attrs)
Dec 26 19:32:58 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/setuptools/dist.py", line 475, in __init__
Dec 26 19:32:58 DietPi Home Assistant[942]:           _Distribution.__init__(
Dec 26 19:32:58 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 283, in __init__
Dec 26 19:32:58 DietPi Home Assistant[942]:           self.finalize_options()
Dec 26 19:32:58 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/setuptools/dist.py", line 899, in finalize_options
Dec 26 19:32:58 DietPi Home Assistant[942]:           ep(self)
Dec 26 19:32:58 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/setuptools/dist.py", line 919, in _finalize_setup_keywords
Dec 26 19:32:58 DietPi Home Assistant[942]:           ep.load()(self, ep.name, value)
Dec 26 19:32:58 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/cffi/setuptools_ext.py", line 219, in cffi_modules
Dec 26 19:32:58 DietPi Home Assistant[942]:           add_cffi_module(dist, cffi_module)
Dec 26 19:32:58 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/cffi/setuptools_ext.py", line 49, in add_cffi_module
Dec 26 19:32:58 DietPi Home Assistant[942]:           execfile(build_file_name, mod_vars)
Dec 26 19:32:58 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/cffi/setuptools_ext.py", line 25, in execfile
Dec 26 19:32:58 DietPi Home Assistant[942]:           exec(code, glob, glob)
Dec 26 19:32:58 DietPi Home Assistant[942]:         File "build_ffi_module.py", line 853, in <module>
Dec 26 19:32:58 DietPi Home Assistant[942]:           if check_linker_need_libatomic():
Dec 26 19:32:58 DietPi Home Assistant[942]:         File "build_ffi_module.py", line 832, in check_linker_need_libatomic
Dec 26 19:32:58 DietPi Home Assistant[942]:           cpp_test = subprocess.Popen(cxx + ['-x', 'c++', '-std=c++14', '-'],
Dec 26 19:32:58 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/subprocess.py", line 971, in __init__
Dec 26 19:32:58 DietPi Home Assistant[942]:           self._execute_child(args, executable, preexec_fn, close_fds,
Dec 26 19:32:58 DietPi Home Assistant[942]:         File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/subprocess.py", line 1847, in _execute_child
Dec 26 19:32:58 DietPi Home Assistant[942]:           raise child_exception_type(errno_num, err_msg, err_filename)
Dec 26 19:32:58 DietPi Home Assistant[942]:       FileNotFoundError: [Errno 2] No such file or directory: 'c++'
Dec 26 19:32:58 DietPi Home Assistant[942]:       [end of output]
Dec 26 19:32:58 DietPi Home Assistant[942]:   
Dec 26 19:32:58 DietPi Home Assistant[942]:   note: This error originates from a subprocess, and is likely not a problem with pip.
Dec 26 19:32:58 DietPi Home Assistant[942]: error: metadata-generation-failed
Dec 26 19:32:58 DietPi Home Assistant[942]: × Encountered error while generating package metadata.
Dec 26 19:32:58 DietPi Home Assistant[942]: ╰─> See above for output.
Dec 26 19:32:58 DietPi Home Assistant[942]: note: This is an issue with the package mentioned above, not pip.
Dec 26 19:32:58 DietPi Home Assistant[942]: hint: See above for details.
Dec 26 19:32:58 DietPi Home Assistant[942]: 2022-12-26 19:32:58.370 ERROR (MainThread) [homeassistant.setup] Setup failed for apple_tv: Requirements for apple_tv not found: ['pyatv==0.10.3'].
Dec 26 19:33:04 DietPi Home Assistant[942]: 2022-12-26 19:33:04.340 WARNING (MainThread) [homeassistant.config_entries] Config entry '192.168.54.35' for octoprint integration not ready yet: Cannot connect to host 192.168.54.35:80 ssl:default [Connect call failed ('192.168.54.35', 80)]; Retrying in background
Dec 26 19:33:14 DietPi Home Assistant[942]: 2022-12-26 19:33:14.452 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: min_max, group, moon, derivative, openweathermap, plex, waze_travel_time, mqtt, co2signal, pi_hole, homekit_controller, ipp, zha, speedtestdotnet, binary_sensor.workday, binary_sensor.group, binary_sensor.group_2, binary_sensor.octopus_energy, binary_sensor.shelly, binary_sensor.shelly_2, binary_sensor.mqtt, binary_sensor.pi_hole
Dec 26 19:33:14 DietPi Home Assistant[942]: 2022-12-26 19:33:14.581 ERROR (MainThread) [homeassistant.components.binary_sensor] Error adding entities for domain binary_sensor with platform pi_hole
Dec 26 19:33:14 DietPi Home Assistant[942]: Traceback (most recent call last):
Dec 26 19:33:14 DietPi Home Assistant[942]:   File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
Dec 26 19:33:14 DietPi Home Assistant[942]:     await asyncio.gather(*tasks)
Dec 26 19:33:14 DietPi Home Assistant[942]:   File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
Dec 26 19:33:14 DietPi Home Assistant[942]:     await entity.add_to_platform_finish()
Dec 26 19:33:14 DietPi Home Assistant[942]:   File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
Dec 26 19:33:14 DietPi Home Assistant[942]:     self.async_write_ha_state()
Dec 26 19:33:14 DietPi Home Assistant[942]:   File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
Dec 26 19:33:14 DietPi Home Assistant[942]:     self._async_write_ha_state()
Dec 26 19:33:14 DietPi Home Assistant[942]:   File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
Dec 26 19:33:14 DietPi Home Assistant[942]:     state = self._stringify_state(available)
Dec 26 19:33:14 DietPi Home Assistant[942]:   File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 551, in _stringify_state
Dec 26 19:33:14 DietPi Home Assistant[942]:     if (state := self.state) is None:
Dec 26 19:33:14 DietPi Home Assistant[942]:   File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/homeassistant/components/binary_sensor/__init__.py", line 211, in state
Dec 26 19:33:14 DietPi Home Assistant[942]:     if (is_on := self.is_on) is None:
Dec 26 19:33:14 DietPi Home Assistant[942]:   File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/homeassistant/components/pi_hole/binary_sensor.py", line 87, in is_on
Dec 26 19:33:14 DietPi Home Assistant[942]:     return self.entity_description.state_value(self.api)
Dec 26 19:33:14 DietPi Home Assistant[942]:   File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/homeassistant/components/pi_hole/const.py", line 164, in <lambda>
Dec 26 19:33:14 DietPi Home Assistant[942]:     state_value=lambda api: bool(api.data.get("status") == "enabled"),
Dec 26 19:33:14 DietPi Home Assistant[942]: AttributeError: 'list' object has no attribute 'get'
Dec 26 19:33:14 DietPi Home Assistant[942]: 2022-12-26 19:33:14.649 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up pi_hole platform for binary_sensor
Dec 26 19:33:14 DietPi Home Assistant[942]: Traceback (most recent call last):
Dec 26 19:33:14 DietPi Home Assistant[942]:   File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 289, in _async_setup_platform
Dec 26 19:33:14 DietPi Home Assistant[942]:     await asyncio.gather(*pending)
Dec 26 19:33:14 DietPi Home Assistant[942]:   File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
Dec 26 19:33:14 DietPi Home Assistant[942]:     await asyncio.gather(*tasks)
Dec 26 19:33:14 DietPi Home Assistant[942]:   File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
Dec 26 19:33:14 DietPi Home Assistant[942]:     await entity.add_to_platform_finish()
Dec 26 19:33:14 DietPi Home Assistant[942]:   File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
Dec 26 19:33:14 DietPi Home Assistant[942]:     self.async_write_ha_state()
Dec 26 19:33:14 DietPi Home Assistant[942]:   File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
Dec 26 19:33:14 DietPi Home Assistant[942]:     self._async_write_ha_state()
Dec 26 19:33:14 DietPi Home Assistant[942]:   File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
Dec 26 19:33:14 DietPi Home Assistant[942]:     state = self._stringify_state(available)
Dec 26 19:33:14 DietPi Home Assistant[942]:   File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 551, in _stringify_state
Dec 26 19:33:14 DietPi Home Assistant[942]:     if (state := self.state) is None:
Dec 26 19:33:14 DietPi Home Assistant[942]:   File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/homeassistant/components/binary_sensor/__init__.py", line 211, in state
Dec 26 19:33:14 DietPi Home Assistant[942]:     if (is_on := self.is_on) is None:
Dec 26 19:33:14 DietPi Home Assistant[942]:   File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/homeassistant/components/pi_hole/binary_sensor.py", line 87, in is_on
Dec 26 19:33:14 DietPi Home Assistant[942]:     return self.entity_description.state_value(self.api)
Dec 26 19:33:14 DietPi Home Assistant[942]:   File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/homeassistant/components/pi_hole/const.py", line 164, in <lambda>
Dec 26 19:33:14 DietPi Home Assistant[942]:     state_value=lambda api: bool(api.data.get("status") == "enabled"),
Dec 26 19:33:14 DietPi Home Assistant[942]: AttributeError: 'list' object has no attribute 'get'
Dec 26 19:33:16 DietPi Home Assistant[942]: 2022-12-26 19:33:16.437 ERROR (MainThread) [homeassistant.components.binary_sensor] pi_hole: Error on device update!
Dec 26 19:33:16 DietPi Home Assistant[942]: Traceback (most recent call last):
Dec 26 19:33:16 DietPi Home Assistant[942]:   File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 493, in _async_add_entity
Dec 26 19:33:16 DietPi Home Assistant[942]:     await entity.async_device_update(warning=False)
Dec 26 19:33:16 DietPi Home Assistant[942]:   File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 715, in async_device_update
Dec 26 19:33:16 DietPi Home Assistant[942]:     await task
Dec 26 19:33:16 DietPi Home Assistant[942]:   File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/homeassistant/helpers/update_coordinator.py", line 392, in async_update
Dec 26 19:33:16 DietPi Home Assistant[942]:     await self.coordinator.async_request_refresh()
Dec 26 19:33:16 DietPi Home Assistant[942]:   File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/homeassistant/helpers/update_coordinator.py", line 175, in async_request_refresh
Dec 26 19:33:16 DietPi Home Assistant[942]:     await self._debounced_refresh.async_call()
Dec 26 19:33:16 DietPi Home Assistant[942]:   File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/homeassistant/helpers/debounce.py", line 82, in async_call
Dec 26 19:33:16 DietPi Home Assistant[942]:     await task
Dec 26 19:33:16 DietPi Home Assistant[942]:   File "/home/homeassistant/.pyenv/versions/3.10.9/lib/python3.10/site-packages/homeassistant/helpers/update_coordinator.py", line 201, in async_refresh


The cffi module build (now) seems to require a C++ compiler. Please try:

apt install g++
systemctl restart home-assistant

I’ve given that a go. Now to see if it crashes again. Thank you.

Probably it is still crashing but it helps to clean the log to see what the issue might be. There was as well an error message about PiHole. I guess you have such an integration?

Hi yes it has crashed again. here is the result of dietpi-services status home-assistant

root@DietPi:~# dietpi-services status home-assistant

 DietPi-Services
─────────────────────────────────────────────────────
 Mode: status home-assistant

[FAILED] DietPi-Services | ● home-assistant.service - Home Assistant (DietPi)
     Loaded: loaded (/etc/systemd/system/home-assistant.service; disabled; vendor preset: enabled)
     Active: failed (Result: signal) since Tue 2022-12-27 17:50:19 GMT; 2h 51min ago
    Process: 9665 ExecStart=/home/homeassistant/homeassistant-start.sh (code=killed, signal=KILL)
   Main PID: 9665 (code=killed, signal=KILL)
        CPU: 1h 26min 57.843s

Dec 27 17:07:30 DietPi Home Assistant[9665]: 2022-12-27 17:07:30.113 WARNING (MainThread) [bellows.zigbee.application] Watchdog heartbeat timeout: TimeoutError()
Dec 27 17:07:45 DietPi Home Assistant[9665]: 2022-12-27 17:07:45.184 WARNING (MainThread) [bellows.zigbee.application] Watchdog heartbeat timeout: TimeoutError()
Dec 27 17:08:00 DietPi Home Assistant[9665]: 2022-12-27 17:08:00.241 WARNING (MainThread) [bellows.zigbee.application] Watchdog heartbeat timeout: TimeoutError()
Dec 27 17:08:15 DietPi Home Assistant[9665]: 2022-12-27 17:08:15.533 WARNING (MainThread) [bellows.zigbee.application] Watchdog heartbeat timeout: TimeoutError()
Dec 27 17:08:47 DietPi Home Assistant[9665]: 2022-12-27 17:08:47.835 ERROR (MainThread) [mysensors.gateway_tcp] No response from ('192.168.54.25', 5003). Disconnecting
Dec 27 17:09:49 DietPi Home Assistant[9665]: 2022-12-27 17:09:49.163 WARNING (MainThread) [homeassistant.helpers.entity] Updating state for sensor.compensation_sensor_shelly_1pm_switch_0_voltage (<class 'homeassistant.components.compensation.sensor.CompensationSensor'>) took 3.222 seconds. Please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+compensation%22
Dec 27 17:09:49 DietPi Home Assistant[9665]: 2022-12-27 17:09:49.251 WARNING (Thread-2 (_thread_main)) [homeassistant.components.mqtt.client] Disconnected from MQTT server 192.168.54.30:1883 (7)
Dec 27 17:50:19 DietPi systemd[1]: home-assistant.service: Main process exited, code=killed, status=9/KILL
Dec 27 17:50:19 DietPi systemd[1]: home-assistant.service: Failed with result 'signal'.
Dec 27 17:50:19 DietPi systemd[1]: home-assistant.service: Consumed 1h 26min 57.843s CPU time.
root@DietPi:~# 

I do have a PiHole integration, this was working last time I looked.

The complete log is here

The log stops at 17:09 while last time stamp on your service is 17:50. Means there should be more on the log :wink:

Seems HA is getting killed. Can you check for kernel error messages.

dmesg -l err,crit,alert,emerg

Anyway, there are more challenges on your log. One of your sensors doesn’t seems to be working.

2022-12-27 17:08:47.835 ERROR (MainThread) [mysensors.gateway_tcp] No response from (‘192.168.54.25’, 5003). Disconnecting

Thanks for your response. Home Assistant logs seem very noisy. That sensor has been working fine.

Here is the kernel error messages

root@DietPi:/mnt/dietpi_userdata/homeassistant# dmesg -l err,crit,alert,emerg
[    1.223614] bcm2708_fb soc:fb: Unable to determine number of FBs. Disabling driver.
[    3.568479] sd 2:0:0:0: [sdc] No Caching mode page found
[    3.568537] sd 2:0:0:0: [sdc] Assuming drive cache: write through
[    4.431946] vc_sm_cma_vchi_init: failed to open VCHI service (-1)
[    4.431970] [vc_sm_connected_init]: failed to initialize shared memory service
[    4.462554] bcm2835_mmal_vchiq: Failed to open VCHI service connection (status=-1)
[    6.179287] hwmon hwmon1: Undervoltage detected!
[37738.392342] Out of memory: Killed process 3752 (hass) total-vm:4205592kB, anon-rss:1721480kB, file-rss:0kB, shmem-rss:0kB, UID:998 pgtables:4684kB oom_score_adj:0
[80336.935809] Out of memory: Killed process 9665 (hass) total-vm:4119740kB, anon-rss:1802924kB, file-rss:0kB, shmem-rss:0kB, UID:998 pgtables:4356kB oom_score_adj:0

I seen undervoltage, I’m using an official Raspberry Pi 5v 3A supply, Maybe it is on the way out. But I also see Out of Memory, not sure why that is.

This happened during boot only as of now, but yeah probably it’s dying.

Have a look to htop and monitore memory consumption. As well you can check free -m to watch memory as well as swap consumption.

Hi, thanks for your time here:
Home Assistant memory usage does seem to creep up slowly over time, but I’ve not seen total memory usage above 600MB. It always seems to crash over night. Is there anyway I can log the memory usage of Home Assistant so I don’t have to be watching it?

It is not HA only. It’s the entire system usage that count. Can you share following

free -m

This should show memory + swap usage. As a workaround you could try to increase swap to check if HA will survive longer.

For the monitoring question. Yeah, there are options available. But they would require an additional system/SBC/VM to avoid more load on the one hosting HA.

Hi here it is:

root@DietPi:/home# free -m
               total        used        free      shared  buff/cache   available
Mem:            1899         502         212          12        1183        1355
Swap:            148          18         130

I have an unraid server, so if there is a docker I can put on there to monitor my Raspberry Pi, that could be done.

first you could try to increase swap file to 2GB

/boot/dietpi/func/dietpi-set_swapfile 2048

Regarding monitoring, your unraid server, is it based on amd64? If yes, you could try to get InfluxDB + Grafana running as Docker container Docker

Once done, you could try following a monitoring guide IoT — Raspberry Pi Container and System Monitoring with InfluxDB, Telegraf and Grafana | by Dorian Machado | Medium to setup the database inside Influx, configure the Grafana dashboard and at the end setup Telegraf monitoring client.

ok, increased the swap file as above. This has helped me witness the problem, since it now takes longer to crash. But it seems HA eating all the RAM. Between 20:14 and 21:34 this evening HA went from using 1699M RAM and swap file at 370M to 1732M RAM and swap file to 2GB.
I’ve disabled all custom integrations and disabled all non critical integrations is HA. Any idea how I can debug further?


I managed to get this out of dmesg whilst it was out of RAM.
Any idea what SYN Flooding is?

root@DietPi:~# dmesg | tail
[288639.160651] [ 189334]   998 189334   925517   452961  3973120     1463             0 hass
[288639.160669] [ 189354]     0 189354     1413       23    45056       41             0 cron
[288639.160688] [ 192969]     0 192969     2227       89    49152       27             0 cron
[288639.160705] [ 192970]    33 192970      516       17    36864        0             0 sh
[288639.161320] [ 192971]    33 192971    32740     3810   180224        3             0 php
[288639.161352] [ 192977]     0 192977     2139       73    49152       16             0 cron
[288639.161372] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/,task=hass,pid=189334,uid=998
[288639.163020] Out of memory: Killed process 189334 (hass) total-vm:3702068kB, anon-rss:1811844kB, file-rss:0kB, shmem-rss:0kB, UID:998 pgtables:3880kB oom_score_adj:0
[295766.822111] TCP: request_sock_TCP: Possible SYN flooding on port 8123. Sending cookies.  Check SNMP counters.
[307322.886212] Adding 2097148k swap on /var/swap.  Priority:-2 extents:21 across:97779708k SSFS

Could be some kind of Denial-of-Service-(DDoS) or similar flooding the port 8123 (HA). Is your system reachable from internet directly? If yes, try to close the port.