I am receiving the following error with the ibm botocore s3 client.
ibm_botocore.exceptions.CredentialRetrievalError: Error when retrieving credentials from https://iam.cloud.ibm.com/identity/token: HttpCode(400) – Retrieval of tokens from server failed.
The complete traceback:
Refreshing temporary credentials failed during mandatory refresh period.
Traceback (most recent call last):
File “/usr/local/lib/python3.10/site-packages/ibm_botocore/credentials.py”, line 2773, in _protected_refresh
metadata = self.auth_function()
File “/usr/local/lib/python3.10/site-packages/ibm_botocore/credentials.py”, line 2685, in _default_auth_function
raise CredentialRetrievalError(provider=self._get_token_url(), error_msg=_msg)
ibm_botocore.exceptions.CredentialRetrievalError: Error when retrieving credentials from https://iam.cloud.ibm.com/identity/token: HttpCode(400) – Retrieval of tokens from server failed.
In my application I am using multithreading to do some objects copy operations.For authentication, I have handled both the hamc and API key logic.
Following is my client code with hmac keys:
client = ibm_boto3.client('s3',
aws_access_key_id=xxxxxxxxxxxxxx,
aws_secret_access_key=xxxxxxxxxxxxxxxxxxxxxxx,
endpoint_url="https://s3.us-east.cloud-object-storage.appdomain.cloud",
config=Config(max_pool_connections=100, connect_timeout=10, read_timeout=600))
And for API key:
client = ibm_boto3.client('s3',ibm_api_key_id=xxxxxxxxxxxxxx,
ibm_service_instance_id=xxxxxxxxxxxxxxxxxxxxxxx,
endpoint_url="https://s3.us-east.cloud-object-storage.appdomain.cloud",
ibm_auth_endpoint="https://iam.cloud.ibm.com/identity/token",
config=Config(signature_version="oauth", max_pool_connections=200,
connect_timeout=300, read_timeout=300))
I have verified the credentials. This error occurs intermittently.
Ftz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.