{"record":{"id":"ace148c5c51f3381","repo":"BerriAI/litellm","slug":"service-is-unavailable-http-response-status-code","errorCode":null,"errorMessage":"Service is unavailable (HTTP {response.status_code})","messagePattern":"Service is unavailable \\(HTTP (.+?)\\)","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"litellm/proxy/guardrails/guardrail_hooks/zscaler_ai_guard/zscaler_ai_guard.py","lineNumber":314,"sourceCode":"            timeout=self.timeout,\n        )\n        response.raise_for_status()\n        return response\n\n    def _handle_response(self, response, direction):\n        # Raise exceptions on critical errors to stop the request\n        if response.status_code == 429:  # Rate limit\n            verbose_proxy_logger.error(\"Zscaler AI Guard rate limit reached. Blocking request.\")\n            user_facing_error = self._create_user_facing_error(\"Rate limit reached. status_code: 429\")\n            # This exception will be caught by the proxy and returned to the user\n            raise HTTPException(status_code=500, detail=user_facing_error)\n\n        if response.status_code >= 500:  # Server error\n            verbose_proxy_logger.error(\n                \"Zscaler AI Guard service is unavailable (Status: %s). Blocking request.\", response.status_code\n            )\n            user_facing_error = self._create_user_facing_error(f\"Service is unavailable (HTTP {response.status_code})\")\n            raise HTTPException(status_code=500, detail=user_facing_error)\n\n        if response.status_code == 200:\n            json_response: Final = response.json()\n            statusCode_in_response: Final = json_response.get(\"statusCode\", None)\n            if statusCode_in_response == 200:\n                guardrail_result: Final = json_response.get(\"action\", None)\n                verbose_proxy_logger.info(\"Zscaler AI Guard response: %s\", json_response)\n\n                if guardrail_result == \"BLOCK\":\n                    verbose_proxy_logger.info(\n                        \"Violated Zscaler AI Guard guardrail policy. zscaler_ai_guard_response: %s\", json_response\n                    )\n                    return {\n                        \"action\": \"BLOCK\",\n                        \"zscaler_ai_guard_response\": json_response,\n                    }\n                elif guardrail_result == \"ALLOW\" or guardrail_result == \"DETECT\":\n                    verbose_proxy_logger.debug(","sourceCodeStart":296,"sourceCodeEnd":332,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/guardrails/guardrail_hooks/zscaler_ai_guard/zscaler_ai_guard.py#L296-L332","documentation":"Error \"Service is unavailable (HTTP {response.status_code})\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/guardrails/guardrail_hooks/zscaler_ai_guard/zscaler_ai_guard.py:314 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the request later; the Zscaler AI Guard service is temporarily unavailable.","Configure block_on_error behavior appropriate for your availability requirements."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}