Economy runs fail with 400 SPM_CONFIGURATION_UNAVAILABLE while the simulation worker lags an API deploy
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 22/100
Direzione di ricerca
Start in policyengine_api/libs/simulation_entrypoint.py near line 408, where the canonical-spm-v1 capability is checked against /versions and SPMValidationError("SPM_CONFIGURATION_UNAVAILABLE") is raised, then read docs/canonical-spm.md for the intended deploy order. Done means that lookup failures return 503 with Retry-After, and reports created in the window are not left pending with no run. The deploy-ordering part needs maintainer input, so confirm the approach before changing code.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happened
On 2026-10-16, society-wide reports started from the app failed for a period after the API update 71dba65b ("Update PolicyEngine API", 06:55 UTC). Example: report 4526 (requested_at 13:42:09 UTC, reform policy 98772, US, 2026) recorded:
[SOCIETY_WIDE_CALC_FAILED] Society-wide calculation failed (400): {"status": "error", "message": "Cannot validate the selected worker's canonical SPM capability", "result": null, "errors": [{"code": "SPM_CONFIGURATION_UNAVAILABLE", ...}]}
Reports 4524 and 4525 (13:41 UTC) are still pending and never ran. Later, the same economy call for report 4526 succeeded, so the worker caught up and the reform itself was fine.
Cause (from the code)
policyengine_api/libs/simulation_entrypoint.py (~line 408) validates the selected worker's canonical-spm-v1 capability from /versions before cache access or submission, and raises SPMValidationError("SPM_CONFIGURATION_UNAVAILABLE", ...) on any lookup failure. docs/canonical-spm.md says this happens "until such a worker is deployed" (sim-API PR 703). So between the API deploy and a matching worker deploy, every new economy run is refused.
Requests
- Deploy order / readiness: deploy (or verify) the matching simulation worker before the API version that requires its capability goes live, or keep serving with the previous bundle until the worker reports a matching capability.
- Status code: return 503 (with
Retry-After) forSPM_CONFIGURATION_UNAVAILABLE, not 400. It is a server-side readiness condition; a 400 tells clients the request is invalid, so they do not retry, and the app told users to edit their reform. - Stuck reports: reports created during the window stay
pendingwith no active run (4524, 4525). Consider marking themerrorwith a retryable code, or re-queueing them once the worker matches.
The app now treats *_UNAVAILABLE 4xx errors as retryable server faults (PolicyEngine/policyengine-app-v2#1310), but the outage itself needs the API-side fix.
🤖 Generated with Claude Code
- Lingua principale
- Python
- Stelle
- 18
- Fork
- 33
- Merge medio
- 1g 20h
- PR unite (30g)
- 27
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PolicyEngine/policyengine-api
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
PolicyEngine/policyengine-api#3911 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
PolicyEngine/policyengine-api#3910 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
PolicyEngine/policyengine-api#3946 ·
I maintainer di solito rispondono entro 2 giorni
-
Register weighted-microdata rules: weights aren't valuesForse già presa @anth-volk l’ha presa 5 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 18/100
PolicyEngine/policyengine-api#3937 ·
I maintainer di solito rispondono entro 2 giorni
-
Remove the unused economy comparison moduleForse già presa @anth-volk l’ha presa 5 giorni fa. Aperta
Difficoltà 3/5 Mezza giornata Idoneità per principianti 18/100
PolicyEngine/policyengine-api#3935 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di PolicyEngine/policyengine-api
Issue simili
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 66/100
AlexsLemonade/scpca-docs#518 ·
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
rocketride-org/rocketride-server#2705 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
Metabuilder-Labs/tokenjam#786 ·
I maintainer di solito rispondono entro 1 giorno
-
prototype(verifier_token): map disallowed warning to contraindicated before composite precedence checkForse già presa @drk-ram l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
agentrust-io/trace-spec#582 ·
I maintainer di solito rispondono entro 1 giorno
-
area:cli priority:low refactor size:small
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
RonaldHensbergen/composable-data-stack#906 ·
I maintainer di solito rispondono entro 1 giorno