Self-hosted AI starter kit (There was an error initializing DB connect ECONNREFUSED 10.89.0.79:5432)

I’m trying to run Self-hosted AI starter kit (GitHub - n8n-io/self-hosted-ai-starter-kit: The Self-hosted AI Starter Kit is an open-source template that quickly sets up a local AI environment. Curated by n8n, it provides essential tools for creating secure, self-hosted AI workflows.) but I’m getting the following message that wont let N8N start:

Permissions 0644 for n8n settings file /home/node/.n8n/config are too wide. This is ignored for now, but in the future n8n will attempt to change the permissions automatically. To automatically enforce correct permissions now set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true (recommended), or turn this check off set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=false.
There was an error initializing DB
connect ECONNREFUSED 10.89.0.79:5432

This is from the logs file:

Error: Database is uninitialized and superuser password is not specified.
You must specify POSTGRES_PASSWORD to a non-empty value for the
superuser. For example, “-e POSTGRES_PASSWORD=password” on “docker run”.

   You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
   connections without a password. This is *not* recommended.

   See PostgreSQL documentation about "trust":
   https://www.postgresql.org/docs/current/auth-trust.html

This is the ps list

If I try to connect to postgres server using the credentials in the .env file it does connect from an external client:

How can I fix this issue?

hello @azazel_xes

I’m not quite sure, but I don’t see that the env file is added to the postgres service. Setting it for the n8n means it will connect to the DB with that variables, but it doesn’t do anything with the DB itself.

Hi,

it is normal you cannot connect with an external tool with a default config. If you want to connect with an external tool to the postgres instance you need to map the port 5432 to the outside with the docker compose.

regarding the errors i would propose to launch with docker-compose up so you can see the logs of all the services during startup.

The only thing i can think of is that when you downloaded the docker compose, there is an init-db script maybe which should be in LF endings. otherwise the db init fails, and i guess thats what happened. but you will see that in the output on startup