从Airflow 1.9升级到1.10后,我不再能够在Web GUI中看到“任务持续时间”。当我单击“任务持续时间”时,将得到以下回溯:
Traceback (most recent call last):
File "/home/ubuntu/.local/share/virtualenvs/airflow-YvxPQJVU/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/home/ubuntu/.local/share/virtualenvs/airflow-YvxPQJVU/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/ubuntu/.local/share/virtualenvs/airflow-YvxPQJVU/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/ubuntu/.local/share/virtualenvs/airflow-YvxPQJVU/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
raise value
File "/home/ubuntu/.local/share/virtualenvs/airflow-YvxPQJVU/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/home/ubuntu/.local/share/virtualenvs/airflow-YvxPQJVU/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/ubuntu/.local/share/virtualenvs/airflow-YvxPQJVU/lib/python3.6/site-packages/flask_admin/base.py", line 69, in inner
return self._run_view(f, *args, **kwargs)
File "/home/ubuntu/.local/share/virtualenvs/airflow-YvxPQJVU/lib/python3.6/site-packages/flask_admin/base.py", line 368, in _run_view
return fn(self, *args, **kwargs)
File "/home/ubuntu/.local/share/virtualenvs/airflow-YvxPQJVU/lib/python3.6/site-packages/flask_login.py", line 758, in decorated_view
return func(*args, **kwargs)
File "/home/ubuntu/.local/share/virtualenvs/airflow-YvxPQJVU/lib/python3.6/site-packages/airflow/www/utils.py", line 270, in wrapper
return f(*args, **kwargs)
File "/home/ubuntu/.local/share/virtualenvs/airflow-YvxPQJVU/lib/python3.6/site-packages/airflow/utils/db.py", line 74, in wrapper
return func(*args, **kwargs)
File "/home/ubuntu/.local/share/virtualenvs/airflow-YvxPQJVU/lib/python3.6/site-packages/airflow/www/views.py", line 1551, in duration
fails_totals[dict_key] += tf.duration
TypeError: unsupported operand type(s) for +=: 'int' and 'NoneType'
你知道是什么原因造成的吗?
这仅发生在我的旧DAGS上。升级后创建的新DAGS不会出现此问题。
答案 0 :(得分:3)
看起来您较旧的记录的行在NULL
列上有task_fail.duration
。对数据库运行手动查询可能会解决您的问题:UPDATE task_fail SET duration=0 WHERE duration IS NULL
-假设您可以更改记录。
为了以防万一,请确保也先锁定备份。