spring-projects / spring-projects/spring-ai

The exception handling in ChromaAPI when working with collections seems to be incorrect

Open
#4,845 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
Dominant language
Java
Stars
9.5k
Forks
2.9k
Avg merge
1d 7h
Merged PRs (30d)
6

Description

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).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in vector-stores/spring-ai-chroma-store/src/main/java/org/springframework/ai/chroma/vectorstore/ChromaApi.java at ChromaApi#getCollection, then inspect ChromaVectorStore.java where the result is handled. Reproduce the missing-collection case with Chroma v1.3.4 and the linked MRE, and verify that getCollection returns null so ChromaVectorStore can process the absent collection without an unexpected RuntimeException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.