Skip to content

fix: make InitAuthConfig graceful on missing IAM app#22

Merged
hanzo-dev merged 1 commit intomainfrom
fix/graceful-auth-init
Mar 18, 2026
Merged

fix: make InitAuthConfig graceful on missing IAM app#22
hanzo-dev merged 1 commit intomainfrom
fix/graceful-auth-init

Conversation

@hanzo-dev
Copy link
Member

Summary

  • Changes InitAuthConfig() from panic() to log-and-return when IAM application or cert is not found
  • Fixes CrashLoopBackOff on 6/8 cloud-api pods caused by missing hanzo-cloud-client-id IAM app
  • Adds billing usage record writer for invoice reconciliation via ZAP/ClickHouse

Root Cause

The init() function in controllers/account.go calls InitAuthConfig() which panics if the IAM application specified in config doesn't exist. When the newer image (post v1.766.4) was deployed, it referenced hanzo-cloud-client-id which had not been created in IAM yet, causing all pods to crash on startup.

Fix

Replace panic() with fmt.Printf("[WARN]...") + return. The service starts with auth features disabled but remains available for other endpoints (search, chat, etc).

Test plan

  • CI passes (go build, go test)
  • After merge, new image deploys without CrashLoopBackOff
  • Search endpoints respond correctly

… app

The cloud-api was crashing on startup (CrashLoopBackOff, 6/8 pods) because
InitAuthConfig() panics when the IAM application or cert is not found.

Changed all panic() calls to log warnings and return gracefully, allowing
the service to start with auth features disabled. This lets pods stabilize
while IAM configuration is being set up.

Also adds billing usage record writer for invoice reconciliation.
@hanzo-dev hanzo-dev merged commit 82e1ce4 into main Mar 18, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant