# MQTT in node not working properly in Node-Red 2.2.1

**URL:** <https://discourse.nodered.org/t/mqtt-in-node-not-working-properly-in-node-red-2-2-1/58428>\
**Category:** General\
**Tags:** mqtt\
**Created:** [16 February 2022 00:35 UTC](https://discourse.nodered.org/t/mqtt-in-node-not-working-properly-in-node-red-2-2-1/58428 "2022-02-16T00:35:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![JmmyGun](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jmmygun/32/45761_2.png) [@JmmyGun](https://discourse.nodered.org/u/JmmyGun)\
**Post date:** [16 February 2022 00:35 UTC](https://discourse.nodered.org/t/mqtt-in-node-not-working-properly-in-node-red-2-2-1/58428/1 "2022-02-16T00:35:37Z")

</div>

Hi all.

I've a problem with MQTT in node I use mosquitto.  
When i make full deploy (ex. move MQTT in node) I get this error back on the debug console,  
"Error stopping node: Close timed out"

mosquitto version 2.0.11  
mosquitto is an MQTT v5.0/v3.1.1/v3.1 broker.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [16 February 2022 00:45 UTC](https://discourse.nodered.org/t/mqtt-in-node-not-working-properly-in-node-red-2-2-1/58428/2 "2022-02-16T00:45:02Z")

</div>

I got the same issue so I disabled all my mqtt nodes, deployed and re-enabled them. It deploys without the error now.  
Maybe this will work for you too?

Whoops, spoke too soon. It's back again!

```auto
Welcome to Node-RED
===================
16 Feb 00:45:40 - [info] Node-RED version: v2.2.1
16 Feb 00:45:40 - [info] Node.js version: v14.19.0
16 Feb 00:45:40 - [info] Linux 5.10.92-v7+ arm LE
16 Feb 00:45:41 - [info] Loading palette nodes
16 Feb 00:45:45 - [info] Dashboard version 3.1.5 started at /ui
16 Feb 00:45:46 - [info] Settings file : /home/pi/.node-red/settings.js
16 Feb 00:45:46 - [info] HTTP Static : /home/pi/.node-red/static
16 Feb 00:45:46 - [info] Context store : 'default' [module=memory]
16 Feb 00:45:46 - [info] User directory : /home/pi/.node-red
16 Feb 00:45:46 - [warn] Projects disabled : editorTheme.projects.enabled=false
16 Feb 00:45:46 - [info] Flows file : /home/pi/.node-red/flows.json
16 Feb 00:45:46 - [info] Server now running at http://127.0.0.1:1880/
16 Feb 00:45:46 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-g...
(snip)
---------------------------------------------------------------------
16 Feb 00:45:47 - [info] Starting flows
16 Feb 00:45:47 - [info] Started flows
16 Feb 00:45:47 - [info] [mqtt-broker:a6e18de3fc619133] Connected to broker: mqtt://192.168.1.11:1883
16 Feb 00:46:19 - [info] Stopping flows
16 Feb 00:46:34 - [error] [mqtt in:1eab723e3b975572] Error stopping node: Close timed out
16 Feb 00:46:34 - [info] Stopped flows

```

---

<div class="post-metadata">

**Author:** ![JmmyGun](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jmmygun/32/45761_2.png) [@JmmyGun](https://discourse.nodered.org/u/JmmyGun)\
**Post date:** [16 February 2022 01:04 UTC](https://discourse.nodered.org/t/mqtt-in-node-not-working-properly-in-node-red-2-2-1/58428/3 "2022-02-16T01:04:08Z")

</div>

after you reenable have you then tried to move a mqtt node and deploy it? I still have the same error now also on the mqtt output node

```auto
feb 16 02:05:29 amc Node-RED[1069]: 16 Feb 02:05:29 - [info] Stopping flows
feb 16 02:05:44 amc Node-RED[1069]: 16 Feb 02:05:44 - [error] [mqtt out:MONITOR:TX] Error stopping node: Close timed out
feb 16 02:05:45 amc Node-RED[1069]: 16 Feb 02:05:44 - [info] Stopped flows
feb 16 02:05:45 amc Node-RED[1069]: 16 Feb 02:05:44 - [info] Starting flows
feb 16 02:05:45 amc Node-RED[1069]: 16 Feb 02:05:45 - [info] Started flows

```

---

<div class="post-metadata">

**Author:** ![JmmyGun](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jmmygun/32/45761_2.png) [@JmmyGun](https://discourse.nodered.org/u/JmmyGun)\
**Post date:** [20 February 2022 17:47 UTC](https://discourse.nodered.org/t/mqtt-in-node-not-working-properly-in-node-red-2-2-1/58428/4 "2022-02-20T17:47:44Z")

</div>

Don't install any mqtt broker (ex. MOSQUITTO on my case) install only node red..

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [20 February 2022 20:04 UTC](https://discourse.nodered.org/t/mqtt-in-node-not-working-properly-in-node-red-2-2-1/58428/5 "2022-02-20T20:04:55Z")

</div>

> [@JmmyGun](#):
>
> Don't install any mqtt broker

Not installing an Mqtt broker ? what if you need it ? 😉  
an update of Node-red to 2.2.2 was released a couple of days ago  
addressing the "Error stopping node: Close timed out" issue.

Read here :

> [@tada Node-RED 2.2.2 released](https://discourse.nodered.org/t/node-red-2-2-2-released/58606):
>
> Node-RED 2.2.2 is now available. This has a single fix for a timeout issue with the MQTT nodes when deploying changes. A big thanks to @Steve-Mcl for tracking this one down.

---

<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:** [6 March 2022 20:05 UTC](https://discourse.nodered.org/t/mqtt-in-node-not-working-properly-in-node-red-2-2-1/58428/6 "2022-03-06T20:05:47Z")

</div>

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