{"record":{"id":"fe78e2d446ea46a2","repo":"FlowiseAI/Flowise","slug":"no-datasource-options-provided-fe78e2","errorCode":null,"errorMessage":"No datasource options provided","messagePattern":"No datasource options provided","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/components/nodes/recordmanager/PostgresRecordManager/PostgresRecordManager.ts","lineNumber":211,"sourceCode":"    config: PostgresRecordManagerOptions\n    tableName: string\n    namespace: string\n\n    constructor(namespace: string, config: PostgresRecordManagerOptions) {\n        const { tableName } = config\n        this.namespace = namespace\n        this.tableName = tableName\n        this.config = config\n    }\n\n    sanitizeTableName(tableName: string): string {\n        return sanitizeRecordManagerTableName(tableName)\n    }\n\n    private async getDataSource(): Promise<DataSource> {\n        const { postgresConnectionOptions } = this.config\n        if (!postgresConnectionOptions) {\n            throw new Error('No datasource options provided')\n        }\n        // Prevent using default MySQL port, otherwise will throw uncaught error and crashing the app\n        if (postgresConnectionOptions.port === 3006) {\n            throw new Error('Invalid port number')\n        }\n        const dataSource = new DataSource(postgresConnectionOptions)\n        await dataSource.initialize()\n        return dataSource\n    }\n\n    async createSchema(): Promise<void> {\n        const dataSource = await this.getDataSource()\n        try {\n            const queryRunner = dataSource.createQueryRunner()\n            const tableName = this.sanitizeTableName(this.tableName)\n\n            await queryRunner.manager.query(`\n  CREATE TABLE IF NOT EXISTS \"${tableName}\" (","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/recordmanager/PostgresRecordManager/PostgresRecordManager.ts#L193-L229","documentation":"Thrown by PostgresRecordManager.getDataSource when config.postgresConnectionOptions is falsy. This is the Postgres analog of error 261: without connection options the manager cannot build a TypeORM DataSource and aborts before any network call.","triggerScenarios":"Instantiating PostgresRecordManager with a config that omits postgresConnectionOptions; the init path failed to merge host/port/user/password into the options object; the credential binding is empty.","commonSituations":"Record Manager node has no Postgres credential selected; additionalConfig JSON parsed but did not include connection fields; programmatic use forgot the second constructor argument.","solutions":["Select a Postgres credential in the node, or supply postgresConnectionOptions in additionalConfig.","Verify the init flow: getHost/getPort/getSSL/user/password must all resolve; if any are blank the merged object may still be truthy but useless - check those separately.","Programmatically: new PostgresRecordManager(config, { postgresConnectionOptions: {...} })."],"exampleFix":"// before\nconst mgr = new PostgresRecordManager({ tableName: 'records' }, {})\n// after\nconst mgr = new PostgresRecordManager(\n  { tableName: 'records' },\n  { postgresConnectionOptions: { type: 'postgres', host, port: 5432, username, password, database } }\n)","handlingStrategy":"validation","validationCode":"function hasPostgresOptions(cfg: unknown): cfg is { postgresConnectionOptions: Record<string, unknown> } {\n  return !!cfg && typeof cfg === 'object' && !!((cfg as any).postgresConnectionOptions)\n}\nif (!hasPostgresOptions(config)) {\n  throw new Error('postgresConnectionOptions missing in config.')\n}","typeGuard":"function isPostgresConfig(cfg: unknown): cfg is { postgresConnectionOptions: { host: string; port: number; username: string; password: string; database: string } } {\n  const o = (cfg as any)?.postgresConnectionOptions\n  return !!o && typeof o.host === 'string' && typeof o.port === 'number'\n}","tryCatchPattern":"try {\n  await manager.createSchema()\n} catch (e) {\n  if (e instanceof Error && e.message === 'No datasource options provided') {\n    // prompt for Postgres credential\n  }\n  throw e\n}","preventionTips":["Bind a Postgres credential to the node.","In init, log which of host/port/user/password resolved empty.","Smoke-test config in CI with a minimal createSchema() call."],"tags":["postgres","record-manager","config","datasource","missing-credentials"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}