`requests` uploads work locally but fail in Kubernetes with `ProxyError: Unable to connect to proxy`.
AdvancedTroubleshootingboto3, HTTP & API errors
Answer
Likely causes → HTTPS_PROXY is set in the pod (inherited from a base image or cluster-wide injection) but the proxy is unreachable from this namespace, or NO_PROXY does not exclude internal hosts like *.svc.cluster.local and 169.254.169.254.
Diagnose →
kubectl exec <pod> -- env | grep -i proxy
Fix → Fix NO_PROXY (.svc,.cluster.local,10.0.0.0/8,169.254.169.254), or unset the proxy for in-cluster traffic; session.trust_env = False disables env proxies for a specific session.
Prevent → Standardize proxy variables at the platform level and test from a pod.
More on boto3, HTTP & API errors
`botocore.exceptions.NoCredentialsError: Unable to locate credentials`Beginner`botocore.exceptions.NoRegionError: You must specify a region.` even though `AWS_REGION` is set.Intermediate`botocore.exceptions.ClientError: An error occurred (UnauthorizedOperation) when calling the DescribeInstances operation: You are not authorized to perform this operation.`Beginner`An error occurred (ExpiredToken) when calling the ... operation: The security token included in the request is expired` midway through a long job.Advanced`An error occurred (RequestLimitExceeded) when calling the DescribeInstances operation (reached max retries: 4): Request limit exceeded.`Intermediate`An error occurred (InvalidClientTokenId) when calling the GetCallerIdentity operation: The security token included in the request is invalid.`Beginner