Hosted PostgreSQL Connection Refused

Describe the problem/error/question

Hi!

I get this error message when trying to create the credentials of the Postgres account. I’m trying to connect to a Chatwoot database:

{
“errorMessage”: “connect ECONNREFUSED ::1:5432”,
“errorDetails”: {},
“n8nDetails”: {
“n8nVersion”: “1.58.2 (Self Hosted)”,
“binaryDataMode”: “default”,
“stackTrace”: [
“Error: connect ECONNREFUSED ::1:5432”,
" at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1606:16)"
]
}
}

I got the PostgreSQL hosted (not in docker)

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.58.2
  • Database (default: SQLite): PostgreSQL
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Ubuntu 22.04

Hey @Allan_Montero,

Welcome to the community :wave:

It looks like you are using localhost which likely won’t work as that is the containers localhost and not the hosts localhost. Try using the ip of your host or give 172.17.0.1 a go assuming you are using the default network settings for Docker.

Hi Jon, thanks for your help.

I’ve tried with the 172.17.0.1 too, and still getting the same error.

¿Could it be something else?

I still getting the error. Someone can help?

Hey @Allan_Montero,

Have you tried using the actual ip for the machine running Postgres? You will need to make sure that Postgres is configured to allow remote connections.

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