You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Dataproc集群任务失败:gcloud报AttributeError错误求助

Dataproc集群任务执行失败:gcloud AttributeError排查与解决

错误现象

执行Dataproc集群任务时触发gcloud崩溃,错误日志如下:

ERROR: gcloud crashed (AttributeError): 'bool' object has no attribute 'lower'

If you would like to report this issue, please run the following command:
  gcloud feedback

To check gcloud for common problems, please run the following command:
  gcloud info --run-diagnostics

运行gcloud info --run-diagnostics后未检测到异常:

$ gcloud info --run-diagnostics
Network diagnostic detects and fixes local network connection issues.
Checking network connection...done.
Reachability Check passed.
Network diagnostic passed (1/1 checks passed).

Property diagnostic detects issues that may be caused by properties.
Checking hidden properties...done.
Hidden Property Check passed.
Property diagnostic passed (1/1 checks passed).

可能原因

  • gcloud配置中存在布尔类型属性值,而CLI代码错误地对其调用仅适用于字符串的lower()方法。
  • 自定义或脚本设置的gcloud属性被误设为布尔值(如true/false而非字符串格式的"true"/"false")。
  • 所用gcloud SDK版本存在bug,对布尔属性的处理逻辑有缺陷。

解决步骤

  1. 检查并修正gcloud配置属性
    • 列出所有配置属性:gcloud config list --all
    • 查找值为无引号布尔类型(true/false)的项,重点排查Dataproc相关配置(如dataproc.*前缀)。
    • 将布尔值改为字符串格式,示例:
      gcloud config set dataproc/some_property "true"
      
  2. 重置gcloud配置到默认状态
    若无法定位具体问题属性,可备份后重置配置:
    # 备份当前配置
    gcloud config configurations export my-config-backup
    # 创建并激活新的默认配置
    gcloud config configurations create default-reset
    gcloud config configurations activate default-reset
    
    重新配置Dataproc参数后重试任务。
  3. 更新gcloud SDK到最新版本
    旧版本可能存在已知bug,执行更新:
    gcloud components update
    
  4. 检查任务提交脚本
    确认提交任务的脚本中,所有传递给gcloud的参数均为字符串格式,避免直接传入布尔类型值。

内容的提问来源于stack exchange,提问作者Poorna Noothalapati

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.23 08:12:08