Problem:

Method ChromaApi#getCollection throws a RuntimeException with the message : "Collection [%s] does not exist" (note the correct spelling of "exist"). This seems to be not what the framework expects - the exception is expected to be catched and then processed. For instance, in the ChromaVectorStore this is certainly not an expected behavior.

What needs to be fixed:

The ChromaApi#getCollection should return null as it was, I guess, supposed to do if the chromadb collection does not exist.

Chroma version: v1.3.4

I have created a MRE repo on hte GitHub: https://github.com/mipo256/spring-ai-autopilot-podlodka. The pre-requisite is to have the docker container for chroma running (from docker compose for example).

Comment From: mipo256

PS: I can assist with implementation, if desirable

Comment From: rvangala936

I am seeing this error as well. So, I created the collectionName manually(using tenant, database, collection names) using the python AdminClient(chromadb.AdminClient) but I still get the following error. However, using a python client, I can retrieve the collection successfully. What am I missing with Spring AI config?

++++ Caused by: java.lang.RuntimeException: Collection [spring-ai-demo] does not exist at org.springframework.ai.chroma.vectorstore.ChromaApi.getCollection(ChromaApi.java:234) at org.springframework.ai.chroma.vectorstore.ChromaVectorStore.afterPropertiesSet(ChromaVectorStore.java:120) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1873) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1822) ... 46 common frames omitted Caused by: org.springframework.web.client.HttpClientErrorException$NotFound: 404 Not Found: "{"error":"NotFoundError","message":"Collection [spring-ai-demo] does not exist"}" ++++