FlowiseAI/Flowise · critical · Error

No datasource options provided

Error message

No datasource options provided

What it means

Thrown by MySQLRecordManager.getDataSource when config.mysqlOptions is falsy. The manager cannot construct a TypeORM DataSource without connection options, so it aborts before attempting new DataSource(undefined). It is a precondition check, not a connection failure.

Source

Thrown at packages/components/nodes/recordmanager/MySQLRecordManager/MySQLrecordManager.ts:199

        this.config = config
    }

    sanitizeTableName(tableName: string): string {
        // Trim and normalize case, turn whitespace into underscores
        tableName = tableName.trim().toLowerCase().replace(/\s+/g, '_')

        // Validate using a regex (alphanumeric and underscores only)
        if (!/^[a-zA-Z0-9_]+$/.test(tableName)) {
            throw new Error('Invalid table name')
        }

        return tableName
    }

    private async getDataSource(): Promise<DataSource> {
        const { mysqlOptions } = this.config
        if (!mysqlOptions) {
            throw new Error('No datasource options provided')
        }
        // Prevent using default Postgres port, otherwise will throw uncaught error and crashing the app
        if (mysqlOptions.port === 5432) {
            throw new Error('Invalid port number')
        }
        const dataSource = new DataSource(mysqlOptions)
        await dataSource.initialize()
        return dataSource
    }

    async createSchema(): Promise<void> {
        const dataSource = await this.getDataSource()
        try {
            const queryRunner = dataSource.createQueryRunner()
            const tableName = this.sanitizeTableName(this.tableName)

            await queryRunner.manager.query(`create table if not exists \`${this.sanitizeTableName(tableName)}\` (
                \`uuid\` varchar(36) primary key default (UUID()),

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Supply mysqlOptions in the Record Manager's Additional Configuration JSON, e.g. {"mysqlOptions":{"host":"...","port":3306,"username":"...","password":"...","database":"..."}}.
  2. Confirm the selected credential actually populates mysqlOptions; check the node's credential binding.
  3. Validate the JSON parses (a parse failure throws a different 'Invalid JSON' error first) before troubleshooting this one.
  4. If building the manager programmatically, pass { mysqlOptions: {...} } as the config argument.

Example fix

// before
const mgr = new MySQLRecordManager({ tableName: 'records' }, {})
// after
const mgr = new MySQLRecordManager(
  { tableName: 'records' },
  { mysqlOptions: { host, port: 3306, username, password, database } }
)
Defensive patterns

Strategy: validation

Validate before calling

function hasMysqlOptions(cfg: unknown): cfg is { mysqlOptions: Record<string, unknown> } {
  return !!cfg && typeof cfg === 'object' && !!((cfg as any).mysqlOptions)
}
if (!hasMysqlOptions(config)) {
  throw new Error('Provide mysqlOptions with host/port/username/password/database.')
}

Type guard

function isMysqlConfig(cfg: unknown): cfg is { mysqlOptions: { host: string; port: number; username: string; password: string; database: string } } {
  const o = (cfg as any)?.mysqlOptions
  return !!o && typeof o.host === 'string' && typeof o.port === 'number'
}

Try / catch

try {
  await manager.createSchema()
} catch (e) {
  if (e instanceof Error && e.message === 'No datasource options provided') {
    // prompt user to supply a MySQL credential / additionalConfig
  }
  throw e
}

Prevention

When it happens

Trigger: Instantiating MySQLRecordManager with a config object that omits mysqlOptions, or whose additionalConfig JSON did not parse into a mysqlOptions key. Also when the node's 'Additional Configuration' field is empty and no credential-derived options are merged in.

Common situations: Record Manager node wired without a MySQL credential; credential selected but the additionalConfig JSON missing the 'mysqlOptions' wrapper; partial refactor that renamed the key;DATABASE_URL parsing not producing a mysqlOptions object.

Related errors


AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12). Data as JSON: /api/errors/433f081eb4803e7a. Report an issue: GitHub.