Skip to content

Commit

Permalink
do not fail operator if we cannot find logs (#34570)
Browse files Browse the repository at this point in the history
* do not fail operator if we cannot find logs

---------

Co-authored-by: Niko Oliveira <onikolas@amazon.com>
  • Loading branch information
vandonr-amz and o-nikolas committed Sep 26, 2023
1 parent 8e38c5a commit a09d0c4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion airflow/providers/amazon/aws/operators/batch.py
Expand Up @@ -359,7 +359,12 @@ def monitor_job(self, context: Context):
else:
self.hook.wait_for_job(self.job_id)

awslogs = self.hook.get_job_all_awslogs_info(self.job_id)
awslogs = []
try:
awslogs = self.hook.get_job_all_awslogs_info(self.job_id)
except AirflowException as ae:
self.log.warning("Cannot determine where to find the AWS logs for this Batch job: %s", ae)

if awslogs:
self.log.info("AWS Batch job (%s) CloudWatch Events details found. Links to logs:", self.job_id)
link_builder = CloudWatchEventsLink()
Expand Down

0 comments on commit a09d0c4

Please sign in to comment.