{"record":{"id":"b239644278f1da04","repo":"BerriAI/litellm","slug":"failed-to-download-object-key-from-storage-type","errorCode":null,"errorMessage":"Failed to download {object_key} from {storage_type} bucket {bucket_name}","messagePattern":"Failed to download (.+?) from (.+?) bucket (.+?)","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"litellm/proxy/types_utils/utils.py","lineNumber":159,"sourceCode":"        local_file_path: Final = temp_file.name\n        temp_file.close()  # Close the file so we can write to it\n\n        # Download the file\n        if storage_type == \"s3\":\n            from litellm.proxy.common_utils.load_config_utils import (\n                download_python_file_from_s3,\n            )\n\n            success = download_python_file_from_s3(\n                bucket_name=bucket_name,\n                object_key=object_key,\n                local_file_path=local_file_path,\n            )\n        else:  # gcs\n            success = asyncio.run(_download_gcs_file_wrapper(bucket_name, object_key, local_file_path))\n\n        if not success:\n            raise ImportError(f\"Failed to download {object_key} from {storage_type} bucket {bucket_name}\")\n\n        # Load the module from the downloaded file using the actual module name\n        spec: Final = importlib.util.spec_from_file_location(module_path, local_file_path)\n        if spec is None or spec.loader is None:\n            raise ImportError(f\"Could not create module spec for {local_file_path}\")\n\n        module: Final = importlib.util.module_from_spec(spec)\n        spec.loader.exec_module(module)\n\n        # Get the instance\n        instance: Final = getattr(module, instance_name)\n\n        # Clean up the temporary file\n        try:\n            os.remove(local_file_path)\n        except Exception as cleanup_error:\n            verbose_proxy_logger.warning(\"Could not clean up temporary file %s: %s\", local_file_path, cleanup_error)\n","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/types_utils/utils.py#L141-L177","documentation":"The S3 or GCS download helper returned falsy for the given object key, meaning the file could not be fetched from the bucket (missing object, permissions, or client misconfiguration) even though the URL was structurally valid. Raised as ImportError since the module code is unavailable.","triggerScenarios":"Thrown at litellm/proxy/types_utils/utils.py:159 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check cloud credentials and bucket/object permissions, and verify the object key exists in the bucket."],"exampleFix":null,"handlingStrategy":"validation","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-14T05:17:10.506Z"}