I tried rewrite send_message_on_dag_fail like only with context as input, now it works.
I don't know why, cause then I tries work with context in task with context (not **kwargs) I've failed.
Any ideas why it works this way?
def send_message_on_dag_fail(context):
log = context['ti'].log
log.error('DAG FINISHED WITH ERROR __________________') # this error text easier to find
task_id = context['ti'].task_id
dag_id = context['dag'].dag_id
message = f"Task {task_id} from Dag {dag_id} failed."
log.error(message)
send_msg(bot_token, chat_id, message, 'message')