Langfuse self hosted setup not working due to Postgres DB error #11578
Replies: 3 comments 2 replies
-
|
The error indicates that database migrations haven't run successfully. The Database Migration IssueBy default, Langfuse automatically runs PostgreSQL migrations on startup(1). The error suggests this process failed or was disabled. Check if Required PostgreSQL PermissionsFor large deployments, configure the database user with long timeouts as migrations might need a while to complete(1). The user needs sufficient permissions to:
If your database user lacks the ClickHouse PermissionsThe ClickHouse user specified in Replace Redis/Valkey PermissionsThe documentation doesn't specify explicit permission requirements for Redis/Valkey beyond authentication credentials ( Troubleshooting Steps
📚 Sources: Have another question? Just tag @inkeep. |
Beta Was this translation helpful? Give feedback.
-
|
The error "permission denied for schema public" indicates your PostgreSQL user lacks the necessary permissions to run migrations on the Required PostgreSQL PermissionsYour database user needs comprehensive permissions on the
Resolution Steps1. Grant Schema Permissions Connect to your PostgreSQL database as a superuser and grant the necessary permissions to your Langfuse database user: GRANT ALL PRIVILEGES ON SCHEMA public TO your_langfuse_user;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO your_langfuse_user;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO your_langfuse_user;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO your_langfuse_user;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON SEQUENCES TO your_langfuse_user;2. Configure Migration User If you want to use a different user specifically for migrations (with elevated permissions), set the This allows Langfuse to use different credentials for migrations while keeping your regular 3. Shadow Database Configuration If your database user lacks the Table Ownership ConsiderationsIf you encounter permission errors during migrations after changing database users, verify table ownership(2): \dt public.*If tables are owned by a different user, you can transfer ownership(2): ALTER TABLE table_name OWNER TO new_user;** 📚 Sources: Have another question? Just tag @inkeep. |
Beta Was this translation helpful? Give feedback.
-
|
It is recommended to keep automatic migrations enabled for both PostgreSQL and ClickHouse in self-hosted deployments. PostgreSQL MigrationsAutomatic PostgreSQL migrations are enabled by default and should remain enabled(1). The environment variable ClickHouse MigrationsAutomatic ClickHouse migrations are also enabled by default and should remain enabled(1). The environment variable Special Consideration for Zero-Downtime UpgradesThere is one exception: during zero-downtime upgrades from v2 to v3, you should temporarily disable background migrations(2). Set Why Keep Migrations EnabledKeeping automatic migrations enabled ensures:
If you experience permission errors with automatic migrations, the recommended approach is to grant the necessary permissions to your database users rather than disabling migrations(1). 📚 Sources: Have another question? Just tag @inkeep. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe your question
We have a Langfuse self hosted setup where we are trying to bring up the Langfuse application in EKS and connect to already created Postgres RDS cluster which is hosted outside of this EKS (not self bundled setup). During which, we are getting below error:
Do we know what is the issue here and how to resolve this? Also, what permissions does the Postgres user need to have on the externally hosted Postgres DB instance?
Also, what permissions does the Langfuse application need on Elasticache Valkey/Redis store and Clickhouse DB instances?
Raw query failed. Code:
42P01. Message:relation "cron_jobs" does not exist││ at ei.handleRequestError (/app/node_modules/.pnpm/@prisma+client@6.17.1_prisma@6.17.1_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:121:7268) │
│ at ei.handleAndLogRequestError (/app/node_modules/.pnpm/@prisma+client@6.17.1_prisma@6.17.1_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:121:65 │
│ at ei.request (/app/node_modules/.pnpm/@prisma+client@6.17.1_prisma@6.17.1_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:121:6300) │
│ at async a (/app/node_modules/.pnpm/@prisma+client@6.17.1_prisma@6.17.1_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:130:9551) │
│ at async m (/app/web/.next/server/pages/api/public/health.js:13:2267) │
│ at async l (/app/web/.next/server/pages/api/public/health.js:13:1954) │
│ at async l (/app/web/.next/server/pages/api/public/ready.js:37:3747) │
│ at async /app/node_modules/.pnpm/@sentry+nextjs@10.18.0_@opentelemetry+context-async-hooks@2.1.0_@opentelemetry+api@1.9.0__@op_bbg5x5dp3vii2gnm47fzfnqyzq/node_modules/@sentry/nextj │
│ at async ts (/app/node_modules/.pnpm/next@15.5.4_@babel+core@7.28.4_@opentelemetry+api@1.9.0_@playwright+test@1.47.2_babel-plugin-suglwur6bmlmt5d5g262whr2oy/node_modules/next/dist │
│ at async to.render (/app/node_modules/.pnpm/next@15.5.4@babel+core@7.28.4_@opentelemetry+api@1.9.0_@playwright+test@1.47.2_babel-plugin-_suglwur6bmlmt5d5g262whr2oy/node_modules/ne │
│ 2026-01-15T04:26:07.253Z error prisma:error │
│ Invalid
prisma.$queryRaw()invocation: ││ │
│ │
│ Raw query failed. Code:
42P01. Message:relation "cron_jobs" does not exist││ 2026-01-15T04:26:07.253Z error Telemetry, unexpected error: │
│ Invalid
prisma.$queryRaw()invocation:Langfuse Cloud or Self-Hosted?
Self-Hosted
If Self-Hosted
3.124.1
If Langfuse Cloud
No response
SDK and integration versions
No response
Pre-Submission Checklist
Beta Was this translation helpful? Give feedback.
All reactions