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 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.

Source

Thrown at packages/components/nodes/vectorstores/Postgres/driver/PGVector.ts:29

import { getContentColumnName } from '../utils'

export class PGVectorDriver extends VectorStoreDriver {
    static CONTENT_COLUMN_NAME_DEFAULT: string = 'pageContent'

    protected _postgresConnectionOptions: PoolConfig

    protected async getPostgresConnectionOptions() {
        if (!this._postgresConnectionOptions) {
            const { user, password } = await this.getCredentials()
            const additionalConfig = this.nodeData.inputs?.additionalConfig 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)
            }

            this._postgresConnectionOptions = {
                ...additionalConfiguration,
                host: this.getHost(),
                port: this.getPort(),
                user: user,
                password: password,
                database: this.getDatabase()
            }

            // Prevent using default MySQL port, otherwise will throw uncaught error and crashing the app
            if (this.getHost() === '3006') {
                throw new Error('Invalid port number')
            }
        }

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Validate the Additional Configuration value in a JSON linter before saving the node.
  2. Use double quotes for all keys and string values; remove trailing commas and comments.
  3. Leave the field empty if no extra options are needed (empty skips parsing).
  4. If passing programmatically, pass an object instead of a string to skip JSON.parse.

Example fix

// before — invalid
"{ ssl: true, // use ssl }"
// after — valid
{"ssl":true}
Defensive patterns

Strategy: validation

Validate before calling

function parseAdditionalConfig(raw: unknown): Record<string, unknown> {
  if (raw === undefined || raw === null || raw === '') return {}
  if (typeof raw === 'object') return raw as Record<string, unknown>
  try {
    return JSON.parse(raw)
  } catch {
    throw new Error('additionalConfig is not valid JSON')
  }
}

Type guard

function isJsonString(v: string): boolean {
  try { JSON.parse(v); return true } catch { return false }
}

Try / catch

const additionalConfiguration = parseAdditionalConfig(additionalConfig)

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Related errors


AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12). Data as JSON: /api/errors/55d1e647b551418f. Report an issue: GitHub.