FlowiseAI/Flowise · error · Error
Invalid JSON in the Additional Configuration:
Error message
Invalid JSON in the Additional Configuration:
What it means
MySQLAgentMemory.init uses the identical JSON.parse branch as AgentMemory, then forces type:'mysql' into datasourceOptions. Throws on a non-object additionalConfig string that fails to parse.
Source
Thrown at packages/components/nodes/memory/AgentMemory/MySQLAgentMemory/MySQLAgentMemory.ts:78
additionalParams: true,
optional: true
}
]
}
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
const additionalConfig = nodeData.inputs?.additionalConfig as string
const databaseEntities = options.databaseEntities as IDatabaseEntity
const chatflowid = options.chatflowid as string
const appDataSource = options.appDataSource as DataSource
const orgId = options.orgId as string
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 threadId = options.sessionId || options.chatId
let datasourceOptions: ICommonObject = {
...additionalConfiguration,
type: 'mysql'
}
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
const user = getCredentialParam('user', credentialData, nodeData)
const password = getCredentialParam('password', credentialData, nodeData)
const _port = (nodeData.inputs?.port as string) || '3306'
const port = parseInt(_port)
datasourceOptions = {
...datasourceOptions,View on GitHub (pinned to abe4a8601a)
Solutions
- Validate additionalConfig as JSON before saving.
- Pass additionalConfig as an object to bypass parsing.
- Lint the JSON to pinpoint the error.
Example fix
// before
{ host: 'db', port: 3306 }
// after
{"host":"db","port":3306} Defensive patterns
Strategy: validation
Validate before calling
function parseAdditionalConfig(raw: unknown): Record<string, unknown> {
if (raw == null) return {}
if (typeof raw === 'object') return raw as Record<string, unknown>
return JSON.parse(raw as string)
} Type guard
function isJsonString(v: string): v is string {
try { JSON.parse(v); return true } catch { return false }
} Try / catch
try {
additionalConfiguration = typeof additionalConfig === 'object' ? additionalConfig : JSON.parse(additionalConfig)
} catch (e) {
throw new Error(`MySQL Additional Configuration is not valid JSON: ${(e as Error).message}`)
} Prevention
- Use double quotes and no trailing commas in the MySQL additional config.
- Pass an object to skip parsing.
- Lint the JSON before deploy.
- Keep TypeORM option keys quoted.
When it happens
Trigger: MySQL-specific Additional Configuration field on the memory node holds a malformed JSON string (trailing comma, single quotes, unquoted keys).
Common situations: Copying a TypeORM MySQL connection-options object literal into the field; quote-style mismatch; stale string config from a prior Flowise version.
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 Additional Configuration:
- Invalid JSON in the Additional Configuration:
- Invalid table name
- No datasource options provided
- Invalid port number
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/c592595a124d39f0.
Report an issue: GitHub.