15 days ago
I experience constant crashes from n8n, I don't understand what this log mean. Can you help me with it?
Connection terminated due to connection timeout
Connection terminated unexpectedly
There was an error initializing DB
at Object.init (/usr/local/lib/node_modules/n8n/dist/db.js:57:21)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at Start.init (/usr/local/lib/node_modules/n8n/dist/commands/base-command.js:119:9)
at Start.init (/usr/local/lib/node_modules/n8n/dist/commands/start.js:165:9)
at run (/usr/local/lib/node_modules/n8n/node_modules/@oclif/core/lib/main.js:94:16)
at /usr/local/lib/node_modules/n8n/bin/n8n:70:2
Connection terminated due to connection timeout
Connection terminated unexpectedly
User settings loaded from: /home/node/.n8n/config
Last session crashed
Initializing n8n process
There was an error initializing DB
Error: Could not establish database connection within the configured timeout of 20,000 ms. Please ensure the database is configured correctly and the server is reachable. You can increase the timeout by setting the 'DB_POSTGRESDB_CONNECTION_TIMEOUT' environment variable.
at Object.init (/usr/local/lib/node_modules/n8n/dist/db.js:57:21)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at Worker.init (/usr/local/lib/node_modules/n8n/dist/commands/worker.js:82:9)
at /usr/local/lib/node_modules/n8n/bin/n8n:70:2
Connection terminated due to connection timeout
2 Replies
15 days ago
This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.
Status changed to Open brody • 15 days ago
15 days ago
It's a database problem. Make sure your Postgres database is running and accessible. Confirm it’s not paused or out of quota. Increase the volume if necessary.
Also, if you recently rotated credentials, update them everywhere n8n uses them (you can check the admin log).
Or if your DB is just slow to start, you can try increasing the timeout by setting DB_POSTGRESDB_CONNECTION_TIMEOUT
to something higher like 60000.
Status changed to Solved chandrika • 14 days ago