alibaba/spring-ai-alibaba · error · IllegalArgumentException
Unsupported vector store type:
Error message
Unsupported vector store type:
What it means
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.
Source
Thrown at spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/rag/vectorstore/VectorStoreFactory.java:56
public VectorStoreFactory(StudioProperties studioProperties, Map<String, VectorStoreService> vdbServiceMap) {
this.studioProperties = studioProperties;
this.vdbServiceMap = vdbServiceMap;
}
/**
* Retrieves the configured vector store service. Currently supports Elasticsearch
* implementation.
* @return The configured vector store service
* @throws IllegalArgumentException if the configured vector store type is not
* supported
*/
public VectorStoreService getVectorStoreService() {
VectorStoreType type = VectorStoreType.of(studioProperties.getVectorStoreType());
if (type == VectorStoreType.ELASTICSEARCH) {
return vdbServiceMap.get("elasticSearchVectorStoreService");
}
throw new IllegalArgumentException("Unsupported vector store type: " + type);
}
}
View on GitHub (pinned to f82da0b50f)
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
Example fix
// before
studio:
vector-store:
type: milvus
// after
studio:
vector-store:
type: elasticsearch Defensive patterns
Strategy: validation
Validate before calling
String configured = studioProperties.getVectorStoreType();
if (!"elasticsearch".equalsIgnoreCase(configured)) {
throw new IllegalStateException("Admin RAG only supports elasticsearch, got: " + configured);
} Try / catch
try {
VectorStoreService svc = factory.getVectorStoreService();
} catch (IllegalArgumentException e) {
log.error("Vector store not supported: {}", e.getMessage());
// fall back to disabled RAG or fail startup with clear config guidance
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- Unknown vector store type:
- oss ak or sk should be set.
- oss bucket should be set.
- AppNotFound
- INVALID_PARAMS
AI-assisted analysis of alibaba/spring-ai-alibaba@f82da0b50f (2026-09-09).
Data as JSON: /api/errors/0dd257b9af9978c1.
Report an issue: GitHub.