{"record":{"id":"6d54aea78e4901e3","repo":"weaviate/weaviate","slug":"s-q-is-not-in-s-s","errorCode":null,"errorMessage":"%s=%q is not in %s (%s)","messagePattern":"(.+?)=%q is not in (.+?) \\((.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"usecases/config/config_handler.go","lineNumber":730,"sourceCode":"}\n\n// reconcileAllowListWithDefault enforces \"default must be in the list\",\n// seeding the default in the single-entry / unset-default case.\nfunc reconcileAllowListWithDefault(allowList []string, defaultDV *runtime.DynamicValue[string], allowEnv, defaultEnv string) error {\n\tif len(allowList) == 0 {\n\t\treturn nil\n\t}\n\tcurrentDefault := \"\"\n\tif defaultDV != nil {\n\t\tcurrentDefault = strings.ToLower(strings.TrimSpace(defaultDV.Get()))\n\t}\n\tif len(allowList) > 1 {\n\t\tif currentDefault == \"\" {\n\t\t\treturn fmt.Errorf(\"%s lists multiple values (%s); %s must also be set to one of them\",\n\t\t\t\tallowEnv, strings.Join(allowList, \", \"), defaultEnv)\n\t\t}\n\t\tif !slices.Contains(allowList, currentDefault) {\n\t\t\treturn fmt.Errorf(\"%s=%q is not in %s (%s)\",\n\t\t\t\tdefaultEnv, currentDefault, allowEnv, strings.Join(allowList, \", \"))\n\t\t}\n\t\tif defaultDV != nil && defaultDV.Get() != currentDefault {\n\t\t\t_ = defaultDV.SetValue(currentDefault)\n\t\t}\n\t\treturn nil\n\t}\n\tonly := allowList[0]\n\tif currentDefault == \"\" {\n\t\tif defaultDV != nil {\n\t\t\t_ = defaultDV.SetValue(only)\n\t\t}\n\t\treturn nil\n\t}\n\tif currentDefault != only {\n\t\treturn fmt.Errorf(\"%s=%q does not match the only entry in %s (%q)\",\n\t\t\tdefaultEnv, currentDefault, allowEnv, only)\n\t}","sourceCodeStart":712,"sourceCodeEnd":748,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/usecases/config/config_handler.go#L712-L748","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Change DEFAULT_VECTOR_INDEX to one of the values listed in the error's allow-list.","Re-add the current default value to ALLOWED_VECTOR_INDEX_TYPES if it should remain default.","If the default was intentional and the list is wrong, correct the allow-list to include it."],"exampleFix":"// before\nALLOWED_VECTOR_INDEX_TYPES=hnsw,flat\nDEFAULT_VECTOR_INDEX=hfresh\n// after\nALLOWED_VECTOR_INDEX_TYPES=hnsw,flat\nDEFAULT_VECTOR_INDEX=hnsw","handlingStrategy":"validation","validationCode":"allow := strings.Split(strings.TrimSpace(os.Getenv(\"ALLOWED_VECTOR_INDEX_TYPES\")), \",\")\nfor i := range allow { allow[i] = strings.ToLower(strings.TrimSpace(allow[i])) }\ndefaultIdx := strings.ToLower(strings.TrimSpace(os.Getenv(\"DEFAULT_VECTOR_INDEX\")))\nif len(allow) > 1 && defaultIdx != \"\" && !slices.Contains(allow, defaultIdx) {\n  return fmt.Errorf(\"DEFAULT_VECTOR_INDEX=%q not in ALLOWED_VECTOR_INDEX_TYPES\", defaultIdx)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Derive DEFAULT_* from ALLOWED_* with a templating step instead of maintaining both by hand","Re-check the pair whenever restricting ALLOWED_VECTOR_INDEX_TYPES","Pin both variables in the same Helm values / compose block"],"tags":["configuration","validation","env-var"],"backgroundTag":"incompatible-config-combination","analyzedSha":"75aa4b6d11f8818305aafd4440b4e32794f7ca04","analyzedAt":"2026-09-04T14:58:20.392Z","contentChangedAt":"2026-09-04T14:58:20.392Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}