Skip to content

ChromaDB.Client.ChromaException: Unexpected status code: MethodNotAllowed. #79

Open

Description

@hannahhaken

I have installed 1.0.0 of the SDK and this is the code I have implemented:

        var configOptions = new ChromaConfigurationOptions(uri: chromaUri);
        using var httpClient = new HttpClient();
        var chromaClient = new ChromaClient(configOptions, httpClient);
        
        var collection = await chromaClient.GetOrCreateCollection(collectionName);
        return new ChromaCollectionClient(collection, configOptions, httpClient);

When I run the code with a collection name against chromadb/chroma:1.0.3 running locally in Docker, I get the following error:

Unhandled exception. ChromaDB.Client.ChromaException: Unexpected status code: MethodNotAllowed.
   at ChromaDB.Client.Common.HttpClientHelpers.Send[TResponse](HttpClient httpClient, HttpRequestMessage httpRequestMessage)
   at ChromaDB.Client.Common.HttpClientHelpers.Post[TInput,TResponse](HttpClient httpClient, String endpoint, TInput input, RequestQueryParams queryParams)
   at ChromaDB.Client.ChromaClient.GetOrCreateCollection(String name, Dictionary`2 metadata, String tenant, String database)
   at ConsoleApp1.ChromeCollectionFactory.CreateAsync(String chromaUri, String collectionName) in /Users/hannahhaken/workarea/LLamaSharp/ConsoleApp1/ChromaConnector.cs:line 47
   at Program.<Main>$(String[] args) in /Users/hannahhaken/workarea/LLamaSharp/ConsoleApp1/Program.cs:line 11
   at Program.<Main>(String[] args)

Any idea what could be causing this?

Activity

  1. jeremiahhuang commented on Apr 13, 2025

    @jeremiahhuang

    There is a mismatch occuring. If you run in docker via:
    docker run -v ./chroma-data:/data -p 8000:8000 chromadb/chroma

    go to localhost:8000/docs and you'll notice they are all v2 api calls.

    if you run pip install chromadb then "chroma run" you'll see v1 api calls in docs.

    if you fiddler your application with this client, it just botches the call completely(if you look at the api docs).
    POST http://localhost:8000/api/v1/collections?tenant=localtestTenant&database=localtestDb HTTP/1.1
    Host: localhost:8000
    Accept: application/json
    Content-Type: application/json; charset=utf-8
    Content-Length: 62

    {"name":"data-textfiles","metadata":null,"get_or_create":true}

  2. bnuzhouwei commented on May 6, 2025

    @bnuzhouwei

    How to fix?

  3. inlineHamed commented on May 29, 2025

    @inlineHamed
  4. Laurianti commented on Oct 3, 2026

    @Laurianti

    The 1.x client calls the v1 API, which Chroma 1.x no longer serves. ChromaDotNet.Client uses the v2 API (#84).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions