I'm trying to use the Airflow SFTPHook by passing in a ssh_conn_id
and I'm getting an error:
No hostkey for host myhostname found.
Using the SFTPOperator with the same ssh_conn_id
however is working fine. How can I resolve this error?
I'm trying to use the Airflow SFTPHook by passing in a ssh_conn_id
and I'm getting an error:
No hostkey for host myhostname found.
Using the SFTPOperator with the same ssh_conn_id
however is working fine. How can I resolve this error?
Just had this issue, the simple trick is to keep your SSH connector inside airflow and to add the following in the "Extra" field :
{"no_host_key_check": true}
Hope it helps !
Edit : Indeed, it allows the man-in-the-middle attack, so even if it helps temporarily, you should get the ssh fingerprint and allow it
The SFTPOperators
uses SSHHook
. Hence, you should use SSHHook
instead.