# Error starting Z2m

**URL:** <https://community.gladysassistant.com/t/erreur-demarrage-z2m/10049>\
**Category:** Configuration\
**Created:** [February 23, 2026, 7:10pm UTC](https://community.gladysassistant.com/t/erreur-demarrage-z2m/10049 "2026-02-23T19:10:12Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcmoriaud](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/jcmoriaud/32/20053_2.png) [@jcmoriaud](https://community.gladysassistant.com/u/jcmoriaud)\
**Post date:** [February 23, 2026, 7:10pm UTC](https://community.gladysassistant.com/t/erreur-demarrage-z2m/10049/1 "2026-02-23T19:10:12Z")

</div>

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… 😜 and so when I restart everything, I now have:

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

---

<div class="post-metadata">

**Author:** ![mutmut](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mutmut/32/14064_2.png) [@mutmut](https://community.gladysassistant.com/u/mutmut)\
**Post date:** [February 23, 2026, 7:49pm UTC](https://community.gladysassistant.com/t/erreur-demarrage-z2m/10049/2 "2026-02-23T19:49:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jcmoriaud](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/jcmoriaud/32/20053_2.png) [@jcmoriaud](https://community.gladysassistant.com/u/jcmoriaud)\
**Post date:** [February 23, 2026, 8:16pm UTC](https://community.gladysassistant.com/t/erreur-demarrage-z2m/10049/3 "2026-02-23T20:16:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mutmut](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mutmut/32/14064_2.png) [@mutmut](https://community.gladysassistant.com/u/mutmut)\
**Post date:** [February 23, 2026, 8:32pm UTC](https://community.gladysassistant.com/t/erreur-demarrage-z2m/10049/4 "2026-02-23T20:32:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jcmoriaud](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/jcmoriaud/32/20053_2.png) [@jcmoriaud](https://community.gladysassistant.com/u/jcmoriaud)\
**Post date:** [February 23, 2026, 10:44pm UTC](https://community.gladysassistant.com/t/erreur-demarrage-z2m/10049/5 "2026-02-23T22:44:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jcmoriaud](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/jcmoriaud/32/20053_2.png) [@jcmoriaud](https://community.gladysassistant.com/u/jcmoriaud)\
**Post date:** [February 24, 2026, 9:04am UTC](https://community.gladysassistant.com/t/erreur-demarrage-z2m/10049/6 "2026-02-24T09:04:26Z")

</div>

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:

 ![Web_Photo_Editor](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/b/e/be005cb093a76b417eac8dcfd57711fb85a1c364.jpeg)

What should I do?

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [February 24, 2026, 4:29pm UTC](https://community.gladysassistant.com/t/erreur-demarrage-z2m/10049/7 "2026-02-24T16:29:05Z")

</div>

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:

```auto
sudo docker ps -a

```

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

```auto
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 🙂

---

<div class="post-metadata">

**Author:** ![jcmoriaud](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/jcmoriaud/32/20053_2.png) [@jcmoriaud](https://community.gladysassistant.com/u/jcmoriaud)\
**Post date:** [February 24, 2026, 5:44pm UTC](https://community.gladysassistant.com/t/erreur-demarrage-z2m/10049/8 "2026-02-24T17:44:44Z")

</div>

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

 ![Screenshot From 2026-02-24 18-32-44](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/7/4/74c8073f54876d7d30bcf7283f3989da24ce2abb.png)

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

 ![Screenshot From 2026-02-24 18-41-36](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/7/5/75add18218ee563db947475032a195f1429e6049.png)

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…

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [February 24, 2026, 6:04pm UTC](https://community.gladysassistant.com/t/erreur-demarrage-z2m/10049/9 "2026-02-24T18:04:22Z")

</div>

Is the mosquitto container dedicated to Zigbee2mqtt up?

Check its logs to see what’s wrong

---

<div class="post-metadata">

**Author:** ![jcmoriaud](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/jcmoriaud/32/20053_2.png) [@jcmoriaud](https://community.gladysassistant.com/u/jcmoriaud)\
**Post date:** [February 24, 2026, 6:48pm UTC](https://community.gladysassistant.com/t/erreur-demarrage-z2m/10049/10 "2026-02-24T18:48:32Z")

</div>

The containers are all up:

 ![Screenshot From 2026-02-24 19-45-44](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/c/7/c75060ec339c04ab2572763172b095559763bf57.png)

the logs:

 ![Screenshot From 2026-02-24 19-46-44](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/a/3/a30da0a663684fb01461fc6ff8114b922eb4eea9.png)

and

 ![Screenshot From 2026-02-24 19-47-44](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/1/d/1d062646d006a807970a6a2390536780fe2ecf32.png)

I can see the errors clearly… but after that…

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [February 24, 2026, 6:55pm UTC](https://community.gladysassistant.com/t/erreur-demarrage-z2m/10049/11 "2026-02-24T18:55:13Z")

</div>

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

I think you told me you had deleted the entire «&nbsp;zigbee2mqtt&nbsp;» folder, didn’t you? 😅

Have you tried disabling the

---

<div class="post-metadata">

**Author:** ![jcmoriaud](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/jcmoriaud/32/20053_2.png) [@jcmoriaud](https://community.gladysassistant.com/u/jcmoriaud)\
**Post date:** [February 24, 2026, 7:33pm UTC](https://community.gladysassistant.com/t/erreur-demarrage-z2m/10049/12 "2026-02-24T19:33:19Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [February 24, 2026, 7:34pm UTC](https://community.gladysassistant.com/t/erreur-demarrage-z2m/10049/13 "2026-02-24T19:34:48Z")

</div>

Excellent !! That’s great !
