Symptom
A citizen filing a complaint of an onboarded type (e.g. colecta_lixo on mz.maputo) gets:
{"Errors":[{"code":"JSONPATH_ERROR","message":"Failed to parse mdms response for service: colecta_lixo"}]}
…even though the complaint type shows in the UI dropdown. So complaints can't be filed.
Root cause
pgr-services resolves RAINMAKER-PGR.ServiceDefs at the computed state root of the complaint's tenant (mz.maputo → mz) via mdms-v2/v1/_search. But the configurator / onboarding writes the city's complaint types only at the city tenant (mz.maputo). The state root (mz) has only the bootstrap defaults, so the lookup returns nothing → JSONPATH_ERROR. The UI dropdown reads the city, which is why it offers a type the backend can't validate.
This is independent of STATE_LEVEL_TENANT_ID — pgr derives the read tenant from the complaint's tenantId at request time (confirmed: changing that env did not help; replicating the defs to the state root did).
Repro
- Onboard a city (e.g.
mz.maputo) with custom complaint types via the configurator.
- As a citizen, file a complaint of a custom type.
- →
JSONPATH_ERROR: Failed to parse mdms response for service: <code>.
Manual workaround
Replicate the city's ServiceDefs up to the state root and bust the mdms cache:
INSERT INTO eg_mdms_data (id, tenantid, uniqueidentifier, schemacode, data, isactive, createdby, lastmodifiedby, createdtime, lastmodifiedtime)
SELECT gen_random_uuid()::text, '<state>', uniqueidentifier, schemacode, data, isactive, createdby, lastmodifiedby, createdtime, lastmodifiedtime
FROM eg_mdms_data WHERE schemacode='RAINMAKER-PGR.ServiceDefs' AND tenantid='<state>.<city>'
ON CONFLICT DO NOTHING;
then docker restart egov-mdms-service.
Fix
Onboarding should seed RAINMAKER-PGR.ServiceDefs at the state root (where pgr validates) in addition to the city (where the UI lists them) — either the configurator's complaint-type phase writes to both, or a post-onboarding replication/sync step. They must stay in sync.
Regression test
Covered by local-setup/tests/test_onboarding_regressions.py::test_servicedefs_resolve_at_state_root (+ opt-in test_complaint_create_passes_servicedef_validation).
Found during the Maputo (mz.maputo) bring-up, 2026-05-21.
Symptom
A citizen filing a complaint of an onboarded type (e.g.
colecta_lixoonmz.maputo) gets:…even though the complaint type shows in the UI dropdown. So complaints can't be filed.
Root cause
pgr-servicesresolvesRAINMAKER-PGR.ServiceDefsat the computed state root of the complaint's tenant (mz.maputo→mz) viamdms-v2/v1/_search. But the configurator / onboarding writes the city's complaint types only at the city tenant (mz.maputo). The state root (mz) has only the bootstrap defaults, so the lookup returns nothing →JSONPATH_ERROR. The UI dropdown reads the city, which is why it offers a type the backend can't validate.This is independent of
STATE_LEVEL_TENANT_ID— pgr derives the read tenant from the complaint'stenantIdat request time (confirmed: changing that env did not help; replicating the defs to the state root did).Repro
mz.maputo) with custom complaint types via the configurator.JSONPATH_ERROR: Failed to parse mdms response for service: <code>.Manual workaround
Replicate the city's ServiceDefs up to the state root and bust the mdms cache:
then
docker restart egov-mdms-service.Fix
Onboarding should seed
RAINMAKER-PGR.ServiceDefsat the state root (where pgr validates) in addition to the city (where the UI lists them) — either the configurator's complaint-type phase writes to both, or a post-onboarding replication/sync step. They must stay in sync.Regression test
Covered by
local-setup/tests/test_onboarding_regressions.py::test_servicedefs_resolve_at_state_root(+ opt-intest_complaint_create_passes_servicedef_validation).Found during the Maputo (
mz.maputo) bring-up, 2026-05-21.