zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

Z2m restarts for no reason.

Open TomKassel opened this issue 1 year ago • 28 comments

What happened?

Z2m restarts for no reason.

'Zigbee2MQTT server has exited unexpectedly' 'After 10s Z2m restarts!'

What did you expect to happen?

No restart.

How to reproduce it (minimal and precise)

You can't reproduce it. It happens every 4-24 hours.

Zigbee2MQTT version

2.1.3

Adapter firmware version

20250321

Adapter

Zstack, SLZB-06P7

Setup

PC, Windows 11

Debug log

log.log

TomKassel avatar Apr 02 '25 16:04 TomKassel

I don't see any startup or shutdown sequence in that log file. Do you have the one with it?

Nerivec avatar Apr 02 '25 20:04 Nerivec

Z2M restarts at 17:37:55 after 1 day and 8 hours. Here is the debug log from the restart:

log2.log

TomKassel avatar Apr 02 '25 20:04 TomKassel

So, the first log should have the error that caused the restart, but it doesn't appear to. That would suggest a pretty hard crash of the nodejs process. Can you check system logs, see if you can spot something around that time? If you aren't already on it, I suggest you try updating to latest LTS version of nodejs too (v22): https://nodejs.org/en/download

Nerivec avatar Apr 02 '25 21:04 Nerivec

In my desperation, I updated the nodejs version a few days ago. You suspect a Windows or hardware problem? I will check the system log files. By the way, the last restart was a few minutes ago.

TomKassel avatar Apr 03 '25 06:04 TomKassel

The last few lines of logging from Z2M before restart are likely only printed to the console, so you may have to catch it there so we can get more details (unless some system log can point to a failure of some kind).

Nerivec avatar Apr 03 '25 09:04 Nerivec

In the Windows protocol there are only processor warnings. I have just ported the system to new hardware. I'm curious.

I'll take a look at the console. Thank you very.

TomKassel avatar Apr 03 '25 09:04 TomKassel

I installed my system on a new PC. It ran for 1 day and 7 hours, then there was a restart from Z2M (17:47). The attached file is a copy directly from the console. I can't see any error. How is this possible?

Error Log.txt

TomKassel avatar Apr 04 '25 16:04 TomKassel

I don't see any restart at 17:47 in that log.

Your mentioned before 17:37:55 and now 17:47, the two are close enough to make me wonder, can you put this crash around the same time of day every time? Or maybe it's about the runtime duration, 1d8h, 1d7h?

If a different machine is exhibiting the same behavior, you have a few avenues to explore:

  • the two machines have similar-enough configurations that both are affected by the same bug
  • problem with the adapter that's causing a crash
  • problem with a device on the network that's causing a crash (some kind of bad behavior, spamming, corrupted data...)

If using USB mode:

  • check the power saving settings of the COM port (in Device Manager), make sure the OS cannot turn it off to "save power"
  • update the drivers: https://www.silabs.com/developer-tools/usb-to-uart-bridge-vcp-drivers?tab=downloads

Nerivec avatar Apr 04 '25 17:04 Nerivec

I use the SLZB-06P7 in PoE network mode. Previously I had a Conbee2, which did not cause these problems. The new hardware is quite different from the old one and has been completely reinstalled.

TomKassel avatar Apr 04 '25 17:04 TomKassel

I had a restart of Z2M today at 17:45. This time, both before the restart (Log1) and after the restart (Log2) there are various error messages in the log, which I unfortunately can't do anything with.

log1.log log2.log

TomKassel avatar Apr 06 '25 17:04 TomKassel

These errors should not crash Z2M, it's mostly just failed deliveries. (0x3410f4fffe61e419 is causing most of them, it's failing poll check-in.) We're still missing the one that does unfortunately.

What's the "core firmware" version on your adapter?

Nerivec avatar Apr 06 '25 17:04 Nerivec

First of all, thank you again for the support. I've had daily reboots for some time now, which is exhausting and annoying. Core v2.8.2.dev3 is currently installed and Zigbee is 20240716. But I've tried older versions, for example Core V 2.7.1.

TomKassel avatar Apr 06 '25 18:04 TomKassel

Could you try connecting the SLZB in USB mode instead of network? This will rule out any network related problems.

Koenkk avatar Apr 06 '25 19:04 Koenkk

I can implement this tomorrow with little effort.

TomKassel avatar Apr 06 '25 19:04 TomKassel

Make sure to follow the USB-related points here beforehand.

Nerivec avatar Apr 06 '25 20:04 Nerivec

I have now connected the SLZB-06P7 via USB. I turned off the Ethernet connection. Installed the recommended Silabs driver and turned off all power-saving features on USB. After 8 hours, at 1:59 a.m., Z2M made a restart again.

log.log

TomKassel avatar Apr 09 '25 07:04 TomKassel

Can you check in right click on This PC > Manage > System Tools > Event Viewer > Windows Logs:

  • System logs
  • Application logs

for each: Filter Current Logs > 1:54 AM to 2:04AM (5min before/after) > Save Filtered Log File As.

Nerivec avatar Apr 09 '25 09:04 Nerivec

In the time from 1:54 to 2:04 there are no (!) Entries in the logs. Neither in the application log nor in the system log.

TomKassel avatar Apr 09 '25 10:04 TomKassel

Can you use the console to start Z2M and disable the watchdog so that Z2M doesn't restart automatically on next crash? Maybe we can finally get the actual error in the console when it stops...

Nerivec avatar Apr 09 '25 11:04 Nerivec

Please don't laugh, but Z2M is started by Homeseer for me. How do I get into the console, how do I launch it from there, and how do I turn off watchdog?

TomKassel avatar Apr 09 '25 12:04 TomKassel