airflow: error: unrecognized arguments: webserver

浪尽此生 提交于 2019-12-11 05:49:59

问题


I am trying to start my airflow webserver, but it says it is an unrecognised argument

$ airflow webserver
[2017-05-25 15:06:44,682] {__init__.py:36} INFO - Using executor CeleryExecutor
  ____________       _____________
 ____    |__( )_________  __/__  /________      __
____  /| |_  /__  ___/_  /_ __  /_  __ \_ | /| / /
___  ___ |  / _  /   _  __/ _  / / /_/ /_ |/ |/ /
 _/_/  |_/_/  /_/    /_/    /_/  \____/____/|__/

[2017-05-25 15:06:45,099] {models.py:154} INFO - Filling up the DagBag from /home/ec2-user/airflow/dags
usage: airflow [-h] [-v]
airflow: error: unrecognized arguments: webserver

Seeing as most of the other arguments are broken too, I have already tried to reinstall airflow: sudo pip install --upgrade --force-reinstall airflow==1.7.1.3

It was working just fine until I decided to restart it...


回答1:


I figured it out as I was writing the last line of the question. I was restarting because I updated a DAG, in which, I had added an ArgumentParser

parser = argparse.ArgumentParser()
parser.add_argument(
    '-v', '--verbose',
    help="Print lots of debugging statements",
    action="store_const", dest="loglevel", const=logging.DEBUG,
    default=logging.INFO,
)

Apparently that is not allowed in Airflow DAGs



来源:https://stackoverflow.com/questions/44184710/airflow-error-unrecognized-arguments-webserver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!