chroma icon indicating copy to clipboard operation
chroma copied to clipboard

[Bug]: 405 (Method Not Allowed)

Open DmitryLukyanov opened this issue 8 months ago • 15 comments

What happened?

I have an error when I'm running request to chromadb from semantic kernel in .NET with docker compose. NOTE: the request without container configured if I spawn chroma with this command chroma run --host localhost --port 8000 works correctly.

The error I see is POST collections operation failed: Response status code does not indicate success: 405 (Method Not Allowed). during collection creating.

The docker compose file:

    version: '3.9'

    networks:
      net:
        driver: bridge

    services:

      chroma:
        image: chromadb/chroma:0.6.4.dev283
        volumes:
          - chroma-data:/chroma/chroma
        restart: unless-stopped # possible values are: "no", always", "on-failure", "unless-stopped"
        ports:
          - "8000:8000"
        healthcheck:
          # Adjust below to match your container port
          test: [ "CMD", "/bin/bash", "-c", "cat < /dev/null > /dev/tcp/localhost/8000" ]
          interval: 30s
          timeout: 10s
          retries: 3
        networks:
          - net

      telegrambot:
        image: ${DOCKER_REGISTRY-}telegrambot
        build:
          context: .
          dockerfile: TelegramBot/Dockerfile
        depends_on:
          chroma:
            condition: service_healthy
        environment:
          - OPENAI_API_KEY=${OPENAI_API_KEY}
          - TELEGRAM_BOT_API_KEY=${TELEGRAM_BOT_API_KEY}
          - CHROMA_ENDPOINT=http://chroma:8000
        networks:
          - net 

    volumes:
      chroma-data:
        driver: local

I use the prerelease version to avoid the bug described here: https://github.com/chroma-core/chroma/issues/3798

Actual code inside CreateCollection method can be found here: https://github.com/microsoft/semantic-kernel/blob/4fdaf67b5a6314311676bea2a36a3b3dc2c08662/dotnet/src/Connectors/Connectors.Memory.Chroma/ChromaClient.cs#L63.

Versions

Chroma: 0.6.4.dev283

Relevant log output

// Chromadb is launched
...
chroma-1       | OpenTelemetry is not enabled because it is missing from the config.
chroma-1       | 
chroma-1       | Listening on 0.0.0.0:8000
telegrambot-1  | info: Microsoft.Hosting.Lifetime[0]
telegrambot-1  |       Application started. Press Ctrl+C to shut down.
telegrambot-1  | info: Microsoft.Hosting.Lifetime[0]
telegrambot-1  |       Application started. Press Ctrl+C to shut down.
telegrambot-1  | info: Microsoft.Hosting.Lifetime[0]
telegrambot-1  |       Hosting environment: Production
telegrambot-1  | info: Microsoft.Hosting.Lifetime[0]
telegrambot-1  |       Content root path: /app
telegrambot-1  | info: Microsoft.Hosting.Lifetime[0]
telegrambot-1  |       Hosting environment: Production
telegrambot-1  | info: Microsoft.Hosting.Lifetime[0]
telegrambot-1  |       Content root path: /app
telegrambot-1  | info: TelegramBot.Worker[0]
telegrambot-1  |       Bot Id: 1234567890, Bot Name: ai_bot
telegrambot-1  | info: TelegramBot.Worker[0]
telegrambot-1  |       Bot Id: 1234567890, Bot Name: ai_bot
telegrambot-1  | info: TelegramBot.Worker[0]
telegrambot-1  |       Telegram Bot started.
telegrambot-1  | info: TelegramBot.Worker[0]
telegrambot-1  |       Telegram Bot started.
telegrambot-1  | dbug: Microsoft.SemanticKernel.Connectors.Chroma.ChromaClient[0]
telegrambot-1  |       Creating collection myCvMemory
telegrambot-1  | fail: Microsoft.SemanticKernel.Connectors.Chroma.ChromaClient[0]
telegrambot-1  |       POST collections operation failed: Response status code does not indicate success: 405 (Method Not Allowed)., 
telegrambot-1  |       Microsoft.SemanticKernel.HttpOperationException: Response status code does not indicate success: 405 (Method Not Allowed).
telegrambot-1  |        ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 405 (Method Not Allowed).
telegrambot-1  |          at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
telegrambot-1  |          at Microsoft.SemanticKernel.Http.HttpClientExtensions.SendWithSuccessCheckAsync(HttpClient client, HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
telegrambot-1  |          --- End of inner exception stack trace ---
telegrambot-1  |          at Microsoft.SemanticKernel.Http.HttpClientExtensions.SendWithSuccessCheckAsync(HttpClient client, HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
telegrambot-1  |          at Microsoft.SemanticKernel.Http.HttpClientExtensions.SendWithSuccessCheckAsync(HttpClient client, HttpRequestMessage request, CancellationToken cancellationToken)
telegrambot-1  |          at Microsoft.SemanticKernel.Connectors.Chroma.ChromaClient.ExecuteHttpRequestAsync(HttpRequestMessage request, CancellationToken cancellationToken)
telegrambot-1  | fail: Microsoft.Extensions.Hosting.Internal.Host[9]
telegrambot-1  |       BackgroundService failed
telegrambot-1  |       Microsoft.SemanticKernel.HttpOperationException: Response status code does not indicate success: 405 (Method Not Allowed).
telegrambot-1  |        ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 405 (Method Not Allowed).
telegrambot-1  |          at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
telegrambot-1  |          at Microsoft.SemanticKernel.Http.HttpClientExtensions.SendWithSuccessCheckAsync(HttpClient client, HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
telegrambot-1  |          --- End of inner exception stack trace ---
telegrambot-1  |          at Microsoft.SemanticKernel.Http.HttpClientExtensions.SendWithSuccessCheckAsync(HttpClient client, HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
telegrambot-1  |          at Microsoft.SemanticKernel.Http.HttpClientExtensions.SendWithSuccessCheckAsync(HttpClient client, HttpRequestMessage request, CancellationToken cancellationToken)
telegrambot-1  |          at Microsoft.SemanticKernel.Connectors.Chroma.ChromaClient.ExecuteHttpRequestAsync(HttpRequestMessage request, CancellationToken cancellationToken)
telegrambot-1  |          at Microsoft.SemanticKernel.Connectors.Chroma.ChromaClient.CreateCollectionAsync(String collectionName, CancellationToken cancellationToken)
...

DmitryLukyanov avatar Mar 01 '25 15:03 DmitryLukyanov