FlowiseAI/Flowise · error · Error
Invalid JSON in the Additional Configuration:
Error message
Invalid JSON in the Additional Configuration:
What it means
PostgresAgentMemory.init uses the identical JSON.parse branch as the other memory nodes, then forces type:'postgres' into datasourceOptions. Throws on a non-object additionalConfig string that fails to parse.
Source
Thrown at packages/components/nodes/memory/AgentMemory/PostgresAgentMemory/PostgresAgentMemory.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: 'postgres'
}
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) || '5432'
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 locate the error.
Example fix
// before
{ ssl: { rejectUnauthorized: true } }
// after
{"ssl":{"rejectUnauthorized":true}} 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(`Postgres Additional Configuration is not valid JSON: ${(e as Error).message}`)
} Prevention
- Use strict JSON for Postgres additional config (no trailing commas).
- Pass an object to skip parsing.
- Lint JSON before deploy.
- Quote ssl/nested option keys.
When it happens
Trigger: Postgres-specific Additional Configuration field on the memory node holds malformed JSON (trailing comma, single quotes, unquoted keys).
Common situations: Pasting a TypeORM Postgres options object literal into the field; curly-quote corruption; stale string config migrated from an older 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 table name
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/4b0184bcacb343e8.
Report an issue: GitHub.