Skip to content

supamem init ignores QDRANT_API_KEY environment variable (causing 401 Unauthorized) #1

Description

@raphaelbahat

Describe the Bug

When running supamem init (with or without --qdrant-url), the Greenfield bootstrap ignores the QDRANT_API_KEY and fallback QDRANT_URL environment variables.

Specifically, inside supamem/init.py, the Qdrant client is instantiated via:

client = _get_client(url)

which defaults to api_key="" (unauthorized). Consequently, if Qdrant requires authentication/API keys, supamem init fails with:

✗ failed to create collection: Unexpected Response: 401 (Unauthorized)
Raw response content:
b'Must provide an API key or an Authorization bearer token'

even if QDRANT_API_KEY is present in the environment.

Additionally, probe_qdrant fails to probe /healthz successfully if the endpoint requires authorization, since it doesn't include the api-key header in the probe request.

To Reproduce

  1. Set QDRANT_API_KEY in the environment.
  2. Run supamem init --yes --qdrant-url "https://authorized-qdrant-instance.com" --force.
  3. See 401 Unauthorized error during collection creation.

Expected Behavior

supamem init should:

  1. Fall back to QDRANT_URL environment variable if --qdrant-url is omitted.
  2. Respect QDRANT_API_KEY when probing Qdrant and instantiating the Qdrant client during initialization.

Activity

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