{"record":{"id":"e90e9447caaa9763","repo":"alibaba/spring-ai-alibaba","slug":"unknown-vector-store-type","errorCode":null,"errorMessage":"Unknown vector store type: ","messagePattern":"Unknown vector store type: ","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/rag/vectorstore/VectorStoreType.java","lineNumber":53,"sourceCode":"\n\tVectorStoreType(String type) {\n\t\tthis.type = type;\n\t}\n\n\t/**\n\t * Converts a string type to its corresponding VectorStoreType enum value.\n\t * @param type The string identifier of the vector store type\n\t * @return The corresponding VectorStoreType enum value\n\t * @throws IllegalArgumentException if the type is not supported\n\t */\n\tpublic static VectorStoreType of(String type) {\n\t\tfor (VectorStoreType vectorStoreType : VectorStoreType.values()) {\n\t\t\tif (vectorStoreType.getType().equals(type)) {\n\t\t\t\treturn vectorStoreType;\n\t\t\t}\n\t\t}\n\n\t\tthrow new IllegalArgumentException(\"Unknown vector store type: \" + type);\n\t}\n\n}\n","sourceCodeStart":35,"sourceCodeEnd":57,"githubUrl":"https://github.com/alibaba/spring-ai-alibaba/blob/f82da0b50f35744c13968191be2b1cd2452ef550/spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/rag/vectorstore/VectorStoreType.java#L35-L57","documentation":"VectorStoreType.of(String) iterates all enum values matching the configured type string; if none matches, it throws IllegalArgumentException. This is a strict enum-parsing guard ensuring only known vector store type identifiers are accepted.","triggerScenarios":"Calling VectorStoreType.of() with any string not exactly equal to one of the enum constants' getType() values — including typos, wrong casing, null, or an empty property.","commonSituations":"Typo in config such as 'elasticseach' or 'ES' instead of the canonical value; case mismatch ('Elasticsearch'); property left blank; upgrading versions where the accepted identifiers changed.","solutions":["Check the canonical type string in VectorStoreType enum and use it exactly (case-sensitive) in configuration","Log/inspect the raw studioProperties.getVectorStoreType() value — it may be blank or contain whitespace","Guard the call: validate the configured value against VectorStoreType.values() before booting"],"exampleFix":"// before\nstudio:\n  vector-store:\n    type: ElasticSearch\n// after\nstudio:\n  vector-store:\n    type: elasticsearch","handlingStrategy":"validation","validationCode":"String type = studioProperties.getVectorStoreType();\nboolean known = Arrays.stream(VectorStoreType.values())\n    .anyMatch(t -> t.getType().equals(type));\nif (!known) throw new IllegalStateException(\"Unknown vector store type: \" + type);","typeGuard":null,"tryCatchPattern":"try {\n    VectorStoreType t = VectorStoreType.of(raw);\n} catch (IllegalArgumentException e) {\n    log.error(\"Bad vector-store type '{}', valid: {}\", raw,\n        Arrays.stream(VectorStoreType.values()).map(VectorStoreType::getType).toList());\n}","preventionTips":["Copy the exact type string from the VectorStoreType enum into config","Validate config at startup before any RAG usage","Watch for case sensitivity and stray whitespace in properties"],"tags":["enum","configuration","vector-store","spring"],"backgroundTag":"invalid-enum-value","analyzedSha":"f82da0b50f35744c13968191be2b1cd2452ef550","analyzedAt":"2026-09-09T15:32:42.421Z","contentChangedAt":"2026-09-09T15:32:42.421Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}