Skip to content

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

Closed
@aryanranderiya

Description

@aryanranderiya

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions