weaviate/weaviate · error

%s=%q is not in %s (%s)

Error message

%s=%q is not in %s (%s)

What it means

This error is thrown by reconcileAllowListWithDefault when the default env var (e.g. DEFAULT_VECTOR_INDEX) is set to a value that is not contained in the corresponding allow-list (e.g. ALLOWED_VECTOR_INDEX_TYPES) which has multiple entries. A default must always be one of the allowed options; otherwise newly created collections could receive an index type the deployment forbids. Startup is aborted with both the offending default and the full allow-list in the message.

Source

Thrown at usecases/config/config_handler.go:730

}

// reconcileAllowListWithDefault enforces "default must be in the list",
// seeding the default in the single-entry / unset-default case.
func reconcileAllowListWithDefault(allowList []string, defaultDV *runtime.DynamicValue[string], allowEnv, defaultEnv string) error {
	if len(allowList) == 0 {
		return nil
	}
	currentDefault := ""
	if defaultDV != nil {
		currentDefault = strings.ToLower(strings.TrimSpace(defaultDV.Get()))
	}
	if len(allowList) > 1 {
		if currentDefault == "" {
			return fmt.Errorf("%s lists multiple values (%s); %s must also be set to one of them",
				allowEnv, strings.Join(allowList, ", "), defaultEnv)
		}
		if !slices.Contains(allowList, currentDefault) {
			return fmt.Errorf("%s=%q is not in %s (%s)",
				defaultEnv, currentDefault, allowEnv, strings.Join(allowList, ", "))
		}
		if defaultDV != nil && defaultDV.Get() != currentDefault {
			_ = defaultDV.SetValue(currentDefault)
		}
		return nil
	}
	only := allowList[0]
	if currentDefault == "" {
		if defaultDV != nil {
			_ = defaultDV.SetValue(only)
		}
		return nil
	}
	if currentDefault != only {
		return fmt.Errorf("%s=%q does not match the only entry in %s (%q)",
			defaultEnv, currentDefault, allowEnv, only)
	}

View on GitHub (pinned to 75aa4b6d11)

Solutions

  1. Change DEFAULT_VECTOR_INDEX to one of the values listed in the error's allow-list.
  2. Re-add the current default value to ALLOWED_VECTOR_INDEX_TYPES if it should remain default.
  3. If the default was intentional and the list is wrong, correct the allow-list to include it.

Example fix

// before
ALLOWED_VECTOR_INDEX_TYPES=hnsw,flat
DEFAULT_VECTOR_INDEX=hfresh
// after
ALLOWED_VECTOR_INDEX_TYPES=hnsw,flat
DEFAULT_VECTOR_INDEX=hnsw
Defensive patterns

Strategy: validation

Validate before calling

allow := strings.Split(strings.TrimSpace(os.Getenv("ALLOWED_VECTOR_INDEX_TYPES")), ",")
for i := range allow { allow[i] = strings.ToLower(strings.TrimSpace(allow[i])) }
defaultIdx := strings.ToLower(strings.TrimSpace(os.Getenv("DEFAULT_VECTOR_INDEX")))
if len(allow) > 1 && defaultIdx != "" && !slices.Contains(allow, defaultIdx) {
  return fmt.Errorf("DEFAULT_VECTOR_INDEX=%q not in ALLOWED_VECTOR_INDEX_TYPES", defaultIdx)
}

Prevention

When it happens

Trigger: DEFAULT_VECTOR_INDEX=flat while ALLOWED_VECTOR_INDEX_TYPES=hnsw,gsl (2+ entries not containing 'flat'); changing the allow-list after the default was set and leaving them out of sync.

Common situations: Operators tightening ALLOWED_VECTOR_INDEX_TYPES for security and forgetting to update DEFAULT_VECTOR_INDEX; env vars managed by different teams/tools drifting apart; copy-pasted configs where the default names an index type no longer permitted.

Related errors


AI-assisted analysis of weaviate/weaviate@75aa4b6d11 (2026-09-04). Data as JSON: /api/errors/6d54aea78e4901e3. Report an issue: GitHub.