Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebUI: Action on selection in task instance list yields an error #11513

Closed
pageldev opened this issue Oct 13, 2020 · 4 comments · Fixed by #11753
Closed

WebUI: Action on selection in task instance list yields an error #11513

pageldev opened this issue Oct 13, 2020 · 4 comments · Fixed by #11753
Assignees
Labels
kind:bug This is a clearly a bug

Comments

@pageldev
Copy link
Contributor

Apache Airflow version: v2.0.0.dev0 (latest master)

Environment:

  • OS: Ubuntu 18.04.4 LTS
  • Others: Python 3.6.9

What happened:

Selecting a task in the the task instance list (http:localhost:8080/taskinstance/list/) and performing an Action on it (e.g. Set state to 'failed') yields an error.

Error message:

Something bad has happened.
Please consider letting us know by creating a bug report using Github.

Python version: 3.6.12
Airflow version: 2.0.0.dev0
Node: emma
-------------------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/airflow/.local/lib/python3.6/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/airflow/.local/lib/python3.6/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/airflow/.local/lib/python3.6/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/airflow/.local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/airflow/.local/lib/python3.6/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/airflow/.local/lib/python3.6/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/airflow/.local/lib/python3.6/site-packages/flask_appbuilder/views.py", line 686, in action_post
    self.datamodel.get(self._deserialize_pk_if_composite(pk)) for pk in pks
  File "/home/airflow/.local/lib/python3.6/site-packages/flask_appbuilder/views.py", line 686, in <listcomp>
    self.datamodel.get(self._deserialize_pk_if_composite(pk)) for pk in pks
  File "/home/airflow/.local/lib/python3.6/site-packages/flask_appbuilder/models/sqla/interface.py", line 870, in get
    query, _filters, select_columns=select_columns
  File "/home/airflow/.local/lib/python3.6/site-packages/flask_appbuilder/models/sqla/interface.py", line 324, in apply_all
    select_columns,
  File "/home/airflow/.local/lib/python3.6/site-packages/flask_appbuilder/models/sqla/interface.py", line 272, in _apply_inner_all
    query = self.apply_filters(query, inner_filters)
  File "/home/airflow/.local/lib/python3.6/site-packages/flask_appbuilder/models/sqla/interface.py", line 162, in apply_filters
    return filters.apply_all(query)
  File "/home/airflow/.local/lib/python3.6/site-packages/flask_appbuilder/models/filters.py", line 295, in apply_all
    query = flt.apply(query, value)
  File "/home/airflow/.local/lib/python3.6/site-packages/flask_appbuilder/models/sqla/filters.py", line 137, in apply
    query, field = get_field_setup_query(query, self.model, self.column_name)
  File "/home/airflow/.local/lib/python3.6/site-packages/flask_appbuilder/models/sqla/filters.py", line 40, in get_field_setup_query
    if not hasattr(model, column_name):
TypeError: hasattr(): attribute name must be string

How to reproduce it:

I wanted to take an Action on a task instance of a DAG with schedule_interval=None. I am attaching a minimal DAG file used for reproducing this error.

DAG file
from airflow import DAG
from datetime import timedelta, datetime
from airflow.operators.bash_operator import BashOperator

dag = DAG(
    'simple_dag',
    default_args= {
        'owner': 'airflow',
        'depends_on_past': False,
        'retries' : 0,
        'start_date': datetime(1970, 1, 1),
        'retry_delay': timedelta(seconds=30),
    },
    description='',
    schedule_interval=None,
    catchup=False,
)

t1 = BashOperator(
    task_id='task1',
    bash_command='echo 1',
    dag=dag
)

Anything else we need to know:

Taking the same Action on the DagRun list (http://localhost:8080/dagrun/list) works.

Great project btw 🙌. Really enjoying using it.

@pageldev pageldev added the kind:bug This is a clearly a bug label Oct 13, 2020
@boring-cyborg
Copy link

boring-cyborg bot commented Oct 13, 2020

Thanks for opening your first issue here! Be sure to follow the issue template!

@kaxil kaxil added this to the Airflow 2.0.0-alpha2 milestone Oct 14, 2020
@kaxil
Copy link
Member

kaxil commented Oct 14, 2020

Any ideas here @ashb @mik-laj @ryanahamilton ? I was able to reproduce this

@ryanahamilton
Copy link
Contributor

I was able to reproduce as well. The UI refresh updates didn't touch anything related to this. I thought the recent FAB upgrade from 3.0 to 3.1 could be the culprit, but I just tested the commit prior to that upgrade and was able to reproduce with FAB 3.0 as well.

@mjpieters
Copy link
Contributor

Seeing this too; at /taskinstance/list/?_flt_0_state=queued#, selected all tasks, tried to clear them.

@ashb ashb self-assigned this Oct 22, 2020
ashb added a commit to astronomer/airflow that referenced this issue Oct 23, 2020
This fixes apache#11513 -- and has been submitted upstream to FAB as
dpgaspar/Flask-AppBuilder#1493, once that is
merged we can remove this
ashb added a commit that referenced this issue Oct 23, 2020
This fixes #11513 -- and has been submitted upstream to FAB as
dpgaspar/Flask-AppBuilder#1493, once that is
merged we can remove this override.
michalmisiewicz pushed a commit to michalmisiewicz/airflow that referenced this issue Oct 30, 2020
This fixes apache#11513 -- and has been submitted upstream to FAB as
dpgaspar/Flask-AppBuilder#1493, once that is
merged we can remove this override.
szn pushed a commit to szn/airflow that referenced this issue Nov 1, 2020
This fixes apache#11513 -- and has been submitted upstream to FAB as
dpgaspar/Flask-AppBuilder#1493, once that is
merged we can remove this override.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug This is a clearly a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants