# Neo4jError: Pool is closed, it is no more able to serve requests

**URL:** <https://discourse.nodered.org/t/neo4jerror-pool-is-closed-it-is-no-more-able-to-serve-requests/74250>\
**Category:** General\
**Created:** [27 January 2023 10:13 UTC](https://discourse.nodered.org/t/neo4jerror-pool-is-closed-it-is-no-more-able-to-serve-requests/74250 "2023-01-27T10:13:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![flipzz](https://avatars.discourse-cdn.com/v4/letter/f/bb73d2/32.png) [@flipzz](https://discourse.nodered.org/u/flipzz)\
**Post date:** [27 January 2023 10:13 UTC](https://discourse.nodered.org/t/neo4jerror-pool-is-closed-it-is-no-more-able-to-serve-requests/74250/1 "2023-01-27T10:13:14Z")

</div>

Hi,

I am using node-red-contrib-neo4j-bolt to create new entries in neo4j. After Node RED has been running for a while I get this error message: "Neo4jError: Pool is closed, it is no more able to serve requests.".

Any ideas on how to find a solution to this problem? I have looked at the modules github page but there seem to not be any ways to submit issues so I might need to do a bit more debugging here myself.

---

<div class="post-metadata">

**Author:** ![flipzz](https://avatars.discourse-cdn.com/v4/letter/f/bb73d2/32.png) [@flipzz](https://discourse.nodered.org/u/flipzz)\
**Post date:** [27 January 2023 10:29 UTC](https://discourse.nodered.org/t/neo4jerror-pool-is-closed-it-is-no-more-able-to-serve-requests/74250/2 "2023-01-27T10:29:17Z")

</div>

I managed to catch the error but not sure what to do about it:

```auto
Neo4jError: Pool is closed, it is no more able to serve requests.

    at captureStacktrace (/data/node_modules/neo4j-driver-core/lib/result.js:239:17)
    at new Result (/data/node_modules/neo4j-driver-core/lib/result.js:59:23)
    at Session._run (/data/node_modules/neo4j-driver-core/lib/session.js:174:16)
    at Session.run (/data/node_modules/neo4j-driver-core/lib/session.js:139:21)
    at Neo4jBolt._inputCallback (/data/node_modules/node-red-contrib-neo4j-bolt/neo4j.js:78:21)
    at /usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:210:26
    at Object.trigger (/usr/src/node-red/node_modules/@node-red/util/lib/hooks.js:166:13)
    at Neo4jBolt.Node._emitInput (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:202:11)
    at Neo4jBolt.Node.emit (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:186:25)
    at Neo4jBolt.Node.receive (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:485:10)

```

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [27 January 2023 12:18 UTC](https://discourse.nodered.org/t/neo4jerror-pool-is-closed-it-is-no-more-able-to-serve-requests/74250/3 "2023-01-27T12:18:22Z")

</div>

Hi @flipzz

I don't know this node or the framework, but looking at it, I come to this conclusion.

The node does close connections when the node its self is removed/restarted - That's Good!  
although the `close()` method is a `promise`, so ideally needs to be awaited, I don't think that will stop it from closing however.

```auto
node.on('close', function () {
      session.close()
      driver.close()
 })

```

But one thing I don't see, and that is the node recovering from a remote disconnect.

Once a remote disconnected has happened - the node is not aware, and the moment you attempt to write - Big booms will happens

Trouble starts here.

`at Neo4jBolt._inputCallback (/data/node_modules/node-red-contrib-neo4j-bolt/neo4j.js:78:21)`

Big booms here

> <https://github.com/webmaxru/node-red-contrib-neo4j-bolt/blob/687081867530073ee3994ae8f157b00b1d2e7359/neo4j.js#L78>

You are seeing it in the debug panel because the promise is failing and the error is being returned

> <https://github.com/webmaxru/node-red-contrib-neo4j-bolt/blob/687081867530073ee3994ae8f157b00b1d2e7359/neo4j.js#L104>

The dev should add some recovery, to guard against the remote side closing the connection  
I could be wrong of course - but that's all I have 😅

---

<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:** [28 March 2023 12:18 UTC](https://discourse.nodered.org/t/neo4jerror-pool-is-closed-it-is-no-more-able-to-serve-requests/74250/4 "2023-03-28T12:18:36Z")

</div>

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