# MongoDB node doesn't recover when mongo is restarted

**URL:** <https://discourse.nodered.org/t/mongodb-node-doesnt-recover-when-mongo-is-restarted/26604>\
**Category:** General\
**Created:** [13 May 2020 16:57 UTC](https://discourse.nodered.org/t/mongodb-node-doesnt-recover-when-mongo-is-restarted/26604 "2020-05-13T16:57:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cadu](https://avatars.discourse-cdn.com/v4/letter/c/45deac/32.png) [@cadu](https://discourse.nodered.org/u/cadu)\
**Post date:** [13 May 2020 16:57 UTC](https://discourse.nodered.org/t/mongodb-node-doesnt-recover-when-mongo-is-restarted/26604/1 "2020-05-13T16:57:16Z")

</div>

Hello!

I'm using node-red-node-mongodb which I believe is the default mongo node. When the mongo database gets restarted for whatever reason, it doesn't recover and throws the following error repeatedly:

"MongoError: Topology was destroyed"

Restarting the flow fixes the issue. It's the same as in here:

> <https://github.com/node-red/node-red-nodes/issues/540>
>
> Hello
> Node-Red engine is configured to collect data from a cloud MongoDB and it works usually but sometime it stops with error...

It seems it's possible to evade the issue by messing with the mongo client configurations like "socketTimeoutMS" and "keepAlive" by what I gathered but I couldn't find how to change these configurations in the node.

Does anyone know of a workaround? Thanks in advance.

---

<div class="post-metadata">

**Author:** ![cadu](https://avatars.discourse-cdn.com/v4/letter/c/45deac/32.png) [@cadu](https://discourse.nodered.org/u/cadu)\
**Post date:** [21 May 2020 20:08 UTC](https://discourse.nodered.org/t/mongodb-node-doesnt-recover-when-mongo-is-restarted/26604/2 "2020-05-21T20:08:46Z")

</div>

Hi, does anyone have at least a tip or a direction? This is a production problem for us in a covid-19 tracking application being used by the government in Brazil to help the population. If I'm asking in the wrong place or anything like that, please let me know.

Thank you

---

<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:** [20 July 2020 20:08 UTC](https://discourse.nodered.org/t/mongodb-node-doesnt-recover-when-mongo-is-restarted/26604/3 "2020-07-20T20:08:48Z")

</div>

Closed on 20 July 2020 20:08 UTC

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