Skip to content

Error while clearing a task via CLI - AttributeError: 'DAG' object has no attribute 'clear' #63817

Closed

Description

@atuls4441

Apache Airflow version

main (development)

If "Other Airflow 3 version" selected, which one?

No response

What happened?

Getting error while clearing a task via CLI

Traceback (most recent call last):
  File "/usr/python/bin/airflow", line 10, in <module>
    sys.exit(main())
  File "/opt/airflow/airflow-core/src/airflow/__main__.py", line 55, in main
    args.func(args)
  File "/opt/airflow/airflow-core/src/airflow/cli/cli_config.py", line 49, in command
    return func(*args, **kwargs)
  File "/opt/airflow/airflow-core/src/airflow/utils/cli.py", line 113, in wrapper
    return f(*args, **kwargs)
  File "/opt/airflow/airflow-core/src/airflow/utils/providers_configuration_loader.py", line 54, in wrapped_function
    return func(*args, **kwargs)
  File "/opt/airflow/airflow-core/src/airflow/cli/commands/task_command.py", line 514, in task_clear
    tis = SerializedDAG.clear_dags(
  File "/opt/airflow/airflow-core/src/airflow/serialization/definitions/dag.py", line 1118, in clear_dags
    return list(tis)
  File "/opt/airflow/airflow-core/src/airflow/serialization/definitions/dag.py", line 1108, in <genexpr>
    dag.clear(
AttributeError: 'DAG' object has no attribute 'clear'

What you think should happen instead?

No response

How to reproduce

  1. Start airflow instance on main branch, create a dagrun for any dag.
  2. Clear Task using CLI by running command airflow tasks clear <dag_id>
  3. Notice the error

Operating System

Linux

Versions of Apache Airflow Providers

No response

Deployment

Other

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. added
    kind:bug
    needs-triage
    on Mar 17, 2026
  2. added
    affected_version:3.2
    and removed
    needs-triage
    on Mar 17, 2026
  3. added
    priority:high
    on Mar 17, 2026
  4. added
    priority:medium
    affected_version:3.2
    and removed
    kind:bug
    affected_version:3.2
    priority:high
    on Mar 17, 2026
  5. amoghrajesh commented on Mar 17, 2026

    @amoghrajesh
    Contributor

    Self assigning this. I will take a look tonight

  6. self-assigned this
    on Mar 17, 2026
  7. added a commit that references this issue on Jul 1, 2026
    c261fef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

affected_version:3.2priority:medium

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions