`kubernetes.client.exceptions.ApiException: (403) Reason: Forbidden ... "pods is forbidden: User \"system:serviceaccount:ops:auditor\" cannot list resource \"pods\" in API group \"\" at the cluster scope"`
BeginnerTroubleshootingboto3, HTTP & API errors
Answer
Likely causes → The service account has no RBAC permission for that verb/resource/scope (a namespaced Role cannot grant cluster-scope list).
Diagnose →
kubectl auth can-i list pods --all-namespaces --as=system:serviceaccount:ops:auditor
kubectl get rolebinding,clusterrolebinding -A -o wide | grep auditor
Fix → Create a ClusterRole with get, list, watch on pods and a ClusterRoleBinding to the service account (or use namespaced calls with a Role per namespace).
Prevent → Ship RBAC manifests with the tool and test with kubectl auth can-i.
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