mshober opened a new issue, #33634:
URL: https://github.com/apache/airflow/issues/33634

   ### Apache Airflow version
   
   2.7.0
   
   ### What happened
   
   After upgrading to `apache-airflow-providers-amazon==8.5.1`, I am no longer 
able to view logs from previous run attempts. 
   
   Airflow is able to find the log stream successfully, but there's no content 
viewable (even though there are logs in the actual streams):
   ```
   REDACTED.us-west-2.compute.internal
   *** Reading remote log from Cloudwatch log_group: REDACTED log_stream: 
dag_id=REDACTED/run_id=REDACTED/task_id=REDACTED/attempt=1.log.
   ```
   
   I believe this issue occurred from #33231 -  Looking at the [CloudWatch Logs 
code](https://github.com/apache/airflow/blob/providers-amazon/8.5.1/airflow/providers/amazon/aws/log/cloudwatch_task_handler.py#L109-L133),
 I think `task_instance.start_date` and `task_instance.end_date` somehow refer 
to its __latest__ run, and so the log contents are getting filtered out on 
previous attempts.
   
   
   ### What you think should happen instead
   
   _No response_
   
   ### How to reproduce
   
   1. Configure environment with remote CloudWatch logging
   2. Run task
   3. Clear task and re-run
   4. The logs for the first attempt now no longer show
   
   ### Operating System
   
   Debian 11
   
   ### Versions of Apache Airflow Providers
   
   apache-airflow-providers-amazon==8.5.1
   
   ### Deployment
   
   Other
   
   ### Deployment details
   
   _No response_
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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]

Reply via email to