sam-gen-cop opened a new issue, #44337:
URL: https://github.com/apache/airflow/issues/44337

   ### Apache Airflow version
   
   Other Airflow 2 version (please specify below)
   
   ### If "Other Airflow 2 version" selected, which one?
   
   2.10.1
   
   ### What happened?
   
   The Log URL (`ti.log_url`) from the triggered retry email doesn't redirect 
to the Logs when clicked but instead shows 'No XCom' as the error in the 
Airflow UI. The Logs are shown when a time in future is selected as the 
`base_date` in the UI.
   
   Before changing the base_date in the UI,
   
   
![image](https://github.com/user-attachments/assets/6a4a2edd-a2c6-42ca-95d2-6315ba4acc48)
   
   After adding 1 second to the base_date in UI,
   
   
![image](https://github.com/user-attachments/assets/7cc6af14-92f9-46e0-8ac8-7abc63abaf54)
   
   
   
   
   ### What you think should happen instead?
   
   I think the issue might be due to milli seconds getting truncated which 
causes the difference between the execution datetime (untruncated) and the 
execution datetime rendered - `base_date` (truncated) in the `ti.log_url`
   
   ### How to reproduce
   
   Here is the DAG to reproduce the issue,
   
   ```
   from airflow.decorators import dag, task
   from datetime import datetime, timedelta
   
   @dag(
       dag_id='default_email_on_retry_example',
       schedule_interval='@once',
       start_date=datetime(2023, 1, 1),
       catchup=False,
       default_args={
           'email': ['[email protected]'],  
           'email_on_retry': True,  
           'email_on_failure': False,  
       },
   )
   def default_email_on_retry_dag():
   
       @task
       def success_task():
           print("This task will always succeed!")
   
       @task(task_id='retry_task', retries=3, retry_delay=timedelta(seconds=15))
       def retry_task():
           print("This task will retry and fail.")
           raise Exception("Simulated task failure for retry.")
   
       success = success_task()
       retry = retry_task()
   
       success >> retry
   
   default_email_on_retry_dag()
   ```
   
   ### Operating System
   
   Linux
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Amazon (AWS) MWAA
   
   ### 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