Z2M crashing without restarting

Open
#33,682 6 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Active
Tech stack
docker, typescript
Domain
backend, devops

Research direction

Start by examining the shutdown log and the adapter disconnect handling; the report names Zigbee2MQTT 2.14.2, the zstack adapter, and a Sonoff Dongle-P, but gives no debug log or reproducible steps. Determine what causes the adapter to disconnect and the process to stop with restart=false; done means identifying a reproducible cause and a way to keep the service running or restart it.

Written by the indexing model from the issue text.

Description

problem
What happened?

Hi,

For the last couple of releases, Z2M has been crashing every few days. It';s exhausting having to constantly check it is running.

The final lines in the log are:

[2026-11-12 13:49:56] info: 	zh:zstack:znp: closing
[2026-11-12 13:49:56] error: 	z2m: Adapter disconnected, stopping
[2026-11-12 13:49:56] info: 	z2m: Stopping Zigbee2MQTT (restart=false, code=2, signal=undefined)
[2026-11-12 13:49:56] info: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload '{"state":"offline"}'
[2026-11-12 13:49:56] info: 	z2m: Disconnecting from MQTT server
[2026-11-12 13:49:56] info: 	z2m: Stopping zigbee-herdsman...
[2026-11-12 13:49:56] info: 	z2m: Stopped zigbee-herdsman
[2026-11-12 13:49:56] info: 	z2m: Stopped Zigbee2MQTT

To fix it I merely stop and restart the container:

docker compose down zigbee2mqtt
docker compose up -d

...I would mind as much if there was a way to automate Z2M restarting itself.

What did you expect to happen?

I expect Z2M to not stop or at least restart.

How to reproduce it (minimal and precise)

not a clue - it happens randomly every few days now.

Zigbee2MQTT version

2.14.2

Adapter firmware version

26.125.0

Adapter

Sonoff Dongle-P

Setup

Runs in docker on a Pi-5. I have been running Z2M stably for years until these recent releases.

Device database.db entry

No response

Debug log

No response

Notes

No response

Dominant language
TypeScript
Stars
15.8k
Forks
2.1k
Avg merge
1d 6h
Merged PRs (30d)
38

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Koenkk/zigbee2mqtt

All issues in Koenkk/zigbee2mqtt

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.