{"record":{"id":"3d109bdcba03d839","repo":"BerriAI/litellm","slug":"gcs-bucket-does-not-support-health-check","errorCode":null,"errorMessage":"GCS Bucket does not support health check","messagePattern":"GCS Bucket does not support health check","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"warning","filePath":"litellm/integrations/gcs_bucket/gcs_bucket.py","lineNumber":375,"sourceCode":"\n    async def flush_queue(self):\n        \"\"\"\n        Override flush_queue to work with asyncio.Queue.\n        \"\"\"\n        await self.async_send_batch()\n        self.last_flush_time = time.time()\n\n    async def periodic_flush(self):\n        \"\"\"\n        Override periodic_flush to work with asyncio.Queue.\n        \"\"\"\n        while True:\n            await asyncio.sleep(self.flush_interval)\n            verbose_logger.debug(\"GCS Bucket periodic flush after %s seconds\", self.flush_interval)\n            await self.flush_queue()\n\n    async def async_health_check(self) -> IntegrationHealthCheckStatus:\n        raise NotImplementedError(\"GCS Bucket does not support health check\")\n","sourceCodeStart":357,"sourceCodeEnd":376,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/integrations/gcs_bucket/gcs_bucket.py#L357-L376","documentation":"GCSBucketLogger.async_health_check raises NotImplementedError unconditionally: GCS Bucket logging has no health-check implementation. The method exists to satisfy the integration interface but always throws, so any generic loop that health-checks all configured callbacks will treat GCS as failing.","triggerScenarios":"Awaiting async_health_check() on a GCSBucketLogger instance — e.g. a /health or /logs health endpoint that iterates callbacks and calls their health check.","commonSituations":"Ops dashboards probing all integrations; code upgraded to a version where health checks became part of the callback interface.","solutions":["Skip GCS Bucket when iterating callback health checks (filter by type or catch NotImplementedError).","If you need a real health check for GCS, do a lightweight bucket stat/existence call with the same credentials yourself.","Do not treat this NotImplementedError as an outage — it is a capability gap, not a failure."],"exampleFix":"# before\nfor cb in callbacks:\n    await cb.async_health_check()\n\n# after\nfor cb in callbacks:\n    try:\n        await cb.async_health_check()\n    except NotImplementedError:\n        continue  # integration does not support health checks","handlingStrategy":"try-catch","validationCode":"async def health_check_safe(cb) -> str | None:\n    try:\n        return await cb.async_health_check()\n    except NotImplementedError:\n        return None  # capability not supported, not a failure","typeGuard":"def supports_health_check(cb) -> bool:\n    return type(cb).async_health_check is not GCSBucketLogger.async_health_check","tryCatchPattern":"try:\n    status = await logger.async_health_check()\nexcept NotImplementedError:\n    status = \"unsupported\"  # exclude from health aggregation","preventionTips":["Filter callbacks by capability before health-check aggregation.","Don't wire GCS Bucket into endpoints that require a health check.","Treat NotImplementedError from health checks as 'unknown', never 'unhealthy'."],"tags":["gcs","health-check","not-implemented","logging-callback"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}