Error starting Z2m

Good evening,

I had to move my server and when putting it back together, I must have plugged my Sonoff dongle into the wrong USB port… :winking_face_with_tongue: and so when I restart everything, I now have:

Gladys log:
![Screenshot From 2026-02-23 20-05-42|690x183](upload://1L7VKK30czqT0xi5P9t78pgF0wv

hello,
on Gladys’ side it talks about zstack as the driver, isn’t your dongle normally ezspou ember?

Thanks for the reply but I haven’t changed anything at all, except that I think I reconnected the dongle to another USB port. Then I put it back on the original USB port and redid the configuration.

I won’t be able to help you, unfortunately, because I’m on SMLIGHT via Ethernet and not USB, so I have little knowledge of these issues.

1 Like

Well then, tonight I’m going to turn everything off by hand :winking_face_with_tongue:

I really need help, thanks in advance.

What I don’t understand in the logs is:

  1. container already stopped
  2. container with USB dongle path /dev/ttyUSB1 should be removed

2026-02-24T09:59:58+0100 installMqttContainer.js:114 (Zigbee2mqttManager.installMqttContainer) MQTT broker container successfully started
2026-02-24T09:59:58+0100 installZ2mContainer.js:34 (Zigbee2mqttManager.installZ2mContainer) Zigbee2mqtt container with USB dongle path /dev/ttyUSB1 should be removed (new USB dongle path /dev/ttyUSB0 configured)…
2026-02-24T09:59:58+0100 errorMiddleware.js:68 (errorMiddleware) Error: (HTTP code 304) container already stopped -

given that:

What should I do?

Hi @jcmoriaud,

The logs indicate that Gladys is trying to stop the container to modify the configuration with the new USB port, but the container is already stopped and apparently Gladys doesn’t like that.

To see the containers on your machine, including stopped ones, you can run:

sudo docker ps -a

If the gladys-z2m-zigbee2mqtt container is present and stopped, you can run:

sudo docker rm gladys-z2m-zigbee2mqtt

This will remove the Zigbee2mqtt container and resolve the issue.

Then, go back to the interface and re-activate the integration, which should start a container with the correct USB port!

Let us know if you encounter another error after that :slight_smile:

So indeed I saw the container as « exited » with « ps -a ». I therefore did an rm and it started again :

However, I no longer have a link between the 3 containers :

and I have this in the logs :

\u003e 2026-02-24 17:42:14\] info: \tz2m: Currently 10 devices are joined.
\u003e \[2026-02-24 17:42:14\] info: \tz2m: Connecting to MQTT server at mqtt://localhost:1884
\u003e \[2026-02-24 17:42:14\] error: \tz2m: MQTT failed to connect, exiting… (connect ECONNREFUSED 127.0.0.1:1884)

et:

\u003e
\u003e 026-02-24T18:35:59+0100 \u003cwarn\u003e scene.actions.js:192 () BadParameters [Error]: Zigbee2mqtt expose not found: "zigbee2mqtt:0xa4c138db0c5ad722:switch:binary:state" with property "state"
\u003e at Zigbee2mqttManager.setValue (/src/server/services/zigbee2mqtt/lib/setValue.js:38:11)
\u003e at DeviceManager.setValue (/src/server/lib/device/device.setValue.js:22:24)
\u003e at /src/server/lib/scene/scene.actions.js:190:27
\u003e at tryCatcher (/src/server/node_modules/bluebird/js/release/util.js:16:23)
\u003e at MappingPromiseArray._promiseFulfilled (/src/server/node_modules/bluebird/js/release/map.js:68:38)
\u003e at MappingPromiseArray.PromiseArray._iterate (/src/server/node_modules/bluebird/js/release/promise_array.js:115:31)
\u003e at MappingPromiseArray.init (/src/server/node_modules/bluebird/js/release/promise_array.js:79:10)
\u003e at MappingPromiseArray._asyncInit (/src/server/node_modules/bluebird/js/release/map.js:37:10)
\u003e at _drainQueueStep (/src/server/node_modules/bluebird/js/release/async.js:97:12)
\u003e at _drainQueue (/src/server/node_modules/bluebird/js/release/async.js:86:9)
\u003e at Async._drainQueues (/src/server/node_modules/bluebird/js/release/async.js:102:5)
\u003e at Immediate.Async.drainQueues (/src/server/node_modules/bluebird/js/release/async.js:15:14)
\u003e at processImmediate (node:internal/timers:485:21)
\u003e 2026-02-24T18:36:00+0100 \u003cwarn\u003e connect.js:46 (MqttClient.\u003canonymous\u003e) Error while connecting to MQTT - Error: connect ECONNREFUSED 127.0.0.1:1884
\u003e 2026-02-24T18:36:05+0100 \u003cwarn\u003e connect.js:46 (MqttClient.\u003canonymous\u003e) Error while connecting to MQTT - Error: connect ECONNREFUSED 127.0.0.1:1884
\u003e 2026-02-24T18:36:10+0100 \u003cwarn\u003e connect.js:46 (MqttClient.\u003canonymous\u003e) Error while connecting to MQTT - Error: connect ECONNREFUSED 127.0.0.1:1884

I’ll check the firewall…

Is the mosquitto container dedicated to Zigbee2mqtt up?

Check its logs to see what’s wrong

The containers are all up:

the logs:

and

I can see the errors clearly… but after that…

The container « mosquitto » keeps restarting because it can’t find its configuration file.

I think you told me you had deleted the entire « zigbee2mqtt » folder, didn’t you? :sweat_smile:

Have you tried disabling the

Yes, I had indeed removed the container.

I repeated the sequence as indicated and it’s all good! Great, thanks!!!

I’m asking the question at the risk of saying something stupid… but could this situation, if it sometimes happens (I can’t imagine I’m the only one…), be resolved automatically?

1 Like

Excellent !! That’s great !

1 Like