Skip to content

Backend runtime missing Google OAuth secret wiring after key rotation #8719

Closed

Description

@Git-on-my-level

Summary

After the emergency key rotation for the OpenAI / Google mobile-baked secret leak, Google Secret Manager contains rotated values, but the backend Kubernetes ExternalSecret / Helm env wiring does not sync or inject several Google-related secrets into runtime pods.

This means some product integrations can still be broken even though the underlying provider-side rotation succeeded and the core deployments are healthy.

Evidence

1. Runtime Kubernetes secrets are missing Google OAuth values

Checked live K8s secrets after the redeploy/cherry-pick rollout:

prod OPENAI_API_KEY present True
prod GOOGLE_CLIENT_SECRET present False
prod GOOGLE_CLIENT_ID present False
prod GOOGLE_MAPS_API_KEY present True
prod GOOGLE_MAPS_ANDROID_API_KEY present False

dev OPENAI_API_KEY present True
dev GOOGLE_CLIENT_SECRET present False
dev GOOGLE_CLIENT_ID present False
dev GOOGLE_MAPS_API_KEY present True
dev GOOGLE_MAPS_ANDROID_API_KEY present False

Commands used were equivalent to:

kubectl -n prod-omi-backend get secret prod-omi-backend-secrets -o jsonpath='{.data.GOOGLE_CLIENT_SECRET}' | base64 -d
kubectl -n dev-omi-backend get secret dev-omi-backend-secrets -o jsonpath='{.data.GOOGLE_CLIENT_SECRET}' | base64 -d

The values decoded to empty output. Secret values were not printed.

2. ExternalSecret values files do not include these keys

Checked-in ExternalSecret config currently syncs OPENAI_API_KEY and GOOGLE_MAPS_API_KEY, but not the rotated OAuth / Android Maps keys:

  • backend/charts/backend-secrets/prod_omi_backend_secrets_values.yaml

    • includes OPENAI_API_KEY
    • includes GOOGLE_MAPS_API_KEY
    • missing GOOGLE_CLIENT_ID
    • missing GOOGLE_CLIENT_SECRET
    • missing GOOGLE_MAPS_ANDROID_API_KEY
  • backend/charts/backend-secrets/dev_omi_backend_secrets_values.yaml

    • same missing keys for dev runtime secret sync

3. Backend and pusher Helm values do not inject Google OAuth env vars

Checked-in deployment values inject OPENAI_API_KEY and GOOGLE_MAPS_API_KEY, but not Google OAuth vars:

  • backend/charts/backend-listen/prod_omi_backend_listen_values.yaml

    • injects OPENAI_API_KEY
    • injects GOOGLE_MAPS_API_KEY
    • missing GOOGLE_CLIENT_ID
    • missing GOOGLE_CLIENT_SECRET
  • backend/charts/backend-listen/dev_omi_backend_listen_values.yaml

    • same pattern

Live prod deployment env inspection showed the same: backend-listen and pusher reference OPENAI_API_KEY and GOOGLE_MAPS_API_KEY, but not GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET.

4. Runtime logs show user-facing Google integration failure

Prod pusher logs after the rotation/redeploy contained:

ERROR:utils.retrieval.tools.google_utils:🔄 Missing GOOGLE_CLIENT_ID or GOOGLE_CLIENT_SECRET env vars

This came after a Google API call returned 401 for a calendar request:

HTTP Request: GET https://www.googleapis.com/calendar/v3/calendars/primary/events?... "HTTP/1.1 401 Unauthorized"

Relevant code path:

  • backend/utils/retrieval/tools/google_utils.py
    • reads GOOGLE_CLIENT_ID
    • reads GOOGLE_CLIENT_SECRET
    • logs Missing GOOGLE_CLIENT_ID or GOOGLE_CLIENT_SECRET env vars
    • returns None

User impact

Likely broken or degraded user-facing features:

  • Google Calendar / Google account integrations that need token refresh or OAuth token exchange.
  • Any retrieval/tool path that calls backend/utils/retrieval/tools/google_utils.py and needs GOOGLE_CLIENT_ID + GOOGLE_CLIENT_SECRET.
  • Mobile/Android Maps follow-up config may be incomplete: a new Android-restricted Maps key was provisioned in Secret Manager as GOOGLE_MAPS_ANDROID_API_KEY, but the backend K8s ExternalSecret does not sync that key yet. If any runtime/backend path needs that key, it will not see it.

Core liveness was healthy at the time of investigation:

  • https://api.omi.me/v1/health -> 200
  • https://api.omiapi.com/v1/health -> 200
  • https://agent.omi.me/health -> 200
  • https://agent.omiapi.com/health -> 200

So this is not a full outage; it is a secret wiring / integration breakage issue.

Expected behavior

After rotating secrets in Google Secret Manager, the runtime services that require them should receive the new values via Kubernetes secrets and env vars.

Expected runtime env/secret availability for relevant services:

  • GOOGLE_CLIENT_ID
  • GOOGLE_CLIENT_SECRET
  • possibly GOOGLE_MAPS_ANDROID_API_KEY if backend/runtime code or mobile build jobs are intended to consume it

Suggested fix

  1. Add GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET to backend ExternalSecret values for prod and dev:

    • backend/charts/backend-secrets/prod_omi_backend_secrets_values.yaml
    • backend/charts/backend-secrets/dev_omi_backend_secrets_values.yaml
  2. Inject GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET into services that use Google OAuth/calendar integrations, at minimum likely:

    • backend-listen
    • pusher if it runs realtime integrations / retrieval tools
  3. Decide whether GOOGLE_MAPS_ANDROID_API_KEY belongs in backend runtime secrets, mobile CI secrets, or both. If runtime needs it, add it to ExternalSecret and deployment env wiring.

  4. Deploy and verify:

kubectl -n prod-omi-backend get secret prod-omi-backend-secrets -o jsonpath='{.data.GOOGLE_CLIENT_SECRET}' | base64 -d | wc -c
kubectl -n dev-omi-backend get secret dev-omi-backend-secrets -o jsonpath='{.data.GOOGLE_CLIENT_SECRET}' | base64 -d | wc -c
  1. Roll affected deployments and check logs no longer contain:
Missing GOOGLE_CLIENT_ID or GOOGLE_CLIENT_SECRET env vars

Incident context

This was found during the post-rotation validation for leaked mobile-baked keys. The provider-side rotations were completed, and Secret Manager was updated, but the Kubernetes runtime secret wiring did not include the rotated Google OAuth values.

Activity

  1. added
    bug
    backend
    on Jul 1, 2026
  2. added a commit that references this issue on Jul 1, 2026
    a175243
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

    backendbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions