You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/09/08 03:55:23 UTC

[GitHub] [airflow] kolban-google opened a new issue #18077: Unable to determine underlying reason for email alert send failure

kolban-google opened a new issue #18077:
URL: https://github.com/apache/airflow/issues/18077


   ### Apache Airflow version
   
   2.1.2
   
   ### Operating System
   
   Debian
   
   ### Versions of Apache Airflow Providers
   
   Google Composer
   
   ### Deployment
   
   Composer
   
   ### Deployment details
   
   _No response_
   
   ### What happened
   
   I was trying to configure sending of alerts via SMTP.  I must have made a configuration error and I get the error "Failed to send".  Searching in the code I find the following:
   
   https://github.com/apache/airflow/blob/944dcfbb918050274fd3a1cc51d8fdf460ea2429/airflow/models/taskinstance.py#L1719
   
   What this shows is:
   
   ```
   if email_for_state and task.email:
               try:
                   self.email_alert(error)
               except Exception:
                   self.log.exception('Failed to send email to: %s', task.email)
   ```
   
   what this means is that if an exception occurs while sending an email, all we get is a "Failed to send" error and the diagnostics of why we failed to send have been lost.
   
   ### What you expected to happen
   
   I would like to see additional debuging on why the email failed to send.  Presumably this would be the exception text from the underlying call to send an email.
   
   ### How to reproduce
   
   _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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on issue #18077: Unable to determine underlying reason for email alert send failure

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #18077:
URL: https://github.com/apache/airflow/issues/18077#issuecomment-915052748


   I believe this is invalid. ``self.log.exception`` also shows exception information and you should see it in the log in this case https://docs.python.org/3/library/logging.html#logging.Logger.exception 
   
   ```
   try:
       raise Exception("exc message")
   except Exception:
       log.exception("test")
   test
   Traceback (most recent call last):
     File "<ipython-input-5-949bdc201447>", line 2, in <module>
       raise Exception("exc message")
   Exception: exc message
   ```
   
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] boring-cyborg[bot] commented on issue #18077: Unable to determine underlying reason for email alert send failure

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #18077:
URL: https://github.com/apache/airflow/issues/18077#issuecomment-914890851


   Thanks for opening your first issue here! Be sure to follow the issue template!
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on issue #18077: Unable to determine underlying reason for email alert send failure

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #18077:
URL: https://github.com/apache/airflow/issues/18077#issuecomment-915054556


   I will close it fro now, please pas some logs if you think the message is unclear.
   
   But If you would like to improve it and add some more information, I will invite you to open a PR directly. I will convert it into discussion now if you want to provide more information and discuss better approaches.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk closed issue #18077: Unable to determine underlying reason for email alert send failure

Posted by GitBox <gi...@apache.org>.
potiuk closed issue #18077:
URL: https://github.com/apache/airflow/issues/18077


   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org