npm run generate fails with chromadb #73

Closed
opened 2026-02-15 19:15:41 -05:00 by yindo · 1 comment
Owner

Originally created by @tanmaybhardwaj on GitHub (Oct 6, 2024).

Originally assigned to: @thucpn on GitHub.

Below are my .env settings
CHROMA_COLLECTION=chromadb-hr-docs
CHROMA_HOST=http://localhost:8000
CHROMA_PORT=8000

successfully installed chromadb on my local mac and able to run by using below command
chroma run --host localhost --port 8000 --path chromadb-docs

But on running the 'npm run generate' command I am getting below error

Using 'openai' model provider
Starting load for HR Manual.pdf file
Started parsing the file under job id 1f3497ad-93de-4389-954b-60efba609ff2
Start creating embeddings...
/Users/tanmaybhardwaj/vcpl-chatbot/vcpl-bot/node_modules/chromadb/dist/cjs/chromadb.cjs:2844
throw new Error(newCollection.error);
^

Error: TypeError: fetch failed
at ChromaClient.getOrCreateCollection (/Users/tanmaybhardwaj/vcpl-chatbot/vcpl-bot/node_modules/chromadb/dist/cjs/chromadb.cjs:2844:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ChromaVectorStore.getCollection (/Users/tanmaybhardwaj/vcpl-chatbot/vcpl-bot/node_modules/llamaindex/dist/cjs/vector-store/ChromaVectorStore.js:34:26)
at async ChromaVectorStore.add (/Users/tanmaybhardwaj/vcpl-chatbot/vcpl-bot/node_modules/llamaindex/dist/cjs/vector-store/ChromaVectorStore.js:55:28)
at async addNodesToVectorStores (/Users/tanmaybhardwaj/vcpl-chatbot/vcpl-bot/node_modules/llamaindex/dist/cjs/ingestion/IngestionPipeline.js:113:28)
at async VectorStoreIndex.insertNodes (/Users/tanmaybhardwaj/vcpl-chatbot/vcpl-bot/node_modules/llamaindex/dist/cjs/indices/vectorStore/index.js:574:9)
at async VectorStoreIndex.buildIndexFromNodes (/Users/tanmaybhardwaj/vcpl-chatbot/vcpl-bot/node_modules/llamaindex/dist/cjs/indices/vectorStore/index.js:488:9)
at async VectorStoreIndex.init (/Users/tanmaybhardwaj/vcpl-chatbot/vcpl-bot/node_modules/llamaindex/dist/cjs/indices/vectorStore/index.js:438:13)
at async VectorStoreIndex.fromDocuments (/Users/tanmaybhardwaj/vcpl-chatbot/vcpl-bot/node_modules/llamaindex/dist/cjs/indices/vectorStore/index.js:516:16)
at async loadAndIndex (/Users/tanmaybhardwaj/vcpl-chatbot/vcpl-bot/app/api/chat/engine/generate.ts:26:3)
at async (/Users/tanmaybhardwaj/vcpl-chatbot/vcpl-bot/app/api/chat/engine/generate.ts:35:3)

Node.js v20.17.0

Originally created by @tanmaybhardwaj on GitHub (Oct 6, 2024). Originally assigned to: @thucpn on GitHub. Below are my .env settings CHROMA_COLLECTION=chromadb-hr-docs CHROMA_HOST=http://localhost:8000 CHROMA_PORT=8000 successfully installed chromadb on my local mac and able to run by using below command chroma run --host localhost --port 8000 --path chromadb-docs But on running the 'npm run generate' command I am getting below error Using 'openai' model provider Starting load for HR Manual.pdf file Started parsing the file under job id 1f3497ad-93de-4389-954b-60efba609ff2 Start creating embeddings... /Users/tanmaybhardwaj/vcpl-chatbot/vcpl-bot/node_modules/chromadb/dist/cjs/chromadb.cjs:2844 throw new Error(newCollection.error); ^ Error: TypeError: fetch failed at ChromaClient.getOrCreateCollection (/Users/tanmaybhardwaj/vcpl-chatbot/vcpl-bot/node_modules/chromadb/dist/cjs/chromadb.cjs:2844:13) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async ChromaVectorStore.getCollection (/Users/tanmaybhardwaj/vcpl-chatbot/vcpl-bot/node_modules/llamaindex/dist/cjs/vector-store/ChromaVectorStore.js:34:26) at async ChromaVectorStore.add (/Users/tanmaybhardwaj/vcpl-chatbot/vcpl-bot/node_modules/llamaindex/dist/cjs/vector-store/ChromaVectorStore.js:55:28) at async addNodesToVectorStores (/Users/tanmaybhardwaj/vcpl-chatbot/vcpl-bot/node_modules/llamaindex/dist/cjs/ingestion/IngestionPipeline.js:113:28) at async VectorStoreIndex.insertNodes (/Users/tanmaybhardwaj/vcpl-chatbot/vcpl-bot/node_modules/llamaindex/dist/cjs/indices/vectorStore/index.js:574:9) at async VectorStoreIndex.buildIndexFromNodes (/Users/tanmaybhardwaj/vcpl-chatbot/vcpl-bot/node_modules/llamaindex/dist/cjs/indices/vectorStore/index.js:488:9) at async VectorStoreIndex.init (/Users/tanmaybhardwaj/vcpl-chatbot/vcpl-bot/node_modules/llamaindex/dist/cjs/indices/vectorStore/index.js:438:13) at async VectorStoreIndex.fromDocuments (/Users/tanmaybhardwaj/vcpl-chatbot/vcpl-bot/node_modules/llamaindex/dist/cjs/indices/vectorStore/index.js:516:16) at async loadAndIndex (/Users/tanmaybhardwaj/vcpl-chatbot/vcpl-bot/app/api/chat/engine/generate.ts:26:3) at async <anonymous> (/Users/tanmaybhardwaj/vcpl-chatbot/vcpl-bot/app/api/chat/engine/generate.ts:35:3) Node.js v20.17.0
yindo closed this issue 2026-02-15 19:15:41 -05:00
Author
Owner

@thucpn commented on GitHub (Oct 11, 2024):

Hi @tanmaybhardwaj, please change your settings in .env file to:

CHROMA_COLLECTION=chromadb-hr-docs
CHROMA_HOST=localhost
CHROMA_PORT=8000
@thucpn commented on GitHub (Oct 11, 2024): Hi @tanmaybhardwaj, please change your settings in .env file to: ``` CHROMA_COLLECTION=chromadb-hr-docs CHROMA_HOST=localhost CHROMA_PORT=8000 ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/create-llama#73