chroma-core/chroma · error · InvalidConfigurationError

No valid configuration fields provided for update.

Error message

No valid configuration fields provided for update.

What it means

updateCollectionConfigurationToJson builds the JSON payload from only three optional fields (hnsw, spann, embedding_function) and throws InvalidConfigurationError if the result object is empty. collection.modify({ configuration }) with a configuration in which all three fields are undefined is a no-op the client refuses to send. Note that name and metadata are separate arguments to modify, not members of configuration.

Source

Thrown at clients/js/packages/chromadb-core/src/CollectionConfiguration.ts:347

        "Invalid SPANN config provided in UpdateCollectionConfiguration",
      );
    }
  }

  // Handle embedding function serialization only if explicitly provided (ef !== undefined)
  if (ef !== undefined) {
    efConfig = serializeEmbeddingFunction(ef);
  }

  // Construct the result object, only including defined fields
  const result: Record<string, any> = {};
  if (hnswConfig !== undefined) result.hnsw = hnswConfig;
  if (spannConfig !== undefined) result.spann = spannConfig;
  if (efConfig !== undefined) result.embedding_function = efConfig;

  // Check if the result is empty, which means no valid update fields were provided
  if (Object.keys(result).length === 0) {
    throw new InvalidConfigurationError(
      "No valid configuration fields provided for update.",
    );
  }

  return result;
}

export function loadApiUpdateCollectionConfigurationFromUpdateCollectionConfiguration(
  config: UpdateCollectionConfiguration,
): Api.UpdateCollectionConfiguration {
  return updateCollectionConfigurationToJson(
    config,
  ) as Api.UpdateCollectionConfiguration;
}

/**
 * Checks if there are conflicting embedding functions between function parameter
 * and collection configuration.

View on GitHub (pinned to aecdd12c8a)

Solutions

  1. Omit the configuration argument entirely when you only want to change name or metadata: await col.modify({ name: 'new' }).
  2. Ensure at least one of hnsw, spann, embedding_function is defined in the configuration you pass.
  3. Strip undefined keys and skip the configuration update when none remain: if (Object.keys(cfg).length === 0) skip.

Example fix

// before
await col.modify({ name: 'renamed', configuration: {} });

// after
await col.modify({ name: 'renamed' });
Defensive patterns

Strategy: validation

Validate before calling

const cfg: UpdateCollectionConfiguration = { /* maybe empty */ };
const hasUpdateFields =
  cfg.hnsw !== undefined || cfg.spann !== undefined || cfg.embedding_function !== undefined;

await col.modify({
  name,
  metadata,
  ...(hasUpdateFields ? { configuration: cfg } : {}), // omit configuration when nothing to update
});

Type guard

function isNonEmptyUpdateConfig(
  cfg: UpdateCollectionConfiguration,
): boolean {
  return (
    cfg.hnsw !== undefined ||
    cfg.spann !== undefined ||
    cfg.embedding_function !== undefined
  );
}

Try / catch

try {
  await col.modify({ configuration });
} catch (e) {
  if (e instanceof InvalidConfigurationError && e.message.includes('No valid configuration fields')) {
    // nothing to update: treat as no-op success instead of failing
  }
  throw e;
}

Prevention

When it happens

Trigger: collection.modify({ configuration: {} }); collection.modify({ configuration: { hnsw: undefined, spann: maybeSpann } }) where maybeSpann is undefined; conditionally-constructed payloads where every branch produced undefined.

Common situations: Generic 'apply optional updates' code that always passes a configuration object even when the user only wanted rename/metadata changes; spreading optional config ({ ...opts }) whose keys are all absent; migration code that used to send embedding_function but now leaves it out.

Related errors


AI-assisted analysis of chroma-core/chroma@aecdd12c8a (2026-08-16). Data as JSON: /api/errors/3f9154e2e4392cc4. Report an issue: GitHub.