FlowiseAI/Flowise · error · Error
Invalid JSON in the Additional Configuration:
Error message
Invalid JSON in the Additional Configuration:
What it means
AgentMemory.init parses additionalConfig via JSON.parse only when it is a non-object value; a SyntaxError is caught and re-thrown. The parsed object is then passed through sanitizeDataSourceOptions and spread into datasourceOptions.
Source
Thrown at packages/components/nodes/memory/AgentMemory/AgentMemory.ts:123
}
]
}
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
const additionalConfig = nodeData.inputs?.additionalConfig as string
const databaseFilePath = nodeData.inputs?.databaseFilePath as string
const databaseType = nodeData.inputs?.databaseType as string
const databaseEntities = options.databaseEntities as IDatabaseEntity
const chatflowid = options.chatflowid as string
const orgId = options.orgId as string
const appDataSource = options.appDataSource as DataSource
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: databaseType
}
if (databaseType === 'sqlite') {
datasourceOptions.database = databaseFilePath
? validateSQLitePath(databaseFilePath)
: path.join(process.env.DATABASE_PATH ?? path.join(getUserHome(), '.flowise'), 'database.sqlite')
const args: SaverOptions = {
datasourceOptions,
threadId,View on GitHub (pinned to abe4a8601a)
Solutions
- Validate additionalConfig as JSON in the UI before saving.
- Pass additionalConfig as an object to skip the parse branch.
- Lint the JSON to locate the syntax error.
Example fix
// before
{ ssl: true, extra: { connectionLimit: 5 } }
// after
{"ssl":true,"extra":{"connectionLimit":5}} 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) // throws SyntaxError early
} 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(`Additional Configuration is not valid JSON: ${(e as Error).message}`)
} Prevention
- Validate datasource option JSON in the UI before saving.
- Pass an object when the API allows it.
- Lint JSON configs in CI.
- Avoid pasting JS object literals.
When it happens
Trigger: Free-form Additional Configuration string in the AgentMemory node that is not valid JSON, e.g. a TypeORM options object literal pasted verbatim.
Common situations: Pasting {ssl:true, extra:{...}} with unquoted keys or trailing commas; mixing JS syntax into a JSON field; curly-quote corruption.
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 JSON in the Chat NVIDIA NIM's baseOptions: ${excepti
- Invalid JSON in the OpenAIEmbedding's BaseOptions:
- Invalid JSON in the ChatOpenAI's BaseOptions:
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/c7f01ead856917fc.
Report an issue: GitHub.