Failure to connect to Kinesis: Failed to init kvs producer. Error: Unable to create Rotating Credential provider. #976
-
I get this log after testing the container locally and publishing it to an ECS cluster. Without Credentials: Failed to init kvs producer. Error: Unable to create Rotating Credential provider. Error status: 0x15000022 With Credentials: describeStreamCurlHandler(): DescribeStream API response: {"message":"The security token included in the request is invalid."} ThoughtsIt appears that even though there is an IAM role attached to the task definition, that the contianer needs generated credentials. I don't necessarily understand why that is the case... but that is what it seems. What I have triedI have tried the following:
ENV AWS_ACCESS_KEY_ID=
ENV AWS_SECRET_ACCESS_KEY=
ENV AWS_SESSION_TOKEN= try:
response = boto3.session.Session().get_credentials()
# Get the temporary credentials
credentials = response
os.environ["AWS_ACCESS_KEY_ID"] = credentials.access_key
os.environ["AWS_SECRET_ACCESS_KEY"] = credentials.secret_key
os.environ["AWS_SESSION_TOKEN"] = credentials.token
print("Credentials Set.")
except Exception as E:
raise ValueError(f"Token Generation Failed: {E}") Any thoughts would be appreciated. I am not sure why tokens would be stale since the code is grabbing credentials from the IAM role attached to the ECS resource itself. I would suggest that these environment variables are actually optional and that an IAM role itself would just work Tagging @niyatim23 for visibility - you helped me work through my previous issue! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 15 replies
-
Hi @Alex-Wenner-FHR, can you please share the permissions you are giving to the IAM role? The error code |
Beta Was this translation helpful? Give feedback.
-
The problem doesnt seem to be with the credentials to start with. Based on the status code, it seems that the SDK is unable to access the file to read the credentials from. Ensure the file has read permissions for the SDK to parse the file for credentials. |
Beta Was this translation helpful? Give feedback.
@Alex-Wenner-FHR ,
The problem doesnt seem to be with the credentials to start with. Based on the status code, it seems that the SDK is unable to access the file to read the credentials from. Ensure the file has read permissions for the SDK to parse the file for credentials.