Anton L.
01/14/2025, 10:49 PMUnrecognizedClientException
when calling the RegisterTaskDefinition operation: The security token included in the request is invalid. This error occurred in the prefect_cloud.push_work_pool
task.Marvin
01/14/2025, 10:49 PMUnrecognizedClientException
, indicates that the security token included in the request is invalid. This often happens when AWS credentials are misconfigured or expired.
Here's what you can do to resolve this issue:
1. AWS Credentials Block: Ensure that your AWS credentials are correctly stored in Prefect Cloud. You need to create a block for AWS credentials:
- Navigate to the blocks page in Prefect Cloud.
- Click "Create new block" and select "AWS Credentials" as the type.
- Set the region, access key, and secret access key.
2. Push Work Pool Configuration: Verify that your push work pool is correctly configured to use the AWS credentials block you created:
- Navigate to the work pools page.
- Ensure the AWS credentials block is selected under the AWS Credentials field when configuring your push work pool.
3. Deployment Configuration: Make sure your deployment is configured to use the push work pool:
- If you are using a prefect.yaml
file, ensure it references the correct work pool.
For more detailed guidance, you can refer to the Prefect documentation on serverless infrastructure and Prefect AWS ECS guide.
If the issue persists, double-check your AWS credentials and consider regenerating them if needed.