conductor-oss/conductor · error · RuntimeException

Invalid index name

Error message

Invalid index name

What it means

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.

Source

Thrown at ai/src/main/java/org/conductoross/conductor/ai/vectordb/postgres/PostgresVectorDB.java:147

    }

    @Override
    public int updateEmbeddings(
            String indexName,
            String namespace,
            String doc,
            String parentDocId,
            String id,
            List<Float> embeddings,
            Map<String, Object> metadata) {
        if (parentDocId == null) {
            parentDocId = id;
        }
        if (!pattern.matcher(namespace).matches()) {
            throw new RuntimeException("Invalid namespace");
        }
        if (!pattern.matcher(indexName).matches()) {
            throw new RuntimeException("Invalid index name");
        }
        DataSource dataSource;
        try {
            // Assuming vector extension exists
            dataSource = getClient();
            // Wait for connection pool to be ready
            waitForConnectionPoolReady(dataSource);
        } catch (Exception exception) {
            log.error(
                    "Error encountered while fetching datasource : {}",
                    exception.getMessage(),
                    exception);
            throw new RuntimeException(exception);
        }

        try (Connection conn = dataSource.getConnection()) {
            PGvector.addVectorType(conn);
            String tableName =

View on GitHub (pinned to cf7c3e4a8a)

Solutions

  1. Restrict indexName to [a-zA-Z0-9_-] characters.
  2. Sanitize special characters to underscores before calling.
  3. Trim whitespace and ensure non-empty.
  4. Standardize index naming across call sites.

Example fix

// before
db.updateEmbeddings("idx.v1", "ns", ...);  // dot invalid
// after
db.updateEmbeddings("idx_v1", "ns", ...);
Defensive patterns

Strategy: validation

Validate before calling

private static final Pattern VALID = Pattern.compile("[a-zA-Z0-9_-]+");
if (!VALID.matcher(indexName).matches()) {
    indexName = indexName.replaceAll("[^a-zA-Z0-9_-]", "_");
}

Type guard

boolean validIndex = indexName != null && Pattern.compile("[a-zA-Z0-9_-]+").matcher(indexName).matches();

Prevention

When it happens

Trigger: Passing an indexName with dots, spaces, slashes, special characters, or empty string to PostgresVectorDB.updateEmbeddings.

Common situations: Index name from a dotted config key or path; special separator characters; whitespace; empty default; naming convention clash with the allowed set.

Related errors


AI-assisted analysis of conductor-oss/conductor@cf7c3e4a8a (2026-08-14). Data as JSON: /api/errors/9e2efce7cf920268. Report an issue: GitHub.