Skip to content

Conversation

@satishmittal111
Copy link

@satishmittal111 satishmittal111 commented May 30, 2021

The Source in send_raw_email must be a String type. mail_from=None is failing the SES backend for airflow alerts.

Currently SES Backend is failing with error -

  File "/Users/username/Library/Python/3.8/lib/python/site-packages/airflow/models/taskinstance.py", line 1852, in email_alert
    send_email(self.task.email, subject, html_content)
  File "/Users/username/Library/Python/3.8/lib/python/site-packages/airflow/utils/email.py", line 52, in send_email
    return backend(
  File "/Users/username/Library/Python/3.8/lib/python/site-packages/airflow/providers/amazon/aws/utils/emailer.py", line 39, in send_email
    hook.send_email(
  File "/Users/username/Library/Python/3.8/lib/python/site-packages/airflow/providers/amazon/aws/hooks/ses.py", line 95, in send_email
    return ses_client.send_raw_email(
  File "/Users/username/Library/Python/3.8/lib/python/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  ......
  File "/Users/username/Library/Python/3.8/lib/python/site-packages/botocore/validate.py", line 293, in serialize_to_request
    raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Invalid type for parameter Source, value: None, type: <class 'NoneType'>, valid types: <class 'str'>

Refer - https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ses.html#SES.Client.send_raw_email


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.

The Source in send_raw_email must be a String type. mail_from=None is failing the SES backend for airflow alerts.

Error -

  File "/Users/username/Library/Python/3.8/lib/python/site-packages/airflow/models/taskinstance.py", line 1852, in email_alert
    send_email(self.task.email, subject, html_content)
  File "/Users/username/Library/Python/3.8/lib/python/site-packages/airflow/utils/email.py", line 52, in send_email
    return backend(
  File "/Users/username/Library/Python/3.8/lib/python/site-packages/airflow/providers/amazon/aws/utils/emailer.py", line 39, in send_email
    hook.send_email(
  File "/Users/username/Library/Python/3.8/lib/python/site-packages/airflow/providers/amazon/aws/hooks/ses.py", line 95, in send_email
    return ses_client.send_raw_email(
  File "/Users/username/Library/Python/3.8/lib/python/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/Users/username/Library/Python/3.8/lib/python/site-packages/botocore/client.py", line 648, in _make_api_call
    request_dict = self._convert_to_request_dict(
  File "/Users/username/Library/Python/3.8/lib/python/site-packages/botocore/client.py", line 696, in _convert_to_request_dict
    request_dict = self._serializer.serialize_to_request(
  File "/Users/username/Library/Python/3.8/lib/python/site-packages/botocore/validate.py", line 293, in serialize_to_request
    raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Invalid type for parameter Source, value: None, type: <class 'NoneType'>, valid types: <class 'str'>

Refer - https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ses.html#SES.Client.send_raw_email
@boring-cyborg boring-cyborg bot added area:providers provider:amazon AWS/Amazon - related issues labels May 30, 2021
@boring-cyborg
Copy link

boring-cyborg bot commented May 30, 2021

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst)
Here are some useful points:

  • Pay attention to the quality of your code (flake8, pylint and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it’s a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@satishmittal111 satishmittal111 changed the title Fixing bug for SES backend - source (From) must be string. Fixing SES backend - source (From) must be string. May 30, 2021
@satishmittal111 satishmittal111 deleted the patch-1 branch May 30, 2021 06:19
@uranusjr
Copy link
Member

Do you need any help on this PR?

@satishmittal111
Copy link
Author

satishmittal111 commented May 30, 2021

@uranusjr I have closed this PR. Created new with right branch name - #16166 Please help for the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:amazon AWS/Amazon - related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants