Skip to content

pendulum instance error when rendering task instance details view when no dag runs #14398

@dstandish

Description

@dstandish

Apache Airflow version: 2.0.1

What happened:

Wanted to view task instance details on webserver to verify pool definition of tasks

Got this error

Please consider letting us know by creating a bug report using GitHub.

Python version: 3.7.10
Airflow version: 2.0.1
Node: pax-11009-mbp15.lan
-------------------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/dstandish/.virtualenvs/pax-infra/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/dstandish/.virtualenvs/pax-infra/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/dstandish/.virtualenvs/pax-infra/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/dstandish/.virtualenvs/pax-infra/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/Users/dstandish/.virtualenvs/pax-infra/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/dstandish/.virtualenvs/pax-infra/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Users/dstandish/.virtualenvs/pax-infra/lib/python3.7/site-packages/airflow/www/auth.py", line 34, in decorated
    return func(*args, **kwargs)
  File "/Users/dstandish/.virtualenvs/pax-infra/lib/python3.7/site-packages/airflow/www/decorators.py", line 60, in wrapper
    return f(*args, **kwargs)
  File "/Users/dstandish/.virtualenvs/pax-infra/lib/python3.7/site-packages/airflow/www/views.py", line 1193, in task
    attr = getattr(ti, attr_name)
  File "/Users/dstandish/.virtualenvs/pax-infra/lib/python3.7/site-packages/airflow/models/taskinstance.py", line 817, in previous_start_date_success
    return self.get_previous_start_date(state=State.SUCCESS)
  File "/Users/dstandish/.virtualenvs/pax-infra/lib/python3.7/site-packages/airflow/utils/session.py", line 65, in wrapper
    return func(*args, session=session, **kwargs)
  File "/Users/dstandish/.virtualenvs/pax-infra/lib/python3.7/site-packages/airflow/models/taskinstance.py", line 801, in get_previous_start_date
    return prev_ti and pendulum.instance(prev_ti.start_date)
  File "/Users/dstandish/.virtualenvs/pax-infra/lib/python3.7/site-packages/pendulum/__init__.py", line 174, in instance
    raise ValueError("instance() only accepts datetime objects.")
ValueError: instance() only accepts datetime objects.

Need to make it so that the template context is tolerant of this case
What you expected to happen:

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:bugThis is a clearly a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions