Running n8n locally installed with npm and Postgres:
User settings loaded from: /Users/MyUser/.n8n/config
0|n8n | Initializing n8n process
0|n8n | n8n ready on 0.0.0.0, port 5678
0|n8n | Migrations in progress, please do NOT stop the process.
0|n8n | Starting migration CreateProject1714133768519
0|n8n | Migration “CreateProject1714133768519” failed, error: relation “user” does not exist
0|n8n | Error: There was an error running database migrations
0|n8n | QueryFailedError: relation “user” does not exist
It seems to be stuck on the database migration due to given error above
What is the error message (if any)?
Please share your workflow
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
0|n8n | query: CREATE EXTENSION IF NOT EXISTS “uuid-ossp”
0|n8n | At least one of the entities has uuid column, but the ‘uuid-ossp’ extension cannot be installed automatically. Please install it manually using superuser rights, or select another uuid extension.
0|n8n | User settings loaded from: /root/.n8n/config
0|n8n | Initializing n8n process
0|n8n | query: SELECT * FROM current_schema()
0|n8n | query: CREATE EXTENSION IF NOT EXISTS “uuid-ossp”
0|n8n | At least one of the entities has uuid column, but the ‘uuid-ossp’ extension cannot be installed automatically. Please install it manually using superuser rights, or select another uuid extension.
0|n8n | query: SELECT version();
0|n8n | query: CREATE SCHEMA IF NOT EXISTS n8n
0|n8n | query: SET search_path TO n8n,public;
0|n8n | n8n ready on 0.0.0.0, port 5678
I could reproduce this by setting DB_POSTGRESDB_SCHEMA=n8n. What’s interesting is that there are migrations before CreateProject1714133768519 that already fail. The first one to fail when I start n8n from scratch is RemoveResetPasswordColumns1690000000030.
@Kool_Baudrillard it seems there is an issue with migrations and postgres when using a non-public schema. I’ll get back to you once we know more. Thanks for reporting this
As a quick fix, do you think you could run set the search_path for the whole database?
ALTER DATABASE n8n SET search_path TO n8n,public;
It looks like TypeORM only sets this for one connection in the pool, instead of for all of them. So it’s a bit gnarly to fix this. Judging from locally testing it, the above would fix it for you.