chroma-core / chroma

the AI-native open-source embedding database
https://www.trychroma.com/
Apache License 2.0
15.68k stars 1.32k forks source link

[Bug]: get embeddings result sometime work ,sometime error #1979

Open zyu opened 8 months ago

zyu commented 8 months ago

What happened?

r = collection.get( where={"timespan": {"$gte": 1712435107}}, include=[ "embeddings" ] )

Traceback (most recent call last): File "/opt/miniconda3/lib/python3.12/site-packages/chromadb/api/fastapi.py", line 652, in raise_chroma_error resp.raise_for_status() File "/opt/miniconda3/lib/python3.12/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http://localhost:8090/api/v1/collections/183b4fe9-b24a-4136-ad77-0943677de6a5/get

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/zyu/code/repeat/updatetime.py", line 38, in r = collection.get( ^^^^^^^^^^^^^^^ File "/opt/miniconda3/lib/python3.12/site-packages/chromadb/api/models/Collection.py", line 211, in get get_results = self._client._get( ^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/lib/python3.12/site-packages/chromadb/telemetry/opentelemetry/init.py", line 127, in wrapper return f(*args, **kwargs) ^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/lib/python3.12/site-packages/chromadb/api/fastapi.py", line 436, in _get raise_chroma_error(resp) File "/opt/miniconda3/lib/python3.12/site-packages/chromadb/api/fastapi.py", line 654, in raise_chroma_error raise (Exception(resp.text)) Exception: {"error":"IndexError('list assignment index out of range')"}

sometime work ,but sometime error

Versions

v0.3.22

Relevant log output

No response

zyu commented 8 months ago

File "/opt/miniconda3/lib/python3.12/site-packages/chromadb/auth/fastapi.py", line 242, in wrapped return f(*args, *kwargs) ^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/lib/python3.12/site-packages/chromadb/server/fastapi/init.py", line 563, in get return self._api._get( ^^^^^^^^^^^^^^^ File "/opt/miniconda3/lib/python3.12/site-packages/chromadb/telemetry/opentelemetry/init.py", line 127, in wrapper if trace_granularity < granularity: ^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/lib/python3.12/site-packages/chromadb/rate_limiting/init.py", line 45, in wrapper return f(self, args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/lib/python3.12/site-packages/chromadb/api/segment.py", line 538, in _get vectors = vector_segment.get_vectors(ids=vector_ids) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/lib/python3.12/site-packages/chromadb/telemetry/opentelemetry/init.py", line 127, in wrapper if trace_granularity < granularity: ^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/lib/python3.12/site-packages/chromadb/segment/impl/vector/local_persistent_hnsw.py", line 330, in get_vectors results[id_to_index[id]] = VectorEmbeddingRecord(


IndexError: list assignment index out of range
nicolasgere commented 7 months ago

Hello @zyu, thank you for reporting the error. I was not able to reproduce it with version 0.3.22. Could you provide more details about the code and the context in which the error occurs? Did you try update to the last version of chroma?

Thanks

tazarov commented 7 months ago

@zyu, In the trace I see references to opentelemetry. We've added OTEL only in version 0.4.x. Can you please double check your Chroma version - pip list | grep chromadb. Thank you.

tazarov commented 7 months ago

@zyu, the issue affects 0.4.x and is being worked on. We'll have a PR for it soon.