Has anyone had this problem? We use the CLI to import all workflows from our repository every time n8n starts in Docker. We are using PostgreSQL. When we are running docker compose from scratch (no volumes yet exist for PostgreSQL) the import works perfectly without errors. However, when there is an existing volume for PostgreSQL we run into a CLI error.
The CLI command we are running is n8n import:workflow --separate --input=/data/workflows
Here are the final lines of the build in this scenario:
n8n | UserSettings were generated and saved to: /home/node/.n8n/config
postgres | 2023-06-07 14:59:28.104 UTC [42] ERROR: permission denied to create extension “uuid-ossp”
postgres | 2023-06-07 14:59:28.104 UTC [42] HINT: Must be superuser to create this extension.
postgres | 2023-06-07 14:59:28.104 UTC [42] STATEMENT: CREATE EXTENSION IF NOT EXISTS “uuid-ossp”
n8n | Importing 32 workflows…
n8n | An error occurred while importing workflows. See log messages for details.
n8n | Cannot read properties of undefined (reading ‘forEach’)
All of the 32 files in the the specified directory are proper .json and the import works perfectly well on the very first build on a new volume. We also can’t seem to get to the aforementioned logs to investigate because the container is shutting down and constantly restarting after the error.
Are those postgres errors related? We were thinking that because in Postgres we can’t edit the id values of each workflow_entity row that the CLI might be having the same issue.
We have followed the same setup at n8n/docker/compose/withPostgres at master · n8n-io/n8n · GitHub
Any insight would be appreciated.
Information on your n8n setup
- n8n version: 0.221.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: