Description
Steps to reproduce (step by step instructions, with links, commands and necessary data to reproduce the error)
- not clear; this was seen in production logs
- https://logstash.wikimedia.org/app/discover#/doc/0fade920-6712-11eb-8327-370b46f9e7a5/ecs-k8s-1-1.11.0-7-2025.05?id=fUyDuZQB60NnMROHZxyM
Observed behavior
- tried to call .json() on an invalid response
function implementation: Z901 error: FetchError: invalid json response body at http://localhost:6501/w/api.php?action=wikilambda_fetch&format=json&uselang=content&zids=Z13518 reason: Unexpected token 'u', "upstream c"... is not valid JSON
Expected behavior/Acceptance criteria (returned value, expected error, performance expectations, etc.)
- we should catch this error
Completion checklist
- Before closing this task, review one by one the checklist available here: https://www.mediawiki.org/wiki/Abstract_Wikipedia_team/Definition_of_Done#Back-end_Task/Bug_completion_checklist