{"record":{"id":"b1034b4060063bff","repo":"BerriAI/litellm","slug":"missing-boto3-to-call-bedrock-run-pip-install-bo","errorCode":null,"errorMessage":"Missing boto3 to call bedrock. Run 'pip install boto3'.","messagePattern":"Missing boto3 to call bedrock\\. Run 'pip install boto3'\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/s3_v2.py","lineNumber":299,"sourceCode":"            verbose_logger.debug(\n                \"s3 logging: queue length %s, batch size %s\",\n                len(self.log_queue),\n                self.batch_size,\n            )\n        except Exception as e:\n            verbose_logger.exception(\"s3 Layer Error - %s\", e)\n            self.handle_callback_failure(callback_name=\"S3Logger\")\n\n    async def async_upload_data_to_s3(self, batch_logging_element: s3BatchLoggingElement):\n        try:\n            import base64\n            import hashlib\n\n            import requests\n            from botocore.auth import S3SigV4Auth\n            from botocore.awsrequest import AWSRequest\n        except ImportError:\n            raise ImportError(\"Missing boto3 to call bedrock. Run 'pip install boto3'.\")\n        try:\n            from litellm.litellm_core_utils.asyncify import asyncify\n\n            asyncified_get_credentials: Final = asyncify(self.get_credentials)\n            credentials: Final = await asyncified_get_credentials(\n                aws_access_key_id=self.s3_aws_access_key_id,\n                aws_secret_access_key=self.s3_aws_secret_access_key,\n                aws_session_token=self.s3_aws_session_token,\n                aws_region_name=self.s3_region_name,\n                aws_session_name=self.s3_aws_session_name,\n                aws_profile_name=self.s3_aws_profile_name,\n                aws_role_name=self.s3_aws_role_name,\n                aws_web_identity_token=self.s3_aws_web_identity_token,\n                aws_sts_endpoint=self.s3_aws_sts_endpoint,\n            )\n\n            verbose_logger.debug(\"s3_v2 logger - uploading data to s3 - %s\", batch_logging_element.s3_object_key)\n            verbose_logger.debug(\"s3_v2 logger - s3_verify setting: %s\", self.s3_verify)","sourceCodeStart":281,"sourceCodeEnd":317,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/integrations/s3_v2.py#L281-L317","documentation":"S3Logger.async_upload_data_to_s3 needs requests plus botocore's S3SigV4Auth/AWSRequest to sign uploads; if either import fails it raises ImportError('Missing boto3 to call bedrock...') — the 'bedrock' wording is a copy-paste artifact, the actual missing modules are botocore (or requests). It fires per-upload, not at logger construction.","triggerScenarios":"Enabling the s3_v2 logging callback in an environment without boto3/botocore installed (base litellm install); slim Docker images; async paths running in a worker process with a different site-packages.","commonSituations":"Adding litellm.callbacks = [\"s3\"] (v2 logger) without the proxy extras; pip installing litellm fresh in CI and assuming S3 deps are bundled; uninstalling boto3 after bedrock usage was removed but keeping S3 logging.","solutions":["pip install boto3 (pulls botocore) and requests in the runtime environment — or pip install 'litellm[extra_proxy]'","Verify in the same interpreter: python -c \"from botocore.auth import S3SigV4Auth; import requests\"","Restart the proxy/callback so the import retry succeeds"],"exampleFix":"# before\nlitellm.callbacks = [\"s3\"]  # ImportError on first flush: Missing boto3\n\n# after\n# pip install boto3 requests\nimport botocore.auth, requests  # sanity check\nlitellm.callbacks = [\"s3\"]","handlingStrategy":"validation","validationCode":"try:\n    import botocore.auth, requests  # noqa: F401\nexcept ImportError:\n    raise SystemExit(\"S3 logging needs boto3: pip install boto3 requests\")\n\nlitellm.callbacks = [\"s3\"]","typeGuard":null,"tryCatchPattern":"try:\n    await s3_logger.async_upload_data_to_s3(batch_element)\nexcept ImportError as e:\n    if \"Missing boto3\" in str(e):\n        logger.error(\"s3 upload skipped: boto3 not installed\")\n    else:\n        raise","preventionTips":["Install litellm[extra_proxy] (or boto3+requests explicitly) in every image that enables s3 logging","Verify imports in the same interpreter/worker that runs callbacks, not just the shell","Include a dependency assertion in the proxy's startup healthcheck"],"tags":["s3","dependency","botocore","installation","logging"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}