Error 400 when trying to use SendGrid on Airflow (Google Composer)

Viewed 583

I'm actually trying to setup email notification in a DAG on Airflow with Data Composer. To send email, I'm using Sendgrid email server.

I'm following this guide: https://cloud.google.com/composer/docs/how-to/managing/creating#notification.

I followed all steps but when I'm lauching my dag I see this in the logs:

{sendgrid.py:121} WARNING - Failed to send out email with subject Airflow Alert Success, error: HTTP Error 400: Bad Request

What's the problem? Could it be in my environment setup?

1 Answers

I got the exact same issue and the way to solve it (at least for me!) was to add the domain when setting SENDGRID_MAIL_FROM.

So instead of "noreply-composer@". I added my domain: "noreply-composer@verily.com".

Related