{"record":{"id":"90bddfb5726a479f","repo":"FlowiseAI/Flowise","slug":"invalid-port-number-90bddf","errorCode":null,"errorMessage":"Invalid port number","messagePattern":"Invalid port number","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/vectorstores/Postgres/driver/TypeORM.ts","lineNumber":48,"sourceCode":"                }\n                additionalConfiguration = sanitizeDataSourceOptions(additionalConfiguration)\n            }\n\n            this._postgresConnectionOptions = {\n                ...additionalConfiguration,\n                type: 'postgres',\n                host: this.getHost(),\n                port: this.getPort(),\n                ssl: this.getSSL(),\n                username: user, // Required by TypeORMVectorStore\n                user: user, // Required by Pool in similaritySearchVectorWithScore\n                password: password,\n                database: this.getDatabase()\n            } as DataSourceOptions\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        }\n        return this._postgresConnectionOptions\n    }\n\n    async getArgs(): Promise<TypeORMVectorStoreArgs> {\n        return {\n            postgresConnectionOptions: await this.getPostgresConnectionOptions(),\n            tableName: this.getTableName(),\n            schemaName: this.getSchemaName()\n        }\n    }\n\n    async instanciate(metadataFilters?: any) {\n        return this.adaptInstance(\n            await TypeORMVectorStore.fromDataSource(this.getEmbeddings(), await this.getArgs()),\n            metadataFilters,\n            this.getTablePath()","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/vectorstores/Postgres/driver/TypeORM.ts#L30-L66","documentation":"Thrown by the TypeORM Postgres driver's `getPostgresConnectionOptions` when `this.getHost()` equals `'3006'`. Same guard and same caveat as the PGVector variant: it inspects the HOST (not the port) and rejects the literal `'3006'` to avoid crashing TypeORM against a MySQL endpoint. The message 'Invalid port number' is misleading because it checks the host.","triggerScenarios":"Typing `3006` (a mistyped MySQL port) into the HOST field, or a misconfigured env var leaking a port into the host value. Entering `3006` in the port field does not trigger this.","commonSituations":"Host/port field confusion; pasting `host:port` into host; env var (`POSTGRES_VECTORSTORE_HOST`) containing a port string.","solutions":["Place only the host in the host field; put the port in the port field.","Use a MySQL store node for MySQL — this is Postgres-only.","Audit host-related env vars for stray port values.","Note the guard checks host, not port, despite the message."],"exampleFix":"// before — host field set to '3006'\nhost: '3006'\n// after\nhost: 'db.example.com'\nport: 5432","handlingStrategy":"validation","validationCode":"function validatePgHost(host: string) {\n  if (!host || host === '3006' || /^\\d+$/.test(host)) {\n    throw new Error(`Invalid Postgres host: '${host}' (use hostname/IP, put port in the port field)`)\n  }\n}","typeGuard":"function isRealHost(host: string): boolean {\n  return typeof host === 'string' && host.length > 0 && !/^\\d+$/.test(host)\n}","tryCatchPattern":"validatePgHost(this.getHost())\nconst opts = await this.getPostgresConnectionOptions()","preventionTips":["Separate host and port fields.","Check host env vars for stray port values.","Use a MySQL node for MySQL targets.","Recall the guard checks host, not port, despite the message."],"tags":["postgres","typeorm","config","validation","misnomer"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}