FlowiseAI/Flowise · error · Error
Invalid JSON in the Additional Configuration: ${exception}
Error message
Invalid JSON in the Additional Configuration: ${exception} What it means
Thrown by PostgresRecordManager.init when the node's additionalConfig input is a non-empty string that JSON.parse cannot evaluate. The manager tries object-pass-through first, then falls back to JSON.parse; only string-parse failures reach this catch. The original parse exception is concatenated to the message.
Source
Thrown at packages/components/nodes/recordmanager/PostgresRecordManager/PostgresRecordManager.ts:154
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
const user = getCredentialParam('user', credentialData, nodeData, process.env.POSTGRES_RECORDMANAGER_USER)
const password = getCredentialParam('password', credentialData, nodeData, process.env.POSTGRES_RECORDMANAGER_PASSWORD)
const tableName = sanitizeRecordManagerTableName(getTableName(nodeData))
const additionalConfig = nodeData.inputs?.additionalConfig as string
const _namespace = nodeData.inputs?.namespace as string
const namespace = _namespace ? sanitizeRecordManagerNamespace(_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 postgresConnectionOptions = mergeDataSourceOptions(
{
type: 'postgres',
host: getHost(nodeData),
port: getPort(nodeData),
ssl: getSSL(nodeData),
username: user,
password: password,
database: getDatabase(nodeData)
},
additionalConfiguration
)
const args = {View on GitHub (pinned to abe4a8601a)
Solutions
- Validate the additionalConfig string in a JSON linter before saving the node.
- Use double quotes for all keys and string values; remove trailing commas and comments.
- If you only need a few keys, prefer the structured credential fields over free-form JSON.
- Read the appended exception message - it pinpoints the parse position.
Example fix
// before (invalid JSON)
{ host: 'localhost', port: 5432, }
// after (valid JSON)
{"host":"localhost","port":5432} Defensive patterns
Strategy: validation
Validate before calling
function parseAdditionalConfig(raw: string): Record<string, unknown> {
try {
return JSON.parse(raw)
} catch (e) {
throw new Error(`additionalConfig is not valid JSON: ${(e as Error).message}`)
}
}
// validate at the form layer before save:
parseAdditionalConfig(formData.additionalConfig) Type guard
function isJsonString(s: unknown): s is string {
if (typeof s !== 'string') return false
try { JSON.parse(s); return true } catch { return false }
} Try / catch
// Already wrapped internally; callers of init should catch and surface to the UI.
try {
await pgManager.init(nodeData, input, options)
} catch (e) {
if (e instanceof Error && e.message.startsWith('Invalid JSON in the Additional Configuration')) {
// show the parse error position to the user
}
throw e
} Prevention
- Validate additionalConfig with JSON.parse on the client before saving the node.
- Provide a structured form for the common Postgres options instead of free JSON.
- Lint pasted JSON for trailing commas and single quotes.
When it happens
Trigger: User types a JavaScript object literal ({host: 'x'}) instead of JSON ({"host":"x"}); trailing comma; single-quoted strings; unquoted keys; a stray semicolon; copy-paste from a .ts file.
Common situations: Single quotes in JSON; trailing commas (forbidden in JSON, allowed in JS); comments in JSON; smart quotes from a word processor; partial paste that cut off a closing brace.
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: ${exception}
- No datasource options provided
- Invalid port number
- Invalid JSON in the Additional Configuration: ${exception}
- Invalid JSON in the Additional Configuration: ${exception}
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/ab972cc88cec278e.
Report an issue: GitHub.