I recently experienced SQLITE_BUSY: database is locked
error from one of my nodes, and figured I should change to PostgreSQL.
I first exported all workflows and credentials, added the environment variables (using docker), started a clean instance and imported the credentials and workflows.
Everything seem to work, but I get the following in the postgressql logs:
PostgreSQL Database directory appears to contain a database; Skipping initialization
2023-04-13 16:43:19.026 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2023-04-13 16:43:19.026 UTC [1] LOG: listening on IPv6 address "::", port 5432
2023-04-13 16:43:19.028 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2023-04-13 16:43:19.040 UTC [26] LOG: database system was shut down at 2023-04-13 16:39:06 UTC
2023-04-13 16:43:19.045 UTC [1] LOG: database system is ready to accept connections
2023-04-13 16:43:27.398 UTC [42] ERROR: permission denied to create extension "uuid-ossp"
2023-04-13 16:43:27.398 UTC [42] HINT: Must be superuser to create this extension.
2023-04-13 16:43:27.398 UTC [42] STATEMENT: CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
2023-04-13 16:43:32.023 UTC [52] ERROR: permission denied to create extension "uuid-ossp"
2023-04-13 16:43:32.023 UTC [52] HINT: Must be superuser to create this extension.
2023-04-13 16:43:32.023 UTC [52] STATEMENT: CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
2023-04-13 16:43:51.944 UTC [91] ERROR: permission denied to create extension "uuid-ossp"
2023-04-13 16:43:51.944 UTC [91] HINT: Must be superuser to create this extension.
2023-04-13 16:43:51.944 UTC [91] STATEMENT: CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
2023-04-13 16:44:09.611 UTC [116] ERROR: permission denied to create extension "uuid-ossp"
2023-04-13 16:44:09.611 UTC [116] HINT: Must be superuser to create this extension.
2023-04-13 16:44:09.611 UTC [116] STATEMENT: CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
2023-04-13 16:44:12.002 UTC [126] ERROR: permission denied to create extension "uuid-ossp"
2023-04-13 16:44:12.002 UTC [126] HINT: Must be superuser to create this extension.
2023-04-13 16:44:12.002 UTC [126] STATEMENT: CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
2023-04-13 16:44:12.333 UTC [124] ERROR: duplicate key value violates unique constraint "workflow_statistics_pkey"
2023-04-13 16:44:12.333 UTC [124] DETAIL: Key ("workflowId", name)=(4, data_loaded) already exists.
2023-04-13 16:44:12.333 UTC [124] STATEMENT: INSERT INTO "public"."workflow_statistics"("count", "latestEvent", "name", "workflowId") VALUES ($1, $2, $3, $4)
2023-04-13 16:44:12.396 UTC [124] ERROR: duplicate key value violates unique constraint "workflow_statistics_pkey"
2023-04-13 16:44:12.396 UTC [124] DETAIL: Key ("workflowId", name)=(4, production_success) already exists.
2023-04-13 16:44:12.396 UTC [124] STATEMENT: INSERT INTO "public"."workflow_statistics"("count", "latestEvent", "name", "workflowId") VALUES ($1, $2, $3, $4)
2023-04-13 16:44:32.037 UTC [161] ERROR: permission denied to create extension "uuid-ossp"
2023-04-13 16:44:32.037 UTC [161] HINT: Must be superuser to create this extension.
2023-04-13 16:44:32.037 UTC [161] STATEMENT: CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
2023-04-13 16:44:32.354 UTC [80] ERROR: duplicate key value violates unique constraint "workflow_statistics_pkey"
2023-04-13 16:44:32.354 UTC [80] DETAIL: Key ("workflowId", name)=(4, data_loaded) already exists.
2023-04-13 16:44:32.354 UTC [80] STATEMENT: INSERT INTO "public"."workflow_statistics"("count", "latestEvent", "name", "workflowId") VALUES ($1, $2, $3, $4)
2023-04-13 16:44:32.419 UTC [80] ERROR: duplicate key value violates unique constraint "workflow_statistics_pkey"
2023-04-13 16:44:32.419 UTC [80] DETAIL: Key ("workflowId", name)=(4, production_success) already exists.
2023-04-13 16:44:32.419 UTC [80] STATEMENT: INSERT INTO "public"."workflow_statistics"("count", "latestEvent", "name", "workflowId") VALUES ($1, $2, $3, $4)
2023-04-13 16:44:33.205 UTC [162] ERROR: permission denied to create extension "uuid-ossp"
2023-04-13 16:44:33.205 UTC [162] HINT: Must be superuser to create this extension.
2023-04-13 16:44:33.205 UTC [162] STATEMENT: CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
And it keeps on âŚ
Any input on how I can solve this?
EDIT:
Ended up upgrading via dumping and restoring postgresdb from 11 to 15 â also upgraded from 0.222.2 to 0.223.0 (as per this post). That seems to have helped for the uuid-ossp
problem, but I still see:
2023-04-13 17:55:42.255 UTC [521] ERROR: duplicate key value violates unique constraint "workflow_statistics_pkey"
2023-04-13 17:55:42.255 UTC [521] DETAIL: Key ("workflowId", name)=(4, data_loaded) already exists.
2023-04-13 17:55:42.255 UTC [521] STATEMENT: INSERT INTO "public"."workflow_statistics"("count", "latestEvent", "name", "workflowId") VALUES ($1, $2, $3, $4)
Information on your n8n setup
- n8n version: 0.223.0
- Database youâre using (default: SQLite): PostgreSQL 15.2
- Running n8n with the execution process: own
- Running n8n via: Docker