问题
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