Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

Economy runs fail with 400 SPM_CONFIGURATION_UNAVAILABLE while the simulation worker lags an API deploy

Ouverte
#3,945 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 3 jours

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
22/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
python
Domaine
api, backend, release

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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

  1. 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.
  2. Status code: return 503 (with Retry-After) for SPM_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.
  3. Stuck reports: reports created during the window stay pending with no active run (4524, 4525). Consider marking them error with 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

Langage dominant
Python
Étoiles
18
Forks
33
Merge moyen
2 j 15 h
PR mergées (30 j)
35

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de PolicyEngine/policyengine-api

Toutes les issues de PolicyEngine/policyengine-api

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.