Skip to content

[Bug]: KeyError: '_type' when using Docker with versions >1.0.0 (including latest) #4386

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
aryanranderiya opened this issue Apr 25, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@aryanranderiya
Copy link

aryanranderiya commented Apr 25, 2025

What happened?

I'm using ChromaDB in a Dockerized FastAPI app and encountered the following error when calling await client.create_collection():

f"Trying to instantiate configuration of type {cls.__name__} from JSON with type {json_map['_type']}"
KeyError: '_type'
  • This is running inside a Docker container (Python 3.12).
  • Downgrading to 1.0.0 temporarily resolves the issue.
  • When pinging localhost:8080/api/v2/heartbeat it works fine — so the server is reachable and responsive.

Versions

Docker image: chromadb/chroma:latest
Python 3.12.10
Ubuntu 24 LTS

✅ Works fine with version 1.0.0
❌ Fails with version 1.0.6
❌ Fails with the latest version (as of now)

Relevant log output

File "/app/app/db/chromadb.py", line 221, in init_chroma
await client.create_collection(
File "/usr/local/lib/python3.12/site-packages/chromadb/api/async_client.py", line 181, in create_collection
model = await self._server.create_collection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/chromadb/telemetry/opentelemetry/__init__.py", line 134, in async_wrapper
return await f(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/chromadb/api/async_fastapi.py", line 291, in create_collection
model = CollectionModel.from_json(resp_json)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/chromadb/types.py", line 156, in from_json
configuration = CollectionConfigurationInternal.from_json(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/chromadb/api/configuration.py", line 209, in from_json
f"Trying to instantiate configuration of type {cls.__name__} from JSON with type {json_map['_type']}"
~~~~~~~~~~~~^^^^^^^^
KeyError: '_type'
@aryanranderiya aryanranderiya added the bug Something isn't working label Apr 25, 2025
@aryanranderiya aryanranderiya changed the title [Bug]: KeyError: '_type' when calling create_collection using Docker with versions >1.0.0 [Bug]: KeyError: '_type' when using Docker with versions >1.0.0 (including latest) Apr 25, 2025
@osamaoam
Copy link

'_type' can be resolved by upgrading the dependencies for the package. Occurs when a package is updated but dependencies are not.

@jairad26
Copy link
Contributor

jairad26 commented Apr 25, 2025

Hi, as part of 1.0.7, the dockerfile has been updated to run against the upgraded Rust implementation of chromadb, which requires an upgrade to the python client. What version of the python client are you running? could you try upgrading to latest, 1.0.7?

@CoderDinosaur
Copy link

Hi, I meet the same problem, even if I pull the newest docker image (chromadb/chroma:1.0.8.dev14).

Please tell me what dependency I show update them?

@tazarov
Copy link
Contributor

tazarov commented Apr 27, 2025

hey @CoderDinosaur, when you use Chroma in a client/server mode. Your server is the docker image but when accessing you will use either the core lib chromadb or the thin client chromadb-client. You need to make sure that either chromadb or chromadb-client are with the same version 1.0.7:

pip install --upgrade chromadb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants