vatsrahul1001 commented on issue #40119:
URL: https://github.com/apache/airflow/issues/40119#issuecomment-2162742479
@trlopes1974 Below is the sample DAG I am using to test it with ssh and
python operator both and it works fine
```
def fail():
raise Exception
def mycallback(context):
print("I HAVE BEEN CALLED! " * 4)
default_args = {
"owner": "airflow",
"start_date": datetime(2018, 10, 31),
'on_failure_callback': mycallback
}
with DAG(
dag_id="on_failure_callback",
default_args=default_args,
schedule_interval="@once",
catchup=False,
doc_md=docs,
tags=["core"],
) as dag:
test1 = PythonOperator(
task_id="print_to_logs",
python_callable=fail,
)
# Define the SSHOperator task
ssh_task = SSHOperator(
task_id='ssh_task',
ssh_conn_id='ssh_default', # SSH connection ID registered in Airflow
command='echo1 "Hello, World!"', # Command to execute
dag=dag,
)
test2 = PythonOperator(
task_id="check_logs",
trigger_rule="one_failed",
python_callable=log_checker,
op_args=["print_to_logs", "I HAVE BEEN CALLED!", "I HAVEN'T BEEN
CALLED!"],
)
test3 = PythonOperator(
task_id="check_logs1",
trigger_rule="one_failed",
python_callable=log_checker,
op_args=["ssh_task", "I HAVE BEEN CALLED!", "I HAVEN'T BEEN
CALLED!"],
)
test1 >> test2
```
I see your ssh task has `cmd_timeout` `conn_timeout` can you trying removing
them and test again
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]