P0 BUG: wallet/balance 500 hiba - stale pycache miatt #420
Notifications
Total Time Spent: 2 minutes
kincses
2 minutes
No due date set.
Dependencies
No dependencies set.
Reference: kincses/service-finder#420
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Mérföldkő: Epic 3 - Financial Motor
Cél: A GET /api/v1/billing/wallet/balance végpont 500 Internal Server Error hibájának kivizsgálása és javítása
🔗 Függőségek (Dependencies)
📝 Elemzés
A hiba: 'FinancialLedger' object has no attribute 'description'
A FinancialLedger modellnek (audit.py:78) NINCS 'description' mezője - csak 'details' (JSONB). A forráskód (billing_engine.py, billing.py) helyesen a details JSON-ból olvassa ki a leírást. A konténer azonban régi .pyc bytecode-ot futtatott, ami még egy korábbi verzióra hivatkozott, ahol létezhetett ez az attribútum.
Root Cause: Stale Python bytecode cache a konténerben.
Fix: Pycache törlése és konténer újraindítása. A docker-compose.yml-ben a COPY parancs miatt a forráskód változásai nem feltétlenül érvényesülnek újraépítés nélkül, de a volume mountolt app könyvtárban a .pyc fájlok cache-elődnek.
▶️ Munka megkezdve: 2026-07-26 14:56:36
✅ Munka befejezve: 2026-07-26 14:58:56
Technikai Összefoglaló:
Root Cause: Stale Python .pyc bytecode cache in sf_api container. The FinancialLedger model has no 'description' column, but old cached bytecode referenced entry.description causing AttributeError. Fix: Cleared all pycache dirs and restarted container. Preventive: Add PYTHONDONTWRITEBYTECODE=1 to docker-compose.yml and auto-purge pycache on startup. Documentation: docs/p0_wallet_balance_500_bugfix_2026-07-26.md
⏱️ Az idő rögzítve.