简体   繁体   English

气流“NoneType”对象没有属性“is_paused”,如何解决?

[英]airflow 'NoneType' object has no attribute 'is_paused',how to fix it?

I am new to airflow and I just follow the tutorial to run a dag.我是气流的新手,我只是按照教程运行 dag。 Actually I did it successfully, but the problem is when I try to pause the dag by inputing command line like airflow pause dag_id ,it throws AttributeError: 'NoneType' object has no attribute 'is_paused'实际上我成功了,但问题是当我尝试通过输入命令行来暂停 dag 时,如airflow pause dag_id ,它抛出AttributeError: 'NoneType' object has no attribute 'is_paused'

And the Traceback is:回溯是:

File "/anaconda3/bin/airflow", line 32, in <module>
    args.func(args)
  File "/anaconda3/lib/python3.6/site-packages/airflow/utils/cli.py", line 74, in wrapper
    return f(*args, **kwargs)
  File "/anaconda3/lib/python3.6/site-packages/airflow/bin/cli.py", line 365, in pause
    set_is_paused(True, args, dag)
  File "/anaconda3/lib/python3.6/site-packages/airflow/bin/cli.py", line 379, in set_is_paused
    dm.is_paused = is_paused

So I check the python file in the output directory, however, it was coded by airflow and I don't know how to fix it?!!!所以我检查了输出目录中的python文件,但是,它是由气流编码的,我不知道如何修复?!!!

SHOW:~ macbook$ airflow list_dags
[2018-09-07 21:31:38,262] {__init__.py:51} INFO - Using executor SequentialExecutor
[2018-09-07 21:31:38,381] {models.py:258} INFO - Filling up the DagBag from /Users/macbook/airflow/dags


-------------------------------------------------------------------
DAGS
-------------------------------------------------------------------
example_bash_operator
example_branch_dop_operator_v3
example_branch_operator
example_http_operator
example_kubernetes_executor
example_kubernetes_operator
example_passing_params_via_test_command
example_python_operator
example_short_circuit_operator
example_skip_dag
example_subdag_operator
example_subdag_operator.section-1
example_subdag_operator.section-2
example_trigger_controller_dag
example_trigger_target_dag
example_xcom
haha
latest_only
latest_only_with_trigger
test_utils
tutorial

SHOW:~ macbook$ airflow pause haha
[2018-09-07 21:35:41,366] {__init__.py:51} INFO - Using executor SequentialExecutor
[2018-09-07 21:35:41,496] {models.py:258} INFO - Filling up the DagBag from /Users/macbook/airflow/dags
Traceback (most recent call last):
  File "/anaconda3/bin/airflow", line 32, in <module>
    args.func(args)
  File "/anaconda3/lib/python3.6/site-packages/airflow/utils/cli.py", line 74, in wrapper
    return f(*args, **kwargs)
  File "/anaconda3/lib/python3.6/site-packages/airflow/bin/cli.py", line 365, in pause
    set_is_paused(True, args, dag)
  File "/anaconda3/lib/python3.6/site-packages/airflow/bin/cli.py", line 379, in set_is_paused
    dm.is_paused = is_paused
AttributeError: 'NoneType' object has no attribute 'is_paused'

This could be because the DAG (tutorial.py) is not in the directory where airflow expects the DAGs.这可能是因为 DAG (tutorial.py) 不在气流需要 DAG 的目录中。 Please check that the DAG is stored in the directory set in airflow.cfg under dags_folder .请检查 DAG 是否存储在 dags_folder 下的dags_folder设置的目录中。

If you're reading any files using that code snippet, make sure to include the full path.如果您正在使用该代码段读取任何文件,请确保包含完整路径。 Relative paths won't work.相对路径不起作用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 'NoneType' object 没有属性'光标' airflow - 'NoneType' object has no attribute 'cursor' airflow 如何修复 AttributeError: &#39;NoneType&#39; 对象没有属性 &#39;click&#39; - How to fix AttributeError: 'NoneType' object has no attribute 'click' 如何修复AttributeError:&#39;NoneType&#39;对象没有属性&#39;theme_cls&#39; - How to fix AttributeError: 'NoneType' object has no attribute 'theme_cls' 如何修复“”AttributeError: &#39;NoneType&#39; 对象没有属性 &#39;app&#39; - How to fix ""AttributeError: 'NoneType' object has no attribute 'app' 如何修复“NoneType”object 在递归 function 中没有属性“json” - How to fix 'NoneType' object has no attribute 'json' in recursive function 如何修复 /login/ 'NoneType' 处的 AttributeError object 没有属性 'lower' - How to fix AttributeError at /login/ 'NoneType' object has no attribute 'lower' 如何修复:AttributeError: 'NoneType' object 没有属性 'group' - How to fix: AttributeError: 'NoneType' object has no attribute 'group' “如何解决&#39;AttributeError:&#39;NoneType&#39;对象在Python中没有属性&#39;tbody&#39;错误? - "How to fix 'AttributeError: 'NoneType' object has no attribute 'tbody'' error in Python? 如何修复错误“NoneType&#39; 对象没有属性文本”? - How to fix error "NoneType' object has no attribute text"? 如何修复 Atrrribute 错误 'NoneType' object 没有属性 'enter' - How to fix Atrrribute Error 'NoneType' object has no attribute 'enter'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM