# Postgres Node Connection refused error

**URL:** <https://community.n8n.io/t/postgres-node-connection-refused-error/82137>\
**Category:** Questions\
**Created:** [February 26, 2025, 1:45pm UTC](https://community.n8n.io/t/postgres-node-connection-refused-error/82137 "2025-02-26T13:45:48Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kratik\_Mehta](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/kratik_mehta/32/29065_2.png) [@Kratik\_Mehta](https://community.n8n.io/u/Kratik_Mehta)\
**Post date:** [February 26, 2025, 1:45pm UTC](https://community.n8n.io/t/postgres-node-connection-refused-error/82137/1 "2025-02-26T13:45:48Z")

</div>

## Describe the problem/error/question

We have multiple workflows that use a Postgres node to read or write data from a database. The nodes were working fine before we upgraded the n8n version to 1.78.1. After upgrading, the node throws a Connection refused or Connection Terminated Unexpectedly error. The workflow linked here uses a Loop. The postgres node works fine for a couple hundred iterations but errors out unexpectedly in the middle.

## What is the error message (if any)?

Connection refused  
127.0.0.1:34827

## Please share your workflow

## Share the output returned by the last node

## Information on your n8n setup

- **n8n version:** 1.78.1
- **Database (default: SQLite):**
- **n8n EXECUTIONS\_PROCESS setting (default: own, main):**
- **Running n8n via (Docker, npm, n8n cloud, desktop app):** n8n cloud
- **Operating system:**

---

<div class="post-metadata">

**Author:** ![hubschrauber](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/hubschrauber/32/46788_2.png) [@hubschrauber](https://community.n8n.io/u/hubschrauber)\
**Post date:** [February 26, 2025, 2:49pm UTC](https://community.n8n.io/t/postgres-node-connection-refused-error/82137/2 "2025-02-26T14:49:57Z")

</div>

This is just a wild guess, but there’s a chance this is related to a [recent change](https://github.com/n8n-io/n8n/commit/35cb10c5e76d439ad484c549d542bdc97fe4a3ab) in the Postgres Credentials item that sets maxConnections (presumably to control a pooled connection count).

Open your Postgres credentials node and if the `Maximum Number of Connections` parameter is there, defaulted to `100`, you might try increasing **OR decreasing** that to see if that affects how your workflow execution goes.

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/f/8/f805c2a0602c44bb19a134946ebd130f75ae9541.png)

---

<div class="post-metadata">

**Author:** ![dahmadi](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/dahmadi/32/27193_2.png) [@dahmadi](https://community.n8n.io/u/dahmadi)\
**Post date:** [February 26, 2025, 7:35pm UTC](https://community.n8n.io/t/postgres-node-connection-refused-error/82137/3 "2025-02-26T19:35:34Z")

</div>

Thank you, we tried both increasing and decreasing the maximum number of connections and still receive the same errors. It seems as if it may be related to the following issue? [Postgres node with ssh tunnel - random Connection refused · Issue #12807 · n8n-io/n8n · GitHub](https://github.com/n8n-io/n8n/issues/12807)

We do connect to the DB via SSH tunneling. Any other recommendations? This has affected several of our workflows that interact with Postgres. And the errors did begin immediately after upgrading the n8n cloud version. Thank you.

---

<div class="post-metadata">

**Author:** ![dahmadi](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/dahmadi/32/27193_2.png) [@dahmadi](https://community.n8n.io/u/dahmadi)\
**Post date:** [February 27, 2025, 4:23am UTC](https://community.n8n.io/t/postgres-node-connection-refused-error/82137/4 "2025-02-27T04:23:00Z")

</div>

@hubschrauber - I also did verify that our max\_connections on postgres is \> 100

Please let us know if it is possible to downgrade the instance version, if a fix/update is not coming soon. Thanks for your help.

---

<div class="post-metadata">

**Author:** ![hubschrauber](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/hubschrauber/32/46788_2.png) [@hubschrauber](https://community.n8n.io/u/hubschrauber)\
**Post date:** [February 27, 2025, 5:19am UTC](https://community.n8n.io/t/postgres-node-connection-refused-error/82137/5 "2025-02-27T05:19:06Z")

</div>

I don’t work for n8n, so I don’t have the “inside track” on what your options would be for downgrading or what the development schedule would be. Tagging @Jon to be sure it gets on someone’s radar though.

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [February 27, 2025, 3:26pm UTC](https://community.n8n.io/t/postgres-node-connection-refused-error/82137/6 "2025-02-27T15:26:14Z")

</div>

At the moment there is no workaround that I can think of other than maybe trying a retry, The good news is this issue is say in our “To pick up” queue so should be fixed soon.

For now you could try emailing [help@n8n.io](mailto:help@n8n.io) to see if we can restore the old version of n8n for you.

---

<div class="post-metadata">

**Author:** ![dahmadi](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/dahmadi/32/27193_2.png) [@dahmadi](https://community.n8n.io/u/dahmadi)\
**Post date:** [March 18, 2025, 4:21pm UTC](https://community.n8n.io/t/postgres-node-connection-refused-error/82137/7 "2025-03-18T16:21:34Z")

</div>

Hi @Jon - do you know if this fix is in the near-term pipeline? Any workflows with Postgres that run over a certain period of time requires us to chunk apart and run manually multiple times (each time requires us to restart n8n or modify the Postgres connection to release the connection, it seems)

I don’t want to rollback our environment version because we have updated several workflows to use the Postgres v2.5 node and am not sure what would happen if we rollback since I believe the prior node version we were using was 2.3. Thanks.

---

<div class="post-metadata">

**Author:** ![mariana-na](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mariana-na/32/40200_2.png) [@mariana-na](https://community.n8n.io/u/mariana-na)\
**Post date:** [March 27, 2025, 11:55am UTC](https://community.n8n.io/t/postgres-node-connection-refused-error/82137/8 "2025-03-27T11:55:56Z")

</div>

Hi @dahmadi  
This issue is still under our “to pick up” label and hopefully it won’t take too long for us to have a fix for it, but we’re not quite there yet.

If you change your mind and want to be rolled back let me know!

---

<div class="post-metadata">

**Author:** ![Jannik\_Z](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jannik_z/32/82912_2.png) [@Jannik\_Z](https://community.n8n.io/u/Jannik_Z)\
**Post date:** [May 21, 2025, 1:11pm UTC](https://community.n8n.io/t/postgres-node-connection-refused-error/82137/9 "2025-05-21T13:11:00Z")

</div>

Hi @mariana-na are there any updates from your end? This is blocking us really hard. We are also happy to contribute or spend some money on it to have it fixed ASAP… please let me know, how to continue here.

---

<div class="post-metadata">

**Author:** ![mariana-na](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mariana-na/32/40200_2.png) [@mariana-na](https://community.n8n.io/u/mariana-na)\
**Post date:** [May 22, 2025, 10:17am UTC](https://community.n8n.io/t/postgres-node-connection-refused-error/82137/10 "2025-05-22T10:17:40Z")

</div>

Hi @Jannik_Z ,

I’m sorry to hear that this is blocking you so much!  
We’re working to get to it asap within our other ongoing priorities.  
As it stands, we aim to get to this issue before the end of the quarter, hopefully this month, although it’s not a promise.

I’ll keep you updated!

We did release a small option to allow setting the timeout to something longer, hoping to aleviate early crashes: [feat(core): Add a new option to customize SSH tunnel idle timeout by netroy · Pull Request #14522 · n8n-io/n8n · GitHub](https://github.com/n8n-io/n8n/pull/14522)

---

<div class="post-metadata">

**Author:** ![mariana-na](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mariana-na/32/40200_2.png) [@mariana-na](https://community.n8n.io/u/mariana-na)\
**Post date:** [June 18, 2025, 11:17am UTC](https://community.n8n.io/t/postgres-node-connection-refused-error/82137/11 "2025-06-18T11:17:31Z")

</div>

Hi everyone!

A fix has recently been released for this in v.1.99.0 🎉 [https://github.com/n8n-io/n8n/pull/16054](https://github.com/n8n-io/n8n/pull/16054)

This is still a beta version, but it will be moved to stable next week, if you’d rather wait.

Do let us know if you see any issues/errors here. And thanks a lot for the wait! :n8n:

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [September 16, 2025, 11:17am UTC](https://community.n8n.io/t/postgres-node-connection-refused-error/82137/12 "2025-09-16T11:17:56Z")

</div>

Closed on September 16, 2025, 11:17am UTC

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