{"record":{"id":"55d1e647b551418f","repo":"FlowiseAI/Flowise","slug":"invalid-json-in-the-additional-configuration-ex-55d1e6","errorCode":null,"errorMessage":"Invalid JSON in the Additional Configuration: ${exception}","messagePattern":"Invalid JSON in the Additional Configuration: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/vectorstores/Postgres/driver/PGVector.ts","lineNumber":29,"sourceCode":"import { getContentColumnName } from '../utils'\n\nexport class PGVectorDriver extends VectorStoreDriver {\n    static CONTENT_COLUMN_NAME_DEFAULT: string = 'pageContent'\n\n    protected _postgresConnectionOptions: PoolConfig\n\n    protected async getPostgresConnectionOptions() {\n        if (!this._postgresConnectionOptions) {\n            const { user, password } = await this.getCredentials()\n            const additionalConfig = this.nodeData.inputs?.additionalConfig as string\n\n            let additionalConfiguration = {}\n\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            this._postgresConnectionOptions = {\n                ...additionalConfiguration,\n                host: this.getHost(),\n                port: this.getPort(),\n                user: user,\n                password: password,\n                database: this.getDatabase()\n            }\n\n            // Prevent using default MySQL port, otherwise will throw uncaught error and crashing the app\n            if (this.getHost() === '3006') {\n                throw new Error('Invalid port number')\n            }\n        }","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/vectorstores/Postgres/driver/PGVector.ts#L11-L47","documentation":"Thrown by the PGVector driver while parsing the node's `additionalConfig` input as JSON. If the value is a string that is not valid JSON, `JSON.parse` throws and the driver wraps it with this message including the parse exception. The parsed object is then passed through `sanitizeDataSourceOptions` before merging into the Postgres connection options.","triggerScenarios":"User enters the Additional Configuration field with malformed JSON: trailing commas, single quotes, unquoted keys, comments, or stray characters. A non-string object value bypasses parsing.","commonSituations":"Hand-edited JSON with JS-style comments or trailing commas; copy-paste from a JS object literal (unquoted keys); invisible characters from rich-text paste; template variable left unreplaced.","solutions":["Validate the Additional Configuration value in a JSON linter before saving the node.","Use double quotes for all keys and string values; remove trailing commas and comments.","Leave the field empty if no extra options are needed (empty skips parsing).","If passing programmatically, pass an object instead of a string to skip JSON.parse."],"exampleFix":"// before — invalid\n\"{ ssl: true, // use ssl }\"\n// after — valid\n{\"ssl\":true}","handlingStrategy":"validation","validationCode":"function parseAdditionalConfig(raw: unknown): Record<string, unknown> {\n  if (raw === undefined || raw === null || raw === '') return {}\n  if (typeof raw === 'object') return raw as Record<string, unknown>\n  try {\n    return JSON.parse(raw)\n  } catch {\n    throw new Error('additionalConfig is not valid JSON')\n  }\n}","typeGuard":"function isJsonString(v: string): boolean {\n  try { JSON.parse(v); return true } catch { return false }\n}","tryCatchPattern":"const additionalConfiguration = parseAdditionalConfig(additionalConfig)","preventionTips":["Validate the Additional Configuration field with a JSON linter.","Use strict JSON: double quotes, no trailing commas, no comments.","Leave the field empty when unused.","Pass an object programmatically to skip parsing."],"tags":["postgres","pgvector","config","json","validation"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}