Production Database Analysis
**Date:** 2026-05-02
**Tenant:** Brennan Machinery (brennan)
**Issue:** Worker showing "Setting not found or NULL" despite BYOK keys configured
Tenant Details
- **Tenant ID:** 31c06fc4-db22-4740-83ea-48ac14f25810
- **Subdomain:** brennan
- **Plan:** Free tier (assumed based on routing behavior)
BYOK API Keys (All Present ✅)
| Provider | Setting Key | Status | Notes |
|---|---|---|---|
| OpenAI | OPENAI_API_KEY | ✅ Present | sk-proj-* |
GOOGLE_API_KEY | ✅ Present | AIzaSyD0-* | |
| DeepSeek | DEEPSEEK_API_KEY | ✅ Present | sk-d9bab-* |
| MiniMax 2.7 | MINIMAX_2_7_API_KEY | ✅ Present | sk-api-o* |
| Tavily | TAVILY_API_KEY | ✅ Present | tvly-dev-* |
Worker Logs Error
**Expected:** Worker should find MINIMAX_2_7_API_KEY
**Actual:** "DEBUG BYOK: Setting not found or NULL for minimax"
**Hypothesis:** The get_byok_manager() lookup may be using wrong key name pattern or tenant resolution is failing.
Pricing Cache Status
- **Cache File:**
/app/backend-saas/data/ai_pricing_cache.json - **Models:** 3057 models with permissive capabilities
- **Last Fetch:** 2026-05-02 12:37 UTC (during Docker build)
- **Force Refresh:** ✅ Enabled (commit 2c26a7b89c)
Next Steps
- ✅ BYOK keys are configured in database
- ✅ Pricing cache is populated (3057 models)
- ❓ Worker unable to load BYOK keys despite database having them
- ❓ Check BYOK provider registration for MINIMAX_2_7_API_KEY
Deployment Details
- **Deployment:** atom-saas:deployment-01KQMB038F0GH7694K1A94VBWX
- **Worker Machine:** 6e820410ae49e8
- **Version:** 1989 (cache reload fix)
- **Deployed At:** 2026-05-02 12:38 UTC