anything-llm icon indicating copy to clipboard operation
anything-llm copied to clipboard

RequiredError: Required parameter collectionId was null or undefined when calling count.

Open adieyal opened this issue 1 year ago • 2 comments

This happens when I try to add a new document from the frontend. The chroma version is the latest the commit from their github repo.

chromadb        | Rebuilding hnsw to ensure architecture compatibility
anything-llm    | Example app listening on port 3001
clickhouse_1    | Processing configuration file '/etc/clickhouse-server/config.xml'.
clickhouse_1    | Merging configuration file '/etc/clickhouse-server/config.d/backup_disk.xml'.
clickhouse_1    | Merging configuration file '/etc/clickhouse-server/config.d/docker_related_config.xml'.
clickhouse_1    | Logging trace to /var/log/clickhouse-server/clickhouse-server.log
clickhouse_1    | Logging errors to /var/log/clickhouse-server/clickhouse-server.err.log
clickhouse_1    | Processing configuration file '/etc/clickhouse-server/config.xml'.
clickhouse_1    | Merging configuration file '/etc/clickhouse-server/config.d/backup_disk.xml'.
clickhouse_1    | Merging configuration file '/etc/clickhouse-server/config.d/docker_related_config.xml'.
clickhouse_1    | Saved preprocessed configuration to '/var/lib/clickhouse/preprocessed_configs/config.xml'.
clickhouse_1    | Processing configuration file '/etc/clickhouse-server/users.xml'.
clickhouse_1    | Merging configuration file '/etc/clickhouse-server/users.d/chroma.xml'.
clickhouse_1    | Saved preprocessed configuration to '/var/lib/clickhouse/preprocessed_configs/users.xml'.
chromadb        | Collecting hnswlib
chromadb        |   Downloading hnswlib-0.7.0.tar.gz (33 kB)
chromadb        |   Installing build dependencies: started
chromadb        |   Installing build dependencies: finished with status 'done'
chromadb        |   Getting requirements to build wheel: started
chromadb        |   Getting requirements to build wheel: finished with status 'done'
chromadb        |   Preparing metadata (pyproject.toml): started
chromadb        |   Preparing metadata (pyproject.toml): finished with status 'done'
chromadb        | Collecting numpy
chromadb        |   Downloading numpy-1.24.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.3 MB)
chromadb        |      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 17.3/17.3 MB 2.1 MB/s eta 0:00:00
chromadb        | Building wheels for collected packages: hnswlib
chromadb        |   Building wheel for hnswlib (pyproject.toml): started
chromadb        |   Building wheel for hnswlib (pyproject.toml): finished with status 'done'
chromadb        |   Created wheel for hnswlib: filename=hnswlib-0.7.0-cp310-cp310-linux_x86_64.whl size=2148123 sha256=82c011330d7581e4637330c3d816a83b7bd3b2f6c931434218cc723001d57037
chromadb        |   Stored in directory: /tmp/pip-ephem-wheel-cache-794boqr0/wheels/8a/ae/ec/235a682e0041fbaeee389843670581ec6c66872db856dfa9a4
chromadb        | Successfully built hnswlib
chromadb        | Installing collected packages: numpy, hnswlib
chromadb        |   Attempting uninstall: numpy
chromadb        |     Found existing installation: numpy 1.24.3
chromadb        |     Uninstalling numpy-1.24.3:
chromadb        |       Successfully uninstalled numpy-1.24.3
chromadb        |   Attempting uninstall: hnswlib
chromadb        |     Found existing installation: hnswlib 0.7.0
chromadb        |     Uninstalling hnswlib-0.7.0:
chromadb        |       Successfully uninstalled hnswlib-0.7.0
chromadb        | Successfully installed hnswlib-0.7.0 numpy-1.24.3
chromadb        | WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
chromadb        | 
chromadb        | [notice] A new release of pip is available: 23.0.1 -> 23.1.2
chromadb        | [notice] To update, run: pip install --upgrade pip
chromadb        | 2023-06-14 10:35:19 INFO     chromadb.telemetry.posthog Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.
chromadb        | 2023-06-14 10:35:19 INFO     chromadb        Running Chroma using direct local API.
chromadb        | 2023-06-14 10:35:19 INFO     chromadb        Using Clickhouse for database
chromadb        | 2023-06-14 10:35:20 INFO     uvicorn.error   Started server process [50]
chromadb        | 2023-06-14 10:35:20 INFO     uvicorn.error   Waiting for application startup.
chromadb        | 2023-06-14 10:35:20 INFO     uvicorn.error   Application startup complete.
chromadb        | 2023-06-14 10:35:20 INFO     uvicorn.error   Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
anything-llm    | SELECT * FROM workspaces WHERE slug = 'reports'
anything-llm    | SELECT * FROM workspace_documents WHERE workspaceId = 1 
anything-llm    | SELECT * FROM workspaces WHERE slug = 'reports'
anything-llm    | SELECT * FROM workspace_documents WHERE workspaceId = 1 
anything-llm    | Adding new vectorized document into namespace reports
anything-llm    | Chunks created from document: 1
chromadb        | 2023-06-14 10:49:58 INFO     uvicorn.access  172.24.0.3:47680 - "GET /api/v1/heartbeat HTTP/1.1" 200
chromadb        | 2023-06-14 10:49:58 INFO     chromadb.db.clickhouse collection with name reports already exists, returning existing collection
chromadb        | 2023-06-14 10:49:58 WARNING  chromadb.api.models.Collection No embedding_function provided, using default embedding function: SentenceTransformerEmbeddingFunction
chromadb        | 2023-06-14 10:50:02 INFO     uvicorn.access  172.24.0.3:47686 - "POST /api/v1/collections HTTP/1.1" 200
anything-llm    | Inserting vectorized chunks into Chroma collection.
anything-llm    | addDocumentToNamespace Required parameter collectionId was null or undefined when calling add.
anything-llm    | Failed to vectorize custom-documents/october2019-final-pg1-f5df906b-935d-4a4e-8b14-c1245edac3be.json
anything-llm    | SELECT * FROM workspaces WHERE slug = 'reports'
anything-llm    | SELECT * FROM workspace_documents WHERE workspaceId = 1 
anything-llm    | SELECT * FROM workspaces  
chromadb        | 2023-06-14 10:50:03 INFO     uvicorn.access  172.24.0.3:47680 - "GET /api/v1/heartbeat HTTP/1.1" 200
anything-llm    | SELECT * FROM workspaces WHERE slug = 'reports'
anything-llm    | SELECT * FROM workspace_documents WHERE workspaceId = 1 
chromadb        | 2023-06-14 10:50:03 WARNING  chromadb.api.models.Collection No embedding_function provided, using default embedding function: SentenceTransformerEmbeddingFunction
anything-llm    | SELECT * FROM workspaces WHERE slug = 'reports'
anything-llm    | SELECT * FROM workspace_documents WHERE workspaceId = 1 
anything-llm    | SELECT * FROM workspace_chats WHERE workspaceId = 1 AND include = true  ORDER BY id ASC
chromadb        | 2023-06-14 10:50:03 INFO     uvicorn.access  172.24.0.3:47686 - "GET /api/v1/collections HTTP/1.1" 200
chromadb        | 2023-06-14 10:50:03 WARNING  chromadb.api.models.Collection No embedding_function provided, using default embedding function: SentenceTransformerEmbeddingFunction
chromadb        | 2023-06-14 10:50:03 INFO     uvicorn.access  172.24.0.3:47680 - "GET /api/v1/collections/reports HTTP/1.1" 200
anything-llm    | Required parameter collectionId was null or undefined when calling count. RequiredError: Required parameter collectionId was null or undefined when calling count.
anything-llm    |     at Object.count (/app/server/node_modules/chromadb/dist/main/generated/api.js:150:23)
anything-llm    |     at Object.count (/app/server/node_modules/chromadb/dist/main/generated/api.js:730:91)
anything-llm    |     at ApiApi.count (/app/server/node_modules/chromadb/dist/main/generated/api.js:1188:58)
anything-llm    |     at Collection.count (/app/server/node_modules/chromadb/dist/main/Collection.js:164:41)
anything-llm    |     at Object.totalIndicies (/app/server/utils/vectorDbProviders/chroma/index.js:42:40)
anything-llm    |     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
anything-llm    |     at async /app/server/endpoints/system.js:74:27 {
anything-llm    |   field: 'collectionId'
anything-llm    | }

adieyal avatar Jun 14 '23 10:06 adieyal

chromadb.api.models.Collection No embedding_function provided this line tells me something isn't right. Do you have an openAI API key set or are you not wanting to use openAI for embeddings and want to use the default chroma embeddings?

timothycarambat avatar Jun 14 '23 16:06 timothycarambat

The key is set in the .env file - I noticed that but I didn't investigate. I'll dig to see if it's related.

adieyal avatar Jun 14 '23 20:06 adieyal