Closed seybi87 closed 2 years ago
I figured out that special characters in the password string will cause this issue.
My password contained the following special characters:
smtp_password = ja)5%Fmkrwj@LkE@
After changing the password to a string that contains only letters and numbers the issue is resolved.
Feel free to close this issue in case these special characters are not allowed in the airflow.cfg
at all.
I wonder if this is somehow similar to #12775. The characters you use aren’t really that special; maybe Airflow can handle them better.
FWIW I believe I also ran into this issue with the postgresql
password. I had special characters (%
, &
, +
) in it and airflow was not able to use the connection string. Changing to an alphanumeric password fixed the problem.
FWIW I believe I also ran into this issue with the
postgresql
password. I had special characters (%
,&
,+
) in it and airflow was not able to use the connection string. Changing to an alphanumeric password fixed the problem.
@henryzhangsta This is a different issue with Postgres connection URL. When you embed your password in URL, you MUST Percent-encode restricted characters (see https://datatracker.ietf.org/doc/html/rfc3986). This is part of specification and this has nothing to do with Airflow.
We even have a tool in Airlfow to allow you to generate connection URI with proper, URI-standard compliant encoding in Airflow to make it easier:
So you can still use even the "restricted" characters as long as you properly encode them.
Does the issue still happens in newer Airflow versions?
This issue has been automatically marked as stale because it has been open for 30 days with no response from the author. It will be closed in next 7 days if no further activity occurs from the issue author.
This issue has been closed because it has not received response from the issue author.
Apache Airflow version: 2.0.1
Kubernetes version (if you are using kubernetes) (use
kubectl version
): n/aEnvironment:
uname -a
): Linux f65e783d463e 5.4.0-62-generic #70-Ubuntu SMP Tue Jan 12 12:45:47 UTC 2021 x86_64 GNU/Linuxpip install apache-airflow[postgres,sendgrid]==2.0.1 --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.0.1/constraints-3.7.txt"
What happened:
I have activated email notification via smtp. Therefore I have applied the following configurations in the
airflow.cfg
:This email account has only rights to send emails but not to receive emails. The account has been tested manually via Thunderbird.
In addition I have the following email testing DAG:
What you expected to happen:
When triggering the DAG, I expect to receive a regular email from
send_mail
and a error report email fromfailed_bash
. However, already thesend_mail
tasks fails with the following log output:'I did not spot any additional logs in the scheduler that points to the cause of the failure.
How to reproduce it:
Use the above DAG with a valid
smtp
accountAnything else we need to know:
I also tried SendGrid (yet with a different email account) and there it worked without a problem. For SendGrid I applied the following configs: