Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid URL scheme when using Chroma and Docker Compose #1395

Open
habuma opened this issue Sep 23, 2024 · 0 comments · May be fixed by #1399
Open

Invalid URL scheme when using Chroma and Docker Compose #1395

habuma opened this issue Sep 23, 2024 · 0 comments · May be fixed by #1399

Comments

@habuma
Copy link
Member

habuma commented Sep 23, 2024

It's unclear if this is a bug or not (or what is causing it), but it sure feels like a bug.

If I create a brand new Spring Boot app with Docker Compose Support and Chroma, I get a build file that includes the following dependencies:

    developmentOnly 'org.springframework.boot:spring-boot-docker-compose'
    developmentOnly "org.springframework.ai:spring-ai-spring-boot-docker-compose:${springAiVersion}"

And it gives me a nice compose.yml file with all that I need for Docker to start Chroma.

However, once it actually tries to hit the Chroma vector store, I get an exception that is ultimately caused by this:

Caused by: java.net.URISyntaxException: Illegal character in scheme name at index 0: 127.0.0.1:/api/v1/collections/SpringAiCollection

I did a little debugging and found that in ChromaVectorStoreAutoConfiguration when the ChromaApi bean is being created (at https://github.com/spring-projects/spring-ai/blob/main/spring-ai-spring-boot-autoconfigure/src/main/java/org/springframework/ai/autoconfigure/vectorstore/chroma/ChromaVectorStoreAutoConfiguration.java#L66), the chromaUrl is set to "127.0.0.1:8000". But when that is given to the RestClient.Builder in ChromaApi, the "127.0.0.1" is interpreted to be the schema and the "8000" is assigned to the ssp. The host and port are both null.

HOWEVER, if I remove the following dependency from my build, everything works fine and as expected:

developmentOnly "org.springframework.ai:spring-ai-spring-boot-docker-compose:${springAiVersion}"

Clearly something in that dependency is ganking things up. And given that it works fine without it, I wonder why it's put there by the Initializr?

@habuma habuma changed the title Invalid schema when using Chroma and Docker Compose Invalid URL scheme when using Chroma and Docker Compose Sep 23, 2024
eddumelendez added a commit to eddumelendez/spring-ai that referenced this issue Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant