dominikhei commented on issue #51429: URL: https://github.com/apache/airflow/issues/51429#issuecomment-2948628725
If the LogStream Airflow is trying to fetch does not exist , the `get_log_events` method in the [logs hook](https://github.com/apache/airflow/blob/main/providers/amazon/src/airflow/providers/amazon/aws/hooks/logs.py#L61) should throw a `CloudWatchLogs.Client.exceptions.ResourceNotFoundExceptio`, that is not handled in the `get_last_log_messages` in the [task_logs_fetcher](https://github.com/apache/airflow/blob/main/providers/amazon/src/airflow/providers/amazon/aws/utils/task_log_fetcher.py#L108), which again is used and not handled in the `_check_success_task` methods in the [ECS operator](https://github.com/apache/airflow/blob/main/providers/amazon/src/airflow/providers/amazon/aws/operators/ecs.py#L696). ``` response = self.conn.get_log_events( **prune_dict( { "logGroupName": log_group, "logStreamName": log_stream_name, "startTime": start_time, "endTime": end_time, "startFromHead": True, **token_arg, } ) ) events = response["events"] ``` Maybe that's where the task failure stems from? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
