【问题标题】:returned non-zero exit status 120返回非零退出状态 120
【发布时间】:2022-11-01 16:59:27
【问题描述】:

我写了一段应该通过子进程运行airflow list_dags 命令的代码。

    dags_raw = subprocess.check_output(
        'airflow list_dags', shell=True
    ).split()

我收到以下错误消息

File "/usr/lib/python3.7/subprocess.py", line 411, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.7/subprocess.py", line 512, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command 'airflow list_dags' returned non-zero exit status 120.

我可以直接从服务器运行airflow list_dags。我找不到正确的解决方案。如果有人可以提供帮助,我将不胜感激。

Apache Airflow [1.10.12]
Platform: [Linux, x86_64]
Python Version: [3.7.3]

【问题讨论】:

    标签: python python-3.x subprocess airflow exit-code


    【解决方案1】:

    也许这个link 可以帮助你。

    在 3.6 版更改:如果 Python 解释器捕获 SystemExit 后在清理中发生错误(例如在标准流中刷新缓冲数据时出错),则退出状态更改为 120。

    首先检查您是否可以使用子进程在 Python 中调用 airflow list_dags 而没有错误。

    【讨论】:

      猜你喜欢
      • 2017-05-18
      • 2013-12-23
      • 2014-01-13
      • 2016-08-09
      • 2019-10-02
      • 2019-02-06
      • 2014-07-26
      • 1970-01-01
      • 2017-05-20
      相关资源
      最近更新 更多