Skip to content

Trouble running chromadb #25

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

Open
tacman opened this issue May 28, 2025 · 6 comments
Open

Trouble running chromadb #25

tacman opened this issue May 28, 2025 · 6 comments

Comments

@tacman
Copy link

tacman commented May 28, 2025

I'm stuck on getting chromadb to work. I've tried running it with the docker file provided, running it on it's own docker instance, and on two machines.

Slightly different errors, sometime SSL, this one is about the version. I've tried with chroma:0.5.0 and :lastest

I suspect it has to do with ssl, or that both machines are dev machines and have services running on them, but I don't think anything on port 8000.

Any suggestions?


In ChromaApiClient.php line 327:
                                                                                 
  [Codewithkyrian\ChromaDB\Generated\Exceptions\ChromaConnectionException (35)]  
  OpenSSL/3.0.13: error:0A00010B:SSL routines::wrong version number              
                                                                                 

Exception trace:
  at /home/tac/g/sites/llm-demo/vendor/codewithkyrian/chromadb-php/src/Generated/ChromaApiClient.php:327
 Codewithkyrian\ChromaDB\Generated\ChromaApiClient->handleChromaApiException() at /home/tac/g/sites/llm-demo/vendor/codewithkyrian/chromadb-php/src/Generated/ChromaApiClient.php:136
 Codewithkyrian\ChromaDB\Generated\ChromaApiClient->getTenant() at /home/tac/g/sites/llm-demo/vendor/codewithkyrian/chromadb-php/src/Client.php:28
 Codewithkyrian\ChromaDB\Client->initDatabaseAndTenant() at /home/tac/g/sites/llm-demo/vendor/codewithkyrian/chromadb-php/src/Client.php:21
 Codewithkyrian\ChromaDB\Client->__construct() at /home/tac/g/sites/llm-demo/vendor/codewithkyrian/chromadb-php/src/Factory.php:109
 Codewithkyrian\ChromaDB\Factory->connect() at /home/tac/g/sites/llm-demo/var/cache/dev/ContainerXMWqZcg/getClientService.php:27
 ContainerXMWqZcg\getClientService::do() at /home/tac/g/sites/llm-demo/var/cache/dev/ContainerXMWqZcg/getClientService.php:22
@chr-hertel
Copy link
Member

I guess it is due to using the latest tag in the docker compose file and the change of the Chroma API with version 1.0 and lack of support in the underlying php lib for chroma, see CodeWithKyrian/chromadb-php#12

For now i pinned the chromadb image with #26 and you should be able to use the main branch here again after pulling.

@tacman
Copy link
Author

tacman commented May 29, 2025

Thanks! I'm getting closer. I can run the docker commands to embed and query the Symfony base, but within the web browser it fails. Also, it fails when I run

symfony console app:blog:query

Testing Chroma DB Connection
============================

 // Connecting to Chroma DB ...                                                                                         


In ChromaApiClient.php line 327:
                                    
  Could not resolve host: chromadb  
                                    

app:blog:query

so I suspect that's the problem in the web browser as well, since I'm using symfony server:start to serve the web pages.

It's possible that the chromadb issue was because I didn't realize apache2 was running on port 8000.

I'd like to run the application without docker. Is there an alternative to chromadb? I quite like Meilisearch (#24), but even a simple filesystem or doctrine vector store would be enough to continue to play with this excellent toolkit.

Thx.

@tacman
Copy link
Author

tacman commented May 29, 2025

FWIW, when I change .env to

CHROMADB_HOST=http://127.0.0.1:8000

I get

In ChromaApiClient.php line 331:

[Error]
Call to a member function getBody() on null

Exception trace:
at /home/tac/g/sites/llm-demo/vendor/codewithkyrian/chromadb-php/src/Generated/ChromaApiClient.php:331
Codewithkyrian\ChromaDB\Generated\ChromaApiClient->handleChromaApiException() at /home/tac/g/sites/llm-demo/vendor/codewithkyrian/chromadb-php/src/Generated/ChromaApiClient.php:136
Codewithkyrian\ChromaDB\Generated\ChromaApiClient->getTenant() at /home/tac/g/sites/llm-demo/vendor/codewithkyrian/chromadb-php/src/Client.php:28
Codewithkyrian\ChromaDB\Client->initDatabaseAndTenant() at /home/tac/g/sites/llm-demo/vendor/codewithkyrian/chromadb-php/src/Client.php:21
Codewithkyrian\ChromaDB\Client->__construct() at /home/tac/g/sites/llm-demo/vendor/codewithkyrian/chromadb-php/src/Factory.php:109
Codewithkyrian\ChromaDB\Factory->connect() at /home/tac/g/sites/llm-demo/var/cache/dev/ContainerLKL7j5G/getClientService.php:27
ContainerLKL7j5G\getClientService::do() at /home/tac/g/sites/llm-demo/var/cache/dev/ContainerLKL7j5G/getClientService.php:22
ContainerLKL7j5G\getClientService::{closure:ContainerLKL7j5G\getClientService::do():22}() at /home/tac/g/sites/llm-demo/vendor/codewithkyrian/chromadb-php/src/Client.php:110
Codewithkyrian\ChromaDB\Client->getOrCreateCollection() at /home/tac/g/sites/llm-demo/vendor/php-llm/llm-chain/src/Bridge/ChromaDB/Store.php:33
PhpLlm\LlmChain\Bridge\ChromaDB\Store->add() at /home/tac/g/sites/llm-demo/vendor/php-llm/llm-chain/src/Embedder.php:48
PhpLlm\LlmChain\Embedder->embed() at /home/tac/g/sites/llm-demo/src/Blog/Embedder.php:26
App\Blog\Embedder->embedBlog() at /home/tac/g/sites/llm-demo/src/Blog/Command/EmbedCommand.php:28

@chr-hertel
Copy link
Member

chr-hertel commented May 29, 2025

Try pinecone than: https://www.pinecone.io/

I switched to docker explicitly to use chroma tbh

@tacman
Copy link
Author

tacman commented Jun 1, 2025

Getting closer, using docker. Any idea what's causing this? I do have an OPENAPI_KEY set.

12:57:19 INFO [http_client] Response: "200 https://api.openai.com/v1/embeddings" 0.2028 seconds ["http_code" => 200,"url" => "https://api.openai.com/v1/embeddings","total_time" => 0.2028]

In ChromaApiClient.php line 331:

[Error]
Call to a member function getBody() on null

Exception trace:
at /app/vendor/codewithkyrian/chromadb-php/src/Generated/ChromaApiClient.php:331
Codewithkyrian\ChromaDB\Generated\ChromaApiClient->handleChromaApiException() at /app/vendor/codewithkyrian/chromadb-php/src/Generated/ChromaApiClient.php:136
Codewithkyrian\ChromaDB\Generated\ChromaApiClient->getTenant() at /app/vendor/codewithkyrian/chromadb-php/src/Client.php:28
Codewithkyrian\ChromaDB\Client->initDatabaseAndTenant() at /app/vendor/codewithkyrian/chromadb-php/src/Client.php:21
Codewithkyrian\ChromaDB\Client->__construct() at /app/vendor/codewithkyrian/chromadb-php/src/Factory.php:109
Codewithkyrian\ChromaDB\Factory->connect() at /app/var/cache/dev/ContainerTrpUovl/getClientService.php:27
ContainerTrpUovl\getClientService::do() at /app/var/cache/dev/ContainerTrpUovl/getClientService.php:22
ContainerTrpUovl\getClientService::{closure:ContainerTrpUovl\getClientService::do():22}() at /app/vendor/codewithkyrian/chromadb-php/src/Client.php:110
Codewithkyrian\ChromaDB\Client->getOrCreateCollection() at /app/vendor/php-llm/llm-chain/src/Bridge/ChromaDB/Store.php:33
PhpLlm\LlmChain\Bridge\ChromaDB\Store->add() at /app/vendor/php-llm/llm-chain/src/Embedder.php:48
PhpLlm\LlmChain\Embedder->embed() at /app/src/Blog/Embedder.php:26
App\Blog\Embedder->embedBlog() at /app/src/Blog/Command/EmbedCommand.php:28
App\Blog\Command\EmbedCommand->execute() at /app/vendor/symfony/console/Command/Command.php:318
Symfony\Component\Console\Command\Command->run() at /app/vendor/symfony/console/Application.php:1092
Symfony\Component\Console\Application->doRunCommand() at /app/vendor/symfony/framework-bundle/Console/Application.php:123
Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /app/vendor/symfony/console/Application.php:341
Symfony\Component\Console\Application->doRun() at /app/vendor/symfony/framework-bundle/Console/Application.php:77
Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /app/vendor/symfony/console/Application.php:192
Symfony\Component\Console\Application->run() at /app/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:49
Symfony\Component\Runtime\Runner\Symfony\ConsoleApplicationRunner->run() at /app/vendor/autoload_runtime.php:29
require_once() at /app/bin/console:15

@tacman
Copy link
Author

tacman commented Jun 1, 2025

I got a pinecone account, but am not sure how to configure it.

I've installed

composer require probots-io/pinecone-php

but hacking here, not sure what this should be. Thx.

    store:
        pinecone:
            symfonycon:
                namespace: 'symfony_blog'

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

No branches or pull requests

2 participants