Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cloudwatch failedinvocation error no logs available [closed]

I have set up a Cloudwatch rule event where an ECS task definition is started when a previous task definition is completed.

I can see the event triggers the task definition however it fails.

The only visibility of this failure is in the rule metrics, where I see the metric failedinnvocations.

Question, are there any logs to see why the trigger failed?

I can manually set up the rule via the management console and everything works fine.

The error occurs when I set up the rule via a cloudformation template.

I have compared the two rules and both are identical, except the role. However, both roles have the same permissions.

like image 699
Nathan B Avatar asked Feb 03 '18 22:02

Nathan B


2 Answers

If the rule has been successfully triggered, but the invocation on the target failed, you should see a trace of the API call in the Event History inside the AWS CloudTrail looking at the errorCode and errorMessage properties:

{    [..]    "errorCode": "InvalidInputException",    "errorMessage": "Artifacts type is required",    [..] } 
like image 86
Nicolas Barbé Avatar answered Sep 17 '22 14:09

Nicolas Barbé


CloudTrail logs helped. event Name is RunTask. The issue was: "errorCode": "InvalidParameterException", "errorMessage": "Override for container named rds-task is not a container in the TaskDefinition.",

The AWS documentation for debugging CloudWatch events is here:
https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/CWE_Troubleshooting.html

I opened a PR to add documentation for debugging failed ECS Task Invocations from CloudWatch Events:
https://github.com/awsdocs/amazon-cloudwatch-events-user-guide/pull/12/files

like image 28
barakbd Avatar answered Sep 19 '22 14:09

barakbd