GCP 功能拒绝部署 - 获取存储源时出错:generic::unknown:重试预算耗尽(3 次尝试)

Tal*_*dad 9 python-3.x google-cloud-platform google-cloud-functions

我正在尝试在 zsh shell (Arch Linux) 中使用此行来部署 Google Cloud HTTP 函数:

gcloud functions deploy testing --runtime python38 --trigger-http --allow-unauthenticated
Run Code Online (Sandbox Code Playgroud)

当函数只有[main.py]时:

def testing(request):
   print("yes")
   return 'finished', 200
Run Code Online (Sandbox Code Playgroud)

这是它给出的错误:

在此输入图像描述

错误:

获取存储源时出错:generic::unknown:重试预算耗尽(3 次尝试):获取 gcs 源:从 gcs 解压源:源获取容器以非零状态退出:1

然而,有趣的是,我拥有的其他谷歌云功能(一些是 HTTP 触发,一些是云存储触发)部署得很好。我认为唯一可能的问题是云函数数量限制(?也许??)

请帮帮我

小智 0

很可能是因为您没有指定代码的目录。为此,--source还应该使用标志。完整示例命令gcloud functions deploy function_name --gen2 --runtime=python311 --region=europe-central2 --source=dlp-trigger --entry-point=start_dataflow_process --trigger-topic=run_topic

请记住创建一个名为的目录dlp-trigger并将其放入main.py包含代码和模块的目录中requirements.txt