Skip to content

Instantly share code, notes, and snippets.

@salehi
Created January 6, 2026 12:10
Show Gist options
  • Select an option

  • Save salehi/474f1205f16f742b233ff4d847243494 to your computer and use it in GitHub Desktop.

Select an option

Save salehi/474f1205f16f742b233ff4d847243494 to your computer and use it in GitHub Desktop.
Fix for OpenReplay /v2/api/* 404 errors after running openreplay -u - patches ingress to route to correct backend service

OpenReplay Post-Upgrade Fix: Health API 404

Problem

After running openreplay -u, the /v2/api/* endpoints return 404 because the ingress gets reset to default values that point to the wrong backend service.

Root Cause

  • The api-openreplay ingress routes to api-openreplay:8080 (Go server)
  • But the actual API (health, signup, etc.) lives on chalice-openreplay:8000 at /api/*
  • The rewrite target also needs to be /api/$1 instead of /$1

Fix Commands

Run these after every openreplay -u:

# Point ingress to chalice service
kubectl patch ingress -n app api-openreplay --type='json' -p='[
  {"op": "replace", "path": "/spec/rules/0/http/paths/0/backend/service/name", "value": "chalice-openreplay"},
  {"op": "replace", "path": "/spec/rules/0/http/paths/0/backend/service/port/number", "value": 8000}
]'

# Fix rewrite target
kubectl annotate ingress -n app api-openreplay nginx.ingress.kubernetes.io/rewrite-target='/api/$1' --overwrite

Verify

# Test health endpoint
curl -s "https://replay.example.com/v2/api/"
# Expected: {}

# Test signup endpoint
curl -s "https://replay.example.com/v2/api/signup"
# Expected: {"data":{"tenants":true,...}}

Notes

  • The health endpoint is at /api/ (root), not /api/health
  • Chalice is a Python/FastAPI service serving the main API
  • The Go api-openreplay service serves different functionality
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment