{"record":{"id":"b815e273acb13d7b","repo":"calesthio/OpenMontage","slug":"non-json-response-from-jimeng-api-http-response","errorCode":null,"errorMessage":"Non-JSON response from Jimeng API: HTTP {response.status_code}","messagePattern":"Non-JSON response from Jimeng API: HTTP (.+?)","errorType":"http","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"tools/video/jimeng_video.py","lineNumber":391,"sourceCode":"            f\"SignedHeaders={signed_str}, Signature={signature}\"\n        )\n        return headers\n\n    @staticmethod\n    def _safe_error(exc: Exception) -> str:\n        msg = str(exc)\n        for var in (\"VOLC_SECRETKEY\", \"VOLC_ACCESSKEY\"):\n            val = os.environ.get(var, \"\")\n            if val:\n                msg = msg.replace(val, \"[redacted]\")\n        return msg\n\n    @staticmethod\n    def _json_or_raise(response: Any) -> dict[str, Any]:\n        try:\n            return response.json()\n        except ValueError as exc:\n            raise RuntimeError(\n                f\"Non-JSON response from Jimeng API: HTTP {response.status_code}\"\n            ) from exc\n\n    @staticmethod\n    def _check_code(http_status: int, payload: dict[str, Any]) -> None:\n        if http_status < 400:\n            code = payload.get(\"code\", 10000)\n            if code == 10000:\n                return\n            msg = payload.get(\"message\", \"unknown error\")\n            raise RuntimeError(f\"Jimeng API error: code={code}, msg={msg}\")\n        code = payload.get(\"code\", \"unknown\")\n        msg = payload.get(\"message\", \"unknown error\")\n        raise RuntimeError(f\"Jimeng API error: HTTP {http_status}, code={code}, msg={msg}\")\n","sourceCodeStart":373,"sourceCodeEnd":406,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/video/jimeng_video.py#L373-L406","documentation":"Error \"Non-JSON response from Jimeng API: HTTP {response.status_code}\" thrown in calesthio/OpenMontage.","triggerScenarios":"The Jimeng API responds with a non-JSON body (e.g. an HTML error page or gateway error) instead of the expected JSON payload.","commonSituations":"See trigger scenarios.","solutions":["The Jimeng API returned a non-JSON body (usually a gateway or proxy error page). Retry the request after a short backoff.","Verify the endpoint URL and network path; if it persists, capture the raw response body to see the upstream error."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}