MQTT Client <unknown> closed its connection

I access my whole HA via the cloudflared addon.

Now that I want to switch from ZHA to Z2M I had to configure mqtt. Everything should work but the Zigbee2MQTT Addon doesn’t start.

[20:46:59] INFO: Preparing to start...
[20:46:59] INFO: Socat not enabled
[20:46:59] INFO: Starting Zigbee2MQTT...
Zigbee2MQTT:info  2024-04-29 20:47:01: Logging to console and directory: '/config/zigbee2mqtt/log/2024-04-29.20-47-01' filename: log.txt
Zigbee2MQTT:info  2024-04-29 20:47:01: Starting Zigbee2MQTT version 1.36.1 (commit #unknown)
Zigbee2MQTT:info  2024-04-29 20:47:01: Starting zigbee-herdsman (0.40.3)
Zigbee2MQTT:error 2024-04-29 20:48:07: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2024-04-29 20:48:07: Failed to start zigbee
Zigbee2MQTT:error 2024-04-29 20:48:07: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
Zigbee2MQTT:error 2024-04-29 20:48:07: Exiting...
Zigbee2MQTT:error 2024-04-29 20:48:07: Error: network commissioning timed out - most likely network with the same panId or extendedPanId already exists nearby
    at ZnpAdapterManager.beginCommissioning (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/manager.ts:347:23)
    at ZnpAdapterManager.start (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/manager.ts:92:17)
    at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:132:29)
    at Zigbee.start (/app/lib/zigbee.ts:62:27)
    at Controller.start (/app/lib/controller.ts:109:27)
    at start (/app/index.js:107:5)

When I go into MQTT log I Can see this:

2024-04-29 20:33:24: Saving in-memory database to /data//mosquitto.db.
2024-04-29 20:34:31: New connection from 172.30.32.2:38462 on port 1883.
2024-04-29 20:34:31: Client <unknown> closed its connection.
2024-04-29 20:36:31: New connection from 172.30.32.2:49270 on port 1883.
2024-04-29 20:36:31: Client <unknown> closed its connection.
2024-04-29 20:38:31: New connection from 172.30.32.2:56928 on port 1883.
2024-04-29 20:38:31: Client <unknown> closed its connection.
2024-04-29 20:40:31: New connection from 172.30.32.2:37126 on port 1883.
2024-04-29 20:40:31: Client <unknown> closed its connection.
2024-04-29 20:42:31: New connection from 172.30.32.2:60008 on port 1883.
2024-04-29 20:42:31: Client <unknown> closed its connection.
2024-04-29 20:44:31: New connection from 172.30.32.2:38166 on port 1883.
2024-04-29 20:44:31: Client <unknown> closed its connection.
2024-04-29 20:46:31: New connection from 172.30.32.2:60902 on port 1883.
2024-04-29 20:46:31: Client <unknown> closed its connection.

Tells me, that Z2M really tries to connect but mqtt doesnt allow it because the signal comes from outside.

How can I achieve that Z2M only tries to connect via the local network?

Did you notice this?


Zigbee2MQTT:error 2024-04-29 20:48:07: Error: network commissioning timed out - most likely network with the same panId or extendedPanId already exists nearby

The 172.30.32.2 IP is not external, it’s a docker related private IP.

That is supervisor checking if the mqtt add-on is still running, nothing to do with Zigbee2MQTT

This means a network is already running with the same pan_id/extended_pan_id, using a different zigbee channel should fix the issue: Zigbee network | Zigbee2MQTT

If it doesn’t, see Zigbee2MQTT fails to start | Zigbee2MQTT