Describe the problem/error/question
I get a “permission denied for database XXXX” when using the SQL Agent.
Looking at the database query logs I saw:
LOG: statement: CREATE SCHEMA IF NOT EXISTS undefined
ERROR: permission denied for database XXXX
I can successfully connect and query the Postgres database using the Postgres node and the same connection.
What is the error message (if any)?
error: permission denied for database odoo at /usr/local/lib/node_modules/n8n/node_modules/pg/lib/client.js:526:17 at processTicksAndRejections (node:internal/process/task_queues:95:5) at PostgresDriver.obtainMasterConnection (/usr/local/lib/node_modules/n8n/node_modules/@n8n/typeorm/driver/postgres/PostgresDriver.js:886:13) at PostgresQueryRunner.query (/usr/local/lib/node_modules/n8n/node_modules/@n8n/typeorm/driver/postgres/PostgresQueryRunner.js:178:36) at PostgresQueryRunner.getCurrentSchema (/usr/local/lib/node_modules/n8n/node_modules/@n8n/typeorm/driver/postgres/PostgresQueryRunner.js:279:23) at PostgresDriver.connect (/usr/local/lib/node_modules/n8n/node_modules/@n8n/typeorm/driver/postgres/PostgresDriver.js:267:37) at DataSource.initialize (/usr/local/lib/node_modules/n8n/node_modules/@n8n/typeorm/data-source/DataSource.js:136:9) at Function.fromDataSourceParams (/usr/local/lib/node_modules/n8n/node_modules/langchain/dist/sql_db.cjs:87:13) at Object.sqlAgentAgentExecute (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/agents/Agent/agents/SqlAgent/execute.js:68:32) at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/agents/Agent/Agent.node.js:388:20)
Please share your workflow
Share the output returned by the last node
Information on your n8n setup
- n8n version: 1.68.0 (Self Hosted)
- Database (default: SQLite): SQLite
- n8n EXECUTIONS_PROCESS setting (default: own, main): own
- Running n8n via (Docker, npm, n8n cloud, desktop app): docker
- Operating system: ubuntu