{"record":{"id":"0dd257b9af9978c1","repo":"alibaba/spring-ai-alibaba","slug":"unsupported-vector-store-type","errorCode":null,"errorMessage":"Unsupported vector store type: ","messagePattern":"Unsupported 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/VectorStoreFactory.java","lineNumber":56,"sourceCode":"\n\tpublic VectorStoreFactory(StudioProperties studioProperties, Map<String, VectorStoreService> vdbServiceMap) {\n\t\tthis.studioProperties = studioProperties;\n\t\tthis.vdbServiceMap = vdbServiceMap;\n\t}\n\n\t/**\n\t * Retrieves the configured vector store service. Currently supports Elasticsearch\n\t * implementation.\n\t * @return The configured vector store service\n\t * @throws IllegalArgumentException if the configured vector store type is not\n\t * supported\n\t */\n\tpublic VectorStoreService getVectorStoreService() {\n\t\tVectorStoreType type = VectorStoreType.of(studioProperties.getVectorStoreType());\n\t\tif (type == VectorStoreType.ELASTICSEARCH) {\n\t\t\treturn vdbServiceMap.get(\"elasticSearchVectorStoreService\");\n\t\t}\n\t\tthrow new IllegalArgumentException(\"Unsupported vector store type: \" + type);\n\t}\n\n}\n","sourceCodeStart":38,"sourceCodeEnd":60,"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/VectorStoreFactory.java#L38-L60","documentation":"VectorStoreFactory.getVectorStoreService() only special-cases ELASTICSEARCH; if the configured vector store type resolves to any other VectorStoreType value (or null), the factory has no service mapping and throws IllegalArgumentException. It exists because the factory currently supports only Elasticsearch retrieval for the admin RAG pipeline.","triggerScenarios":"Set spring.ai.alibaba.studio.vector-store type to a non-Elasticsearch value that still maps to a VectorStoreType enum entry (e.g. a vector store configured in studioProperties.getVectorStoreType()) and call getVectorStoreService(). Also thrown when VectorStoreType.of returns null for an unrecognized string that isn't caught earlier by error 141.","commonSituations":"Developers configure Milvus, PGVector, Redis, etc. in the studio properties expecting broad vector store support, then boot the admin server and hit this on first RAG operation. Also occurs when a typo'd config passes VectorStoreType.of as null.","solutions":["Set studioProperties vectorStoreType to 'elasticsearch' (e.g. spring.ai.alibaba.studio.vector-store.type=elasticsearch)","Configure a working Elasticsearch instance (address, credentials) so the elasticSearchVectorStoreService bean is usable","If another store is needed, extend VectorStoreFactory to map additional types to beans in vdbServiceMap instead of throwing"],"exampleFix":"// before\nstudio:\n  vector-store:\n    type: milvus\n// after\nstudio:\n  vector-store:\n    type: elasticsearch","handlingStrategy":"validation","validationCode":"String configured = studioProperties.getVectorStoreType();\nif (!\"elasticsearch\".equalsIgnoreCase(configured)) {\n    throw new IllegalStateException(\"Admin RAG only supports elasticsearch, got: \" + configured);\n}","typeGuard":null,"tryCatchPattern":"try {\n    VectorStoreService svc = factory.getVectorStoreService();\n} catch (IllegalArgumentException e) {\n    log.error(\"Vector store not supported: {}\", e.getMessage());\n    // fall back to disabled RAG or fail startup with clear config guidance\n}","preventionTips":["Pin vector store type to elasticsearch in studio config","Add a startup-time config check that fails fast with a clear message","Document supported types next to the config key"],"tags":["rag","vector-store","configuration","spring"],"backgroundTag":"unsupported-operation","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"}