{"record":{"id":"9e2efce7cf920268","repo":"conductor-oss/conductor","slug":"invalid-index-name-9e2efc","errorCode":null,"errorMessage":"Invalid index name","messagePattern":"Invalid index name","errorType":"validation","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"ai/src/main/java/org/conductoross/conductor/ai/vectordb/postgres/PostgresVectorDB.java","lineNumber":147,"sourceCode":"    }\n\n    @Override\n    public int updateEmbeddings(\n            String indexName,\n            String namespace,\n            String doc,\n            String parentDocId,\n            String id,\n            List<Float> embeddings,\n            Map<String, Object> metadata) {\n        if (parentDocId == null) {\n            parentDocId = id;\n        }\n        if (!pattern.matcher(namespace).matches()) {\n            throw new RuntimeException(\"Invalid namespace\");\n        }\n        if (!pattern.matcher(indexName).matches()) {\n            throw new RuntimeException(\"Invalid index name\");\n        }\n        DataSource dataSource;\n        try {\n            // Assuming vector extension exists\n            dataSource = getClient();\n            // Wait for connection pool to be ready\n            waitForConnectionPoolReady(dataSource);\n        } catch (Exception exception) {\n            log.error(\n                    \"Error encountered while fetching datasource : {}\",\n                    exception.getMessage(),\n                    exception);\n            throw new RuntimeException(exception);\n        }\n\n        try (Connection conn = dataSource.getConnection()) {\n            PGvector.addVectorType(conn);\n            String tableName =","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/ai/src/main/java/org/conductoross/conductor/ai/vectordb/postgres/PostgresVectorDB.java#L129-L165","documentation":"Thrown as a plain RuntimeException by PostgresVectorDB.updateEmbeddings when indexName fails the validation regex [a-zA-Z0-9_-]+. Same injection-guard as namespace, applied to the index identifier. Only letters, digits, underscore, and hyphen are permitted.","triggerScenarios":"Passing an indexName with dots, spaces, slashes, special characters, or empty string to PostgresVectorDB.updateEmbeddings.","commonSituations":"Index name from a dotted config key or path; special separator characters; whitespace; empty default; naming convention clash with the allowed set.","solutions":["Restrict indexName to [a-zA-Z0-9_-] characters.","Sanitize special characters to underscores before calling.","Trim whitespace and ensure non-empty.","Standardize index naming across call sites."],"exampleFix":"// before\ndb.updateEmbeddings(\"idx.v1\", \"ns\", ...);  // dot invalid\n// after\ndb.updateEmbeddings(\"idx_v1\", \"ns\", ...);","handlingStrategy":"validation","validationCode":"private static final Pattern VALID = Pattern.compile(\"[a-zA-Z0-9_-]+\");\nif (!VALID.matcher(indexName).matches()) {\n    indexName = indexName.replaceAll(\"[^a-zA-Z0-9_-]\", \"_\");\n}","typeGuard":"boolean validIndex = indexName != null && Pattern.compile(\"[a-zA-Z0-9_-]+\").matcher(indexName).matches();","tryCatchPattern":null,"preventionTips":["Restrict index names to the allowed set up front.","Sanitize path-derived identifiers.","Validate at configuration time."],"tags":["postgres","vectordb","validation","injection-guard","sql"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}