thegraphnetwork / EpiGraphHub

Software platform to Gather, transmform, harmonize and store epidemiological data for analytical purposes.
https://epigraphhub.org
GNU General Public License v3.0
8 stars 10 forks source link

[BUG] Missing env variables in Airflow Container to be able to mailing on errors #172

Closed luabida closed 1 year ago

luabida commented 1 year ago

Describe the bug

[2023-03-15, 15:36:56 UTC] {{configuration.py:552}} WARNING - section/key [smtp/smtp_user] not found in config
[2023-03-15, 15:36:56 UTC] {{email.py:228}} INFO - Email alerting: attempt 1
[2023-03-15, 15:36:56 UTC] {{configuration.py:552}} WARNING - section/key [smtp/smtp_user] not found in config
[2023-03-15, 15:36:56 UTC] {{email.py:228}} INFO - Email alerting: attempt 1
[2023-03-15, 15:36:56 UTC] {{taskinstance.py:1964}} ERROR - Failed to send email to: ['epigraphhub@thegraphnetwork.org']

Variables that should be added:

AIRFLOW__SMTP__SMTP_HOST: The SMTP server hostname or IP address. AIRFLOW__SMTP__SMTP_PORT: The SMTP server port number. AIRFLOW__SMTP__SMTP_STARTTLS: (Optional) Set this to True if your SMTP server requires a secure connection using STARTTLS. AIRFLOW__SMTP__SMTP_SSL: (Optional) Set this to True if your SMTP server requires a secure connection using SSL. AIRFLOW__SMTP__SMTP_USER: The username for authenticating with the SMTP server. AIRFLOW__SMTP__SMTP_PASSWORD: The password for authenticating with the SMTP server. AIRFLOW__SMTP__SMTP_MAIL_FROM: The email address that will be used as the sender for all emails sent by Airflow. AIRFLOW__SMTP__SMTP_TLS: (Optional) Set this to True if you want to use a secure connection using TLS.

To Reproduce

https://airflow.epigraphhub.org/log?dag_id=SINAN_SIFG&task_id=upload&execution_date=2023-02-01T00%3A00%3A00%2B00%3A00

Expected behavior

Sending the email

Screenshots

image

Desktop

Smartphone

Additional context

No response

xmnlab commented 1 year ago

ok I will take a look into that. btw, @luabida could you open a PR to fix the .env template? https://github.com/thegraphnetwork/EpiGraphHub/blob/main/.env.tpl#L14-L20

it should use the same structure of the other ones, please for default values (just if it is necessary), you can use the bash syntax, eg.:

MYVAR=${MYVAR:-DEFAULTVAL}

xmnlab commented 1 year ago

btw, for requests about production, please open a PR on https://github.com/thegraphnetwork/epigraphhub-deployment