Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.74.0 - PostgreSQL - Cannot use a pool after calling end on the pool #12517

Closed
kuzzmi opened this issue Jan 8, 2025 · 13 comments · Fixed by #12484 or #12674
Closed

1.74.0 - PostgreSQL - Cannot use a pool after calling end on the pool #12517

kuzzmi opened this issue Jan 8, 2025 · 13 comments · Fixed by #12484 or #12674
Labels
in linear Issue or PR has been created in Linear for internal review

Comments

@kuzzmi
Copy link

kuzzmi commented Jan 8, 2025

Bug Description

After upgrading self-hosted version to 1.74.0 (to have a fix for PG connection issues, so I can add a lot of data at once), I see other issues:

{
  "errorMessage": "Cannot use a pool after calling end on the pool",
  "errorDescription": "Cannot use a pool after calling end on the pool",
  "errorDetails": {},
  "n8nDetails": {
    "time": "08/01/2025, 19:56:42",
    "n8nVersion": "1.74.0 (Self Hosted)",
    "binaryDataMode": "default",
    "cause": {}
  }
}

To Reproduce

After X minutes of establishing the first connection, all PG nodes fail with provided error message.

Expected behavior

When pool is closed, reopen a new pool.

Operating System

Debian 12

n8n Version

1.74.0

Node.js Version

v20.18.1

Database

SQLite (default)

Execution mode

main (default)

@Joffcom
Copy link
Member

Joffcom commented Jan 8, 2025

Hey @kuzzmi,

We have created an internal ticket to look into this which we will be tracking as "N8N-8064"

@Joffcom Joffcom added the in linear Issue or PR has been created in Linear for internal review label Jan 8, 2025
@kuzzmi
Copy link
Author

kuzzmi commented Jan 9, 2025

Realized that this happens much much more often with Postgres as a chat memory. If I find anything more useful, will append to the issue..

@neilsonsdsouza
Copy link

Same problem

@neilsonsdsouza
Copy link

When I use the version prior to 1.74 this error does not appear

@ams330dev
Copy link

Same issue for me as well, after update with the chat memory node. Had to return to window buffer memory.

@g-roliveira
Copy link

g-roliveira commented Jan 13, 2025

I am facing the same issue when using **PostgresChatMemory** in an AI agent with pre-release version 1.74.1. The issue does not occur in version 1.73.

Issue details:

On the first interaction, the connection is opened and works correctly.
On subsequent interactions, the connection cannot be used, apparently due to issues with reusing the connection pool.

Steps to reproduce:

Set up anAI agentusing PostgresChatMemory.
Run the first interaction (it works fine).
Try to run additional interactions (fails to reuse the connection pool).

Environment:

Version: 1.74.1 (pre-release)

Expected behavior:

The connection pool should be reused correctly in all interactions.

Current behavior:

Only the first interaction works; subsequent interactions fail when trying to reuse the connection pool.

Additional information:

This issue does not occur in version 1.73.
The problem is suspected to be related to connection pool management in the new version.

@netroy
Copy link
Member

netroy commented Jan 14, 2025

This will likely be fixed in #12484.

@netroy
Copy link
Member

netroy commented Jan 17, 2025

Can you folks try upgrading to 1.74.2 or 1.75.1 🙏🏽

@kuzzmi
Copy link
Author

kuzzmi commented Jan 17, 2025

@netroy Just installed 1.75.1, will see how it goes. Thanks folks for addressing that!

@diegoele
Copy link

Still not working for me in version 1.75.1

@g-roliveira
Copy link

The problem still persists for me in version 1.74.2 and 1.75.1

@netroy
Copy link
Member

netroy commented Jan 17, 2025

Please try upgrading to 1.74.3 or 1.75.2 🙏🏽

@g-roliveira
Copy link

Validated using 1.74.3 - It works!
Validated using 1.75.2 - It works!

Great job, guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in linear Issue or PR has been created in Linear for internal review
Projects
None yet
7 participants