Skip to content

'airflow tasks clear' cli command gives error when using --yes or --no_confirm #14171

@tooptoop4

Description

@tooptoop4

v1.10.14

attempt 1:

airflow tasks clear --no_confirm -s 20210210 -e 20210210 mydag
usage: airflow [-h] GROUP_OR_COMMAND ...

positional arguments:
  GROUP_OR_COMMAND

    Groups:
      celery            Celery components
      config            View configuration
      connections       Manage connections
      dags              Manage DAGs
      db                Database operations
      kubernetes        Tools to help run the KubernetesExecutor
      pools             Manage pools
      tasks             Manage tasks
      users             Manage users
      variables         Manage variables

    Commands:
      kerberos          Start a kerberos ticket renewer
      rotate-fernet-key
                        Rotate encrypted connection credentials and variables
      sync-perm         Update permissions for existing roles and DAGs
      backfill          Run subsections of a DAG for a specified date range.
                        If reset_dag_run option is used, backfill will first
                        prompt users whether airflow should clear all the
                        previous dag_run and task_instances within the
                        backfill date range. If rerun_failed_tasks is used,
                        backfill will auto re-run the previous failed task
                        instances within the backfill date range.
      generate_pod_template
                        Reads your airflow.cfg and migrates your
                        configurations into a airflow_template.yaml file. From
                        this point a user can linkthis file to airflow using
                        the `pod_template_file` argumentand modify using the
                        Kubernetes API
      serve_logs        Serve logs generate by worker
      scheduler         Start a scheduler instance
      webserver         Start a Airflow webserver instance
      version           Show the version
      info              Show information about current Airflow and environment

optional arguments:
  -h, --help            show this help message and exit

airflow command error: unrecognized arguments: --no_confirm, see help above.

attempt 2:

airflow tasks clear --yes -s 20210210 -e 20210210 mydag
Traceback (most recent call last):
  File "/home/ec2-user/venv/bin/airflow", line 37, in <module>
    args.func(args)
  File "/home/ec2-user/venv/lib/python3.7/site-packages/airflow/utils/cli.py", line 233, in wrapper
    func(args)
  File "/home/ec2-user/venv/lib/python3.7/site-packages/airflow/utils/cli.py", line 81, in wrapper
    return f(*args, **kwargs)
  File "/home/ec2-user/venv/lib/python3.7/site-packages/airflow/bin/cli.py", line 867, in clear
    confirm_prompt=not args.no_confirm,
AttributeError: 'Namespace' object has no attribute 'no_confirm'

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