Home Assistant restarts every night - missing logs

Hi

i cannot find the problem, why my HA restarts every night.
I am missing the log files from 00:00 am till 00:27 am.

Here is the screenshot:


2022-02-17 00:27:28 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration xiaomi_cloud_map_extractor 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

2022-02-17 00:27:28 WARNING (SyncWorker_1) [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

2022-02-17 00:27:28 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration alexa_media 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

2022-02-17 00:27:30 WARNING (Recorder) [homeassistant.components.recorder.util] The system could not validate that the sqlite3 database at //config/home-assistant_v2.db was shutdown cleanly

2022-02-17 00:27:31 WARNING (Recorder) [homeassistant.components.recorder.util] Ended unfinished session (id=64 from 2022-02-16 11:18:36.605860)

2022-02-17 00:27:31 WARNING (MainThread) [homeassistant.components.lovelace] Lovelace is running in storage mode. Define resources via user interface

2022-02-17 00:27:44 ERROR (MainThread) [homeassistant.components.vacuum] The xiaomi_miio platform for the vacuum integration does not support platform setup. Please remove it from your config.

2022-02-17 00:27:52 WARNING (MainThread) [homeassistant.setup] Setup of hacs is taking over 10 seconds.

2022-02-17 00:27:54 ERROR (MainThread) [homeassistant.components.sensor] Platform hacs does not generate unique IDs. ID 0717a0cd-745c-48fd-9b16-c8534c9704f9-bc944b0f-fd42-4a58-a072-ade38d1444cd already exists - ignoring sensor.hacs

2022-02-17 00:27:54 ERROR (MainThread) [zigpy.application] Couldn't start application

2022-02-17 00:27:54 WARNING (MainThread) [homeassistant.helpers.entity] Update of camera.xiaomi_cloud_map_extractor is taking over 10 seconds

2022-02-17 00:27:54 ERROR (MainThread) [homeassistant.components.zha.core.gateway] Couldn't start deCONZ = dresden elektronik deCONZ protocol: ConBee I/II, RaspBee I/II coordinator

Traceback (most recent call last):

File "/usr/local/lib/python3.9/site-packages/serial/serialposix.py", line 322, in open

self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)

FileNotFoundError: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2412261-if00'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 152, in async_initialize

self.application_controller = await app_controller_cls.new(

File "/usr/local/lib/python3.9/site-packages/zigpy/application.py", line 69, in new

await app.startup(auto_form)

File "/usr/local/lib/python3.9/site-packages/zigpy_deconz/zigbee/application.py", line 66, in startup

await self._api.connect()

File "/usr/local/lib/python3.9/site-packages/zigpy_deconz/api.py", line 253, in connect

self._uart = await zigpy_deconz.uart.connect(self._config, self)

File "/usr/local/lib/python3.9/site-packages/zigpy_deconz/uart.py", line 142, in connect

_, protocol = await serial_asyncio.create_serial_connection(

File "/usr/local/lib/python3.9/site-packages/serial_asyncio/__init__.py", line 448, in create_serial_connection

serial_instance = serial.serial_for_url(*args, **kwargs)

File "/usr/local/lib/python3.9/site-packages/serial/__init__.py", line 90, in serial_for_url

instance.open()

File "/usr/local/lib/python3.9/site-packages/serial/serialposix.py", line 325, in open

raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))

serial.serialutil.SerialException: [Errno 2] could not open port /dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2412261-if00: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2412261-if00'

2022-02-17 00:27:54 WARNING (MainThread) [homeassistant.config_entries] Config entry 'ConBee II, s/n: DE2412261 - dresden elektronik ingenieurtechnik GmbH' for zha integration not ready yet: [Errno 2] could not open port /dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2412261-if00: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2412261-if00'; Retrying in background

2022-02-17 00:28:00 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'int' got invalid input 'unknown' when rendering template '{% set count = states('sensor.regenmesser') | int %} {% set mm_per_pulse = 0.30303 %} {% set mm = count * mm_per_pulse %} {{ mm|round(1, 'floor') }}' but no default was specified. Currently 'int' will return '0', however this template will fail to render in Home Assistant core 2022.1

2022-02-17 00:28:00 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'int' got invalid input 'unknown' when rendering template '{% set count = states('sensor.regenmesser') | int %} {% set mm_per_pulse = 0.30303 %} {% set mm = count * mm_per_pulse %} {{ mm|round(1, 'floor') }}' but no default was specified. Currently 'int' will return '0', however this template will fail to render in Home Assistant core 2022.1

2022-02-17 00:28:04 ERROR (MainThread) [zigpy.application] Couldn't start application

2022-02-17 00:28:04 ERROR (MainThread) [homeassistant.components.zha.core.gateway] Couldn't start deCONZ = dresden elektronik deCONZ protocol: ConBee I/II, RaspBee I/II coordinator

Traceback (most recent call last):

File "/usr/local/lib/python3.9/site-packages/serial/serialposix.py", line 322, in open

self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)

FileNotFoundError: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2412261-if00'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 152, in async_initialize

self.application_controller = await app_controller_cls.new(

File "/usr/local/lib/python3.9/site-packages/zigpy/application.py", line 69, in new

await app.startup(auto_form)

File "/usr/local/lib/python3.9/site-packages/zigpy_deconz/zigbee/application.py", line 66, in startup

await self._api.connect()

File "/usr/local/lib/python3.9/site-packages/zigpy_deconz/api.py", line 253, in connect

self._uart = await zigpy_deconz.uart.connect(self._config, self)

File "/usr/local/lib/python3.9/site-packages/zigpy_deconz/uart.py", line 142, in connect

_, protocol = await serial_asyncio.create_serial_connection(

File "/usr/local/lib/python3.9/site-packages/serial_asyncio/__init__.py", line 448, in create_serial_connection

serial_instance = serial.serial_for_url(*args, **kwargs)

File "/usr/local/lib/python3.9/site-packages/serial/__init__.py", line 90, in serial_for_url

instance.open()

File "/usr/local/lib/python3.9/site-packages/serial/serialposix.py", line 325, in open

raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))

serial.serialutil.SerialException: [Errno 2] could not open port /dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2412261-if00: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2412261-if00'

2022-02-17 00:28:17 ERROR (MainThread) [zigpy.application] Couldn't start application

2022-02-17 00:28:17 ERROR (MainThread) [homeassistant.components.zha.core.gateway] Couldn't start deCONZ = dresden elektronik deCONZ protocol: ConBee I/II, RaspBee I/II coordinator

Traceback (most recent call last):

File "/usr/local/lib/python3.9/site-packages/serial/serialposix.py", line 322, in open

self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)

FileNotFoundError: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2412261-if00'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 152, in async_initialize

self.application_controller = await app_controller_cls.new(

File "/usr/local/lib/python3.9/site-packages/zigpy/application.py", line 69, in new

await app.startup(auto_form)

File "/usr/local/lib/python3.9/site-packages/zigpy_deconz/zigbee/application.py", line 66, in startup

await self._api.connect()

File "/usr/local/lib/python3.9/site-packages/zigpy_deconz/api.py", line 253, in connect

self._uart = await zigpy_deconz.uart.connect(self._config, self)

File "/usr/local/lib/python3.9/site-packages/zigpy_deconz/uart.py", line 142, in connect

_, protocol = await serial_asyncio.create_serial_connection(

File "/usr/local/lib/python3.9/site-packages/serial_asyncio/__init__.py", line 448, in create_serial_connection

serial_instance = serial.serial_for_url(*args, **kwargs)

File "/usr/local/lib/python3.9/site-packages/serial/__init__.py", line 90, in serial_for_url

instance.open()

File "/usr/local/lib/python3.9/site-packages/serial/serialposix.py", line 325, in open

raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))

serial.serialutil.SerialException: [Errno 2] could not open port /dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2412261-if00: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2412261-if00'

2022-02-17 00:28:37 ERROR (MainThread) [zigpy.application] Couldn't start application

2022-02-17 00:28:37 ERROR (MainThread) [homeassistant.components.zha.core.gateway] Couldn't start deCONZ = dresden elektronik deCONZ protocol: ConBee I/II, RaspBee I/II coordinator

Traceback (most recent call last):

File "/usr/local/lib/python3.9/site-packages/serial/serialposix.py", line 322, in open

self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)

FileNotFoundError: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2412261-if00'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 152, in async_initialize

self.application_controller = await app_controller_cls.new(

File "/usr/local/lib/python3.9/site-packages/zigpy/application.py", line 69, in new

await app.startup(auto_form)

File "/usr/local/lib/python3.9/site-packages/zigpy_deconz/zigbee/application.py", line 66, in startup

await self._api.connect()

File "/usr/local/lib/python3.9/site-packages/zigpy_deconz/api.py", line 253, in connect

self._uart = await zigpy_deconz.uart.connect(self._config, self)

File "/usr/local/lib/python3.9/site-packages/zigpy_deconz/uart.py", line 142, in connect

_, protocol = await serial_asyncio.create_serial_connection(

File "/usr/local/lib/python3.9/site-packages/serial_asyncio/__init__.py", line 448, in create_serial_connection

serial_instance = serial.serial_for_url(*args, **kwargs)

File "/usr/local/lib/python3.9/site-packages/serial/__init__.py", line 90, in serial_for_url

instance.open()

File "/usr/local/lib/python3.9/site-packages/serial/serialposix.py", line 325, in open

raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))

serial.serialutil.SerialException: [Errno 2] could not open port /dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2412261-if00: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2412261-if00'

2022-02-17 00:29:18 ERROR (MainThread) [zigpy.application] Couldn't start application

2022-02-17 00:29:18 ERROR (MainThread) [homeassistant.components.zha.core.gateway] Couldn't start deCONZ = dresden elektronik deCONZ protocol: ConBee I/II, RaspBee I/II coordinator

Traceback (most recent call last):

File "/usr/local/lib/python3.9/site-packages/serial/serialposix.py", line 322, in open

self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)

FileNotFoundError: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2412261-if00'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 152, in async_initialize

self.application_controller = await app_controller_cls.new(

File "/usr/local/lib/python3.9/site-packages/zigpy/application.py", line 69, in new

await app.startup(auto_form)

File "/usr/local/lib/python3.9/site-packages/zigpy_deconz/zigbee/application.py", line 66, in startup

await self._api.connect()

File "/usr/local/lib/python3.9/site-packages/zigpy_deconz/api.py", line 253, in connect

self._uart = await zigpy_deconz.uart.connect(self._config, self)

File "/usr/local/lib/python3.9/site-packages/zigpy_deconz/uart.py", line 142, in connect

_, protocol = await serial_asyncio.create_serial_connection(

File "/usr/local/lib/python3.9/site-packages/serial_asyncio/__init__.py", line 448, in create_serial_connection

serial_instance = serial.serial_for_url(*args, **kwargs)

File "/usr/local/lib/python3.9/site-packages/serial/__init__.py", line 90, in serial_for_url

instance.open()

File "/usr/local/lib/python3.9/site-packages/serial/serialposix.py", line 325, in open

raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))

serial.serialutil.SerialException: [Errno 2] could not open port /dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2412261-if00: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2412261-if00'

2022-02-17 00:30:38 ERROR (MainThread) [zigpy.application] Couldn't start application

2022-02-17 00:30:38 ERROR (MainThread) [homeassistant.components.zha.core.gateway] Couldn't start deCONZ = dresden elektronik deCONZ protocol: ConBee I/II, RaspBee I/II coordinator

Traceback (most recent call last):

File "/usr/local/lib/python3.9/site-packages/serial/serialposix.py", line 322, in open

self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)

FileNotFoundError: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2412261-if00'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 152, in async_initialize

self.application_controller = await app_controller_cls.new(

File "/usr/local/lib/python3.9/site-packages/zigpy/application.py", line 69, in new

await app.startup(auto_form)

File "/usr/local/lib/python3.9/site-packages/zigpy_deconz/zigbee/application.py", line 66, in startup

await self._api.connect()

File "/usr/local/lib/python3.9/site-packages/zigpy_deconz/api.py", line 253, in connect

self._uart = await zigpy_deconz.uart.connect(self._config, self)

File "/usr/local/lib/python3.9/site-packages/zigpy_deconz/uart.py", line 142, in connect

_, protocol = await serial_asyncio.create_serial_connection(

File "/usr/local/lib/python3.9/site-packages/serial_asyncio/__init__.py", line 448, in create_serial_connection

serial_instance = serial.serial_for_url(*args, **kwargs)

File "/usr/local/lib/python3.9/site-packages/serial/__init__.py", line 90, in serial_for_url

instance.open()

File "/usr/local/lib/python3.9/site-packages/serial/serialposix.py", line 325, in open

raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))

serial.serialutil.SerialException: [Errno 2] could not open port /dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2412261-if00: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2412261-if00'

Can anybody help me?
I dont understand the logs and cannot retrace, why the system is shutting down every night.

Here is my problem describted:

Quite hard to find out if you have no logs. You could start with writing the logs to a external log server ?

can you tell me, how I write the logs to an external log server?

First of all…you would need to have a external log server…i.e. external to your HA env.
So if you run your HA in docker then you could probably write it to the OS logserver. If you run HAIO then I guess you need to setup another machine.
For instance, I myself am writing from a Docker/HA on a IntelNUC/ubuntu … to my SynologyNAS logserver.
There are a number of free syslog servers for e.g. Windows…you would need to keep that system running of course :slight_smile:

Before doing that, maybe you can use the log before reboot? HA creates a copy of the log when rebooting, so do you see that somewhere in the config (home-assistant.log.1)?

1 Like

I use the VM on my syno.
Can you send me link / tutorial?
Dont exactly know what I am looking for :confused:

this files I found:

From your earlier comment, I would have expected the .1 file with a timestamp of the restart, i.e. around mindnight, this one seems t indicate that HA was restarted 15:30-ish. Did you restart at that time or if not, what does its content say of 17feb between 00:00 and 00:30?

1 Like

I restarted HA yesterday at 15:30, due a new update.

Non of both logs shows a time stamp within 00:00-00:30.
First time stamp is (2022-02-18 00:31:02).

How is it possible to create an external log at the syno to save ALL datas, so I can analyse, whats the reason for the 00:00 shutdown…?

1 Like

Thanks for your input.
I will check this later.
If I read right, than I have to use the " HAOS - Alternative" way, because at the syno VM I didnt have: " So what you’ll have to do is copy these files out of here to another linux system which has journalctl available (debian, ubuntu, etc.)"

Interesting … does not apply to me though as not on haos so I only have the .1 file by default.
So what I understand is that haos, like any linux system, uses a syslog…

However, I do port my logs to syno for ease of use… On Timo’s questions, on the NAS you can easily setup the log server (part of default setup) to receive log on a specific port. Then you need to point your source to ip and port of the NAS…usually not that complex.

on the NAS you can easily setup the log server (part of default setup) to receive log on a specific port.
→ where is this option at the syno?

Then you need to point your source to ip and port of the NAS
→ this configuration should be done at HA? Where do I find this option :D?

Syno: you need to ‘enhance’ log center by installing a package…log center (odd but it is as it is). Then you need to configure it to receive logs, I use port 514 which seems to be some sort of default.

. Depending on your network/router/firewall/etc. you may need to allow port 514 on syno…but try without first.

HAOS: repeating that I cannot try or demo this as I am not using haos … but apparently this is not something ha.io want to support (see link) … there is however a workaround by using a container (see same link) which also demonstrates how to remote-log from other docker-containers (and this is how I use this to log from HA to Syno): Enabling syslog in dockers daemon.json causes bootloop · Issue #1783 · home-assistant/supervisor (github.com) .

Tip: be careful with sending notifications…a wrong setting may flood your email SMTP and they may shut you down for a while (happened to me with hotmail)

I understand…

But I’m missing the step, where I point to the HA? Or rather where I am telling the log center to catch up the datas from HA?
https://kb.synology.com/en-in/DSM/help/LogCenter/logcenter_server?version=6

What you did is open log-center for receiving data so now it can receive from (theoretically) any syslog server… so syno ‘done’…now the less easy part: haos

When you have added portainer, in the bottom you will find the option to setup logging


After (re)deploying this …it should immediately show in syno log center

okay, thats whats I am looking for :smiley:
But my HA didnt run in docker…
work portainer anyway?

See the link above…apparently one can still install portainer as supervisor add-on and do something with it…here is where my help stops…but the info under that link seems clear enough (to me)