# MQTT connection breaks when deploying, re-established when deploying again

**URL:** <https://discourse.nodered.org/t/mqtt-connection-breaks-when-deploying-re-established-when-deploying-again/78350>\
**Category:** General\
**Created:** [11 May 2023 09:11 UTC](https://discourse.nodered.org/t/mqtt-connection-breaks-when-deploying-re-established-when-deploying-again/78350 "2023-05-11T09:11:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dieterbk](https://avatars.discourse-cdn.com/v4/letter/d/5daacb/32.png) [@dieterbk](https://discourse.nodered.org/u/dieterbk)\
**Post date:** [11 May 2023 09:11 UTC](https://discourse.nodered.org/t/mqtt-connection-breaks-when-deploying-re-established-when-deploying-again/78350/1 "2023-05-11T09:11:11Z")

</div>

I have a simple MQTT-IN, with a function behind it. So far everything works as well.

But when I change the function and deploy everything, the MQTT connection breaks and does not come back.

If I now change the function again (even if it is only an inserted space), deploy everything again, so the connection is re-established.

MQTT connection is Qs0, no TLS etc.

Any idea what this could be due to (current NodeRed version) or where I could look further?

---

<div class="post-metadata">

**Author:** ![dieterbk](https://avatars.discourse-cdn.com/v4/letter/d/5daacb/32.png) [@dieterbk](https://discourse.nodered.org/u/dieterbk)\
**Post date:** [11 May 2023 10:39 UTC](https://discourse.nodered.org/t/mqtt-connection-breaks-when-deploying-re-established-when-deploying-again/78350/2 "2023-05-11T10:39:46Z")

</div>

After searching a little bit deeper I found the following:

[MQTT not reconnecting on edit if only only one mqtt node using the config node #3927](https://discourse.nodered.org/t/mqtt-not-reconnecting-if-only-only-one-mqtt-node-using-it/69381)

This is a known bug and already fixed (hopefully will be released in the next version)

After adding a second MQTT node it is working as expected, MQTT connection is stable after deploying

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [25 May 2023 10:40 UTC](https://discourse.nodered.org/t/mqtt-connection-breaks-when-deploying-re-established-when-deploying-again/78350/3 "2023-05-25T10:40:22Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
