Skip to content

Error when trying to change TI state from Web UI #1265

@jlowin

Description

@jlowin

Environment

Airflow master, Python 3.5.

Issue

In the Web UI, trying to change the state of certain TaskInstances results in an error. I think it's any task that has a . in its name or in its dad's name -- something is happening where . becomes .. (if I remember correctly it has something to do with trying to access attributes?) If I log the error when trying to change test_31.test_subdag_with_pool, I can see the id being passed to the query is test_31..test_subdag_with_pool (note the extra .).

To reproduce

create a task with a period in its name or its dag's name (either via subdag or manually). Change it's state via the UI.

Attempted action:
screen shot 2016-03-30 at 5 37 02 pm
Result:


                          ____/ (  (    )   )  \___
                         /( (  (  )   _    ))  )   )\
                       ((     (   )(    )  )   (   )  )
                     ((/  ( _(   )   (   _) ) (  () )  )
                    ( (  ( (_)   ((    (   )  .((_ ) .  )_
                   ( (  )    (      (  )    )   ) . ) (   )
                  (  (   (  (   ) (  _  ( _) ).  ) . ) ) ( )
                  ( (  (   ) (  )   (  ))     ) _)(   )  )  )
                 ( (  ( \ ) (    (_  ( ) ( )  )   ) )  )) ( )
                  (  (   (  (   (_ ( ) ( _    )  ) (  )  )   )
                 ( (  ( (  (  )     (_  )  ) )  _)   ) _( ( )
                  ((  (   )(    (     _    )   _) _(_ (  (_ )
                   (_((__(_(__(( ( ( |  ) ) ) )_))__))_)___)
                   ((__)        \\||lll|l||///          \_))
                            (   /(/ (  )  ) )\   )
                          (    ( ( ( | | ) ) )\   )
                           (   /(| / ( )) ) ) )) )
                         (     ( ((((_(|)_)))))     )
                          (      ||\(|(|)|/||     )
                        (        |(||(||)||||        )
                          (     //|/l|||)|\\ \     )
                        (/ / //  /|//||||\\  \ \  \ _)
-------------------------------------------------------------------------------
Node: airflow-quipd
-------------------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/conda/lib/python3.5/site-packages/airflow/www/views.py", line 2070, in set_task_instance_state
    TI.execution_date == execution_date).one()
  File "/opt/conda/lib/python3.5/site-packages/sqlalchemy/orm/query.py", line 2699, in one
    raise orm_exc.NoResultFound("No row was found for one()")
sqlalchemy.orm.exc.NoResultFound: No row was found for one()

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.5/site-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/opt/conda/lib/python3.5/site-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/opt/conda/lib/python3.5/site-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/opt/conda/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/opt/conda/lib/python3.5/site-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/conda/lib/python3.5/site-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/conda/lib/python3.5/site-packages/flask_admin/base.py", line 68, in inner
    return self._run_view(f, *args, **kwargs)
  File "/opt/conda/lib/python3.5/site-packages/flask_admin/base.py", line 367, in _run_view
    return fn(self, *args, **kwargs)
  File "/opt/conda/lib/python3.5/site-packages/flask_admin/model/base.py", line 1982, in action_view
    return self.handle_action()
  File "/opt/conda/lib/python3.5/site-packages/flask_admin/actions.py", line 113, in handle_action
    response = handler[0](ids)
  File "/opt/conda/lib/python3.5/site-packages/airflow/www/views.py", line 2059, in action_set_retry
    self.set_task_instance_state(ids, State.UP_FOR_RETRY)
  File "/opt/conda/lib/python3.5/site-packages/airflow/utils.py", line 142, in wrapper
    result = func(*args, **kwargs)
  File "/opt/conda/lib/python3.5/site-packages/airflow/www/views.py", line 2078, in set_task_instance_state
    raise Exception("Ooops")
Exception: Ooops

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:bugThis is a clearly a bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions