{"record":{"id":"4b0184bcacb343e8","repo":"FlowiseAI/Flowise","slug":"invalid-json-in-the-additional-configuration-4b0184","errorCode":null,"errorMessage":"Invalid JSON in the Additional Configuration: ","messagePattern":"Invalid JSON in the Additional Configuration: ","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/memory/AgentMemory/PostgresAgentMemory/PostgresAgentMemory.ts","lineNumber":78,"sourceCode":"                additionalParams: true,\n                optional: true\n            }\n        ]\n    }\n\n    async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {\n        const additionalConfig = nodeData.inputs?.additionalConfig as string\n        const databaseEntities = options.databaseEntities as IDatabaseEntity\n        const chatflowid = options.chatflowid as string\n        const appDataSource = options.appDataSource as DataSource\n        const orgId = options.orgId as string\n\n        let additionalConfiguration = {}\n        if (additionalConfig) {\n            try {\n                additionalConfiguration = typeof additionalConfig === 'object' ? additionalConfig : JSON.parse(additionalConfig)\n            } catch (exception) {\n                throw new Error('Invalid JSON in the Additional Configuration: ' + exception)\n            }\n            additionalConfiguration = sanitizeDataSourceOptions(additionalConfiguration)\n        }\n\n        const threadId = options.sessionId || options.chatId\n\n        let datasourceOptions: ICommonObject = {\n            ...additionalConfiguration,\n            type: 'postgres'\n        }\n\n        const credentialData = await getCredentialData(nodeData.credential ?? '', options)\n        const user = getCredentialParam('user', credentialData, nodeData)\n        const password = getCredentialParam('password', credentialData, nodeData)\n        const _port = (nodeData.inputs?.port as string) || '5432'\n        const port = parseInt(_port)\n        datasourceOptions = {\n            ...datasourceOptions,","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/memory/AgentMemory/PostgresAgentMemory/PostgresAgentMemory.ts#L60-L96","documentation":"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.","triggerScenarios":"Postgres-specific Additional Configuration field on the memory node holds malformed JSON (trailing comma, single quotes, unquoted keys).","commonSituations":"Pasting a TypeORM Postgres options object literal into the field; curly-quote corruption; stale string config migrated from an older version.","solutions":["Validate additionalConfig as JSON before saving.","Pass additionalConfig as an object to bypass parsing.","Lint the JSON to locate the error."],"exampleFix":"// before\n{ ssl: { rejectUnauthorized: true } }\n// after\n{\"ssl\":{\"rejectUnauthorized\":true}}","handlingStrategy":"validation","validationCode":"function parseAdditionalConfig(raw: unknown): Record<string, unknown> {\n  if (raw == null) return {}\n  if (typeof raw === 'object') return raw as Record<string, unknown>\n  return JSON.parse(raw as string)\n}","typeGuard":"function isJsonString(v: string): v is string {\n  try { JSON.parse(v); return true } catch { return false }\n}","tryCatchPattern":"try {\n  additionalConfiguration = typeof additionalConfig === 'object' ? additionalConfig : JSON.parse(additionalConfig)\n} catch (e) {\n  throw new Error(`Postgres Additional Configuration is not valid JSON: ${(e as Error).message}`)\n}","preventionTips":["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."],"tags":["agent-memory","postgres","memory","json","validation","datasource"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}