FlowiseAI/Flowise · error · Error
Invalid JSON in the Additional Configuration: ${exception}
Error message
Invalid JSON in the Additional Configuration: ${exception} What it means
MySQLRecordManager.init parses `nodeData.inputs?.additionalConfig` as JSON when it is a string. The parsed object is then passed through `sanitizeDataSourceOptions` and merged into mysql connection options. Invalid JSON throws inside the try and is rethrown with this message.
Source
Thrown at packages/components/nodes/recordmanager/MySQLRecordManager/MySQLrecordManager.ts:137
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
const user = getCredentialParam('user', credentialData, nodeData)
const password = getCredentialParam('password', credentialData, nodeData)
const _tableName = nodeData.inputs?.tableName as string
const tableName = _tableName ? _tableName : 'upsertion_records'
const additionalConfig = nodeData.inputs?.additionalConfig as string
const _namespace = nodeData.inputs?.namespace as string
const namespace = _namespace ? _namespace : options.chatflowid
const cleanup = nodeData.inputs?.cleanup as string
const _sourceIdKey = nodeData.inputs?.sourceIdKey as string
const sourceIdKey = _sourceIdKey ? _sourceIdKey : 'source'
let additionalConfiguration = {}
if (additionalConfig) {
try {
additionalConfiguration = typeof additionalConfig === 'object' ? additionalConfig : JSON.parse(additionalConfig)
} catch (exception) {
throw new Error('Invalid JSON in the Additional Configuration: ' + exception)
}
additionalConfiguration = sanitizeDataSourceOptions(additionalConfiguration)
}
const mysqlOptions = {
...additionalConfiguration,
type: 'mysql',
host: nodeData.inputs?.host as string,
port: nodeData.inputs?.port as number,
username: user,
password: password,
database: nodeData.inputs?.database as string
}
const args = {
mysqlOptions,
tableName: tableName
}View on GitHub (pinned to abe4a8601a)
Solutions
- Provide additionalConfig as valid JSON: `{"ssl":{"rejectUnauthorized":true},"poolSize":10}`.
- Remove JS-only constructs (comments, functions, undefined) — use strings/numbers/booleans/null only.
- Run sanitizeDataSourceOptions-friendly keys only (avoid keys the sanitizer will strip).
- If the config is large, build it in a prior node as an object and pass it through to skip parsing.
Example fix
// before
additionalConfiguration = typeof additionalConfig === 'object' ? additionalConfig : JSON.parse(additionalConfig)
// after
if (typeof additionalConfig === 'string') {
try { additionalConfiguration = JSON.parse(additionalConfig) }
catch (e) { throw new Error(`MySQL additionalConfig invalid JSON: ${(e as Error).message}. Got: ${additionalConfig.slice(0,160)}`) }
} else additionalConfiguration = additionalConfig Defensive patterns
Strategy: validation
Validate before calling
function parseAdditionalConfig(input: unknown): ICommonObject {
if (input == null) return {}
if (typeof input === 'object') return input as ICommonObject
try { return JSON.parse(input) }
catch (e) { throw new Error(`MySQL additionalConfig invalid JSON: ${(e as Error).message}`) }
} Type guard
const isPlainObject = (v: unknown): v is Record<string, unknown> => typeof v === 'object' && v !== null && !Array.isArray(v)
Prevention
- Use JSON (no JS comments/functions) for TypeORM options.
- Pass config objects from upstream nodes when large.
- Check sanitizeDataSourceOptions's allowed keys before submitting.
When it happens
Trigger: additionalConfig field holds malformed JSON; user pastes a TypeORM config snippet using JS syntax (e.g. unquoted keys, single quotes, functions); config contains comments.
Common situations: Adding SSL/TLS or pool options to the MySQL record manager; pasting config from a TypeORM docs example written as a JS object; mixing in environment variable substitutions that break JSON.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- Invalid JSON in the Chat NVIDIA NIM's baseOptions: ${excepti
- Invalid JSON in the ChatOpenAI's BaseOptions: ${exception}
- Invalid JSON in the ChatOpenAI's BaseOptions: ${exception}
- Invalid JSON in the ChatOpenRouter's BaseOptions: ${exceptio
- Invalid JSON in Search Domain Filter: ${exception}
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/2eb38f20ddc434a7.
Report an issue: GitHub.