supabase-kubernetes icon indicating copy to clipboard operation
supabase-kubernetes copied to clipboard

Fixes **401 Unauthorized** errors when `vector` forwards logs to `log…

Open Adityakk9031 opened this issue 3 months ago • 4 comments

…flare` in self-hosted Kubernetes deployments.

Summary

Fixes 401 Unauthorized errors when vector forwards logs to logflare in self-hosted Kubernetes deployments. The issue was due to authentication method mismatch:

  • Old (broken): API key passed via ?api_key=... query param
  • New (fixed): API key passed via Authorization: Bearer ... header

This change aligns the Kubernetes Helm chart with the working Docker Compose setup and Logflare’s expected authentication model.


Related Issue

Closes supabase/supabase#37998


Changes

  • Updated vector sink configuration in Helm chart:
    • Replace ?api_key=SECRET[credentials.logflare_api_key] in sink URIs with standard endpoints.
    • Add Authorization: Bearer SECRET[credentials.logflare_api_key] headers in each logflare sink.
  • Ensured DB sink still routes through Kong for startup ordering.
  • No breaking changes for users with correct LOGFLARE_API_KEY.

Verification

  1. Deployed Supabase via Helm on Kubernetes.
  2. Confirmed all pods healthy (kubectl get pods).
  3. Observed no more 401 Unauthorized errors in vector logs.
  4. Logs successfully appear in Logflare dashboard.
  5. Curling /health on logflare pod returns 200 OK as before.

Checklist

  • [x] Verified in Kubernetes environment
  • [x] Ensured parity with Docker Compose behavior
  • [x] Helm values backward-compatible
  • [ ] Added release note

Release Note

Fixed an authentication bug where `vector` failed with `401 Unauthorized` when sending logs to `logflare` in self-hosted Kubernetes deployments.
Authentication is now handled via `Authorization: Bearer <LOGFLARE_API_KEY>` headers instead of query parameters.

## What kind of change does this PR introduce?

Bug fix, feature, docs update, ...

## What is the current behavior?

Please link any relevant issues here.

## What is the new behavior?

Feel free to include screenshots if it includes visual changes.

## Additional context

Add any other context or screenshots.

Adityakk9031 avatar Aug 21 '25 11:08 Adityakk9031