You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@airflow.apache.org by ra...@gmail.com, ra...@gmail.com on 2019/03/20 23:57:50 UTC

Airflow Kill Halted Tasks Error.

Hi Everyone,
I've downloaded the source code from Github.
https://github.com/teamclairvoyant/airflow-maintenance-dags/tree/master/kill-halted-tasks

Apparently it throws an error related to Datetime. I have tried changing the code but nothing works. Is this issue already been resolved?

File "/home/airflow/Desktop/BI-Team/py/lib/python3.6/site-packages/airflow/models.py", line 1657, in _run_raw_task
    result = task_copy.execute(context=context)
  File "/home/airflow/Desktop/BI-Team/py/lib/python3.6/site-packages/airflow/operators/python_operator.py", line 103, in execute
    return_value = self.execute_callable()
  File "/home/airflow/Desktop/BI-Team/py/lib/python3.6/site-packages/airflow/operators/python_operator.py", line 108, in execute_callable
    return self.python_callable(*self.op_args, **self.op_kwargs)
  File "/home/airflow/Desktop/BI-Team/airflow/dags/airflow-kill-halted-tasks.py", line 131, in kill_halted_tasks_function
    execution_date_to_search_for = datetime.strptime((process["airflow_execution_date"]).replace("T", " "), '%Y-%m-%d %H:%M:%S.%f')
  File "/usr/lib/python3.6/_strptime.py", line 565, in _strptime_datetime
    tt, fraction = _strptime(data_string, format)
  File "/usr/lib/python3.6/_strptime.py", line 362, in _strptime
    (data_string, format))
ValueError: time data '2019-03-20 22:37:34' does not match format '%Y-%m-%d %H:%M:%S.%f'
[2019-03-21 10:53:12,494] {models.py:1811} INFO - Marking task as UP_FOR_RETRY