Critical Issue: n8n Local Unusable After v1.123.4 Update (Database Timeouts)

Describe the problem/error/question

After updating my local n8n instance to version 1.123.4, I am experiencing frequent errors and recurring database connection failures. As a result, the entire system has become unusable. Prior to the update, everything was working smoothly without any issues.

What is the error message (if any)?

Logs from mij portainer log viewer:

Database connection timed out
Database connection recovered
Database connection timed out
Database connection timed out
Error: timeout exceeded when trying to connect
at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/[email protected][email protected]/node_modules/pg-pool/index.js:45:11
at runNextTicks (node:internal/process/task_queues:65:5)
at listOnTimeout (node:internal/timers:549:9)
at processTimers (node:internal/timers:523:7)
at PostgresDriver.obtainMasterConnection (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/src/driver/postgres/PostgresDriver.ts:1181:28)
at PostgresQueryRunner.query (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/src/driver/postgres/PostgresQueryRunner.ts:248:36)
at SelectQueryBuilder.loadRawResults (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/src/query-builder/SelectQueryBuilder.ts:3660:25)
at SelectQueryBuilder.executeExistsQuery (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/src/query-builder/SelectQueryBuilder.ts:2913:25)
at SelectQueryBuilder.getExists (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/src/query-builder/SelectQueryBuilder.ts:1820:29)
at /usr/local/lib/node_modules/n8n/src/auth/auth.service.ts:106:24
Error: timeout exceeded when trying to connect
at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/[email protected][email protected]/node_modules/pg-pool/index.js:45:11
at runNextTicks (node:internal/process/task_queues:65:5)
at listOnTimeout (node:internal/timers:549:9)
at processTimers (node:internal/timers:523:7)
at PostgresDriver.obtainMasterConnection (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/src/driver/postgres/PostgresDriver.ts:1181:28)
at PostgresQueryRunner.query (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/src/driver/postgres/PostgresQueryRunner.ts:248:36)
at SelectQueryBuilder.loadRawResults (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/src/query-builder/SelectQueryBuilder.ts:3660:25)
at SelectQueryBuilder.executeExistsQuery (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/src/query-builder/SelectQueryBuilder.ts:2913:25)
at SelectQueryBuilder.getExists (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/src/query-builder/SelectQueryBuilder.ts:1820:29)
at /usr/local/lib/node_modules/n8n/src/auth/auth.service.ts:106:24
Error: timeout exceeded when trying to connect
at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/[email protected][email protected]/node_modules/pg-pool/index.js:45:11
at runNextTicks (node:internal/process/task_queues:65:5)
at listOnTimeout (node:internal/timers:549:9)
at processTimers (node:internal/timers:523:7)
at PostgresDriver.obtainMasterConnection (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/src/driver/postgres/PostgresDriver.ts:1181:28)
at PostgresQueryRunner.query (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/src/driver/postgres/PostgresQueryRunner.ts:248:36)
at SelectQueryBuilder.loadRawResults (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/src/query-builder/SelectQueryBuilder.ts:3660:25)
at SelectQueryBuilder.executeExistsQuery (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/src/query-builder/SelectQueryBuilder.ts:2913:25)
at SelectQueryBuilder.getExists (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/src/query-builder/SelectQueryBuilder.ts:1820:29)
at /usr/local/lib/node_modules/n8n/src/auth/auth.service.ts:106:24
Database connection timed out
Database connection recovered

Information on your n8n setup

  • n8n version: Version 1.123.4
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):Docker
  • Operating system:

This appears to be a database connection stability issue after the update. Try these steps:

1. Increase the database timeout settings by adding these environment variables to your n8n container:

```

DB_POOL_CONNECTION_TIMEOUT=30000

DB_POOL_IDLE_TIMEOUT=30000

```

2. If using PostgreSQL, also add:

```

DB_POSTGRESDB_OPTIONS=keepAlive:true

```

The logs suggest the connection pool is timing out too quickly - these settings should help stabilize it. If the issue persists, check your database server’s resources and connection limits.