Uploaded image for project: 'Apache Airflow'
  1. Apache Airflow
  2. AIRFLOW-619

Gantt chart raises exception when there are running TaskInstances of the DagRun

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      If you view the Gantt chart for a DagRun while there are TaskInstances still running, the Gantt chart throws an exception calling isoformat() on None because the task instance has no end_date

      Traceback (most recent call last):
        File "/home/dgies/airflow/venv/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
          response = self.full_dispatch_request()
        File "/home/dgies/airflow/venv/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
          rv = self.handle_user_exception(e)
        File "/home/dgies/airflow/venv/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
          reraise(exc_type, exc_value, tb)
        File "/home/dgies/airflow/venv/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
          rv = self.dispatch_request()
        File "/home/dgies/airflow/venv/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
          return self.view_functions[rule.endpoint](**req.view_args)
        File "/home/dgies/airflow/venv/lib/python2.7/site-packages/flask_admin/base.py", line 68, in inner
          return self._run_view(f, *args, **kwargs)
        File "/home/dgies/airflow/venv/lib/python2.7/site-packages/flask_admin/base.py", line 367, in _run_view
          return fn(self, *args, **kwargs)
        File "/home/dgies/airflow/venv/lib/python2.7/site-packages/flask_login.py", line 755, in decorated_view
          return func(*args, **kwargs)
        File "/home/dgies/airflow/venv/lib/python2.7/site-packages/airflow/www/utils.py", line 125, in wrapper
          return f(*args, **kwargs)
        File "/home/dgies/airflow/venv/lib/python2.7/site-packages/airflow/www/views.py", line 1701, in gantt
          'isoEnd': ti.end_date.isoformat()[:-4],
      AttributeError: 'NoneType' object has no attribute 'isoformat'
      

      Proposed fix is to use `ti.end_date or datetime.now()` everywhere ti.end_date is used in the view. This problem doesn't seem to affect any of the other views, only Gantt.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              dgies Daniel Gies
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: