gpt4 book ai didi

node.js - GCloud Functions调试部署失败

转载 作者:搜寻专家 更新时间:2023-11-01 00:16:46 24 4
gpt4 key购买 nike

今天刚开始使用 GCloud Functions,但遇到了问题。我已经将我的一个项目更新为功能就绪,并使用谷歌的 local-emulator (@google-cloud/functions-emulator) 来调试和测试我的新功能。一切顺利,模拟器部署也很顺利。```

$ functions deploy doThing --trigger-http --timeout=540s
Copying file:///var/folders/nw/.../T/us-central1-doThing-....zip...
Waiting for operation to finish...done.
Deploying function.......done.
Function doThing deployed.

```

但是当我尝试使用实际的 gcloud beta 函数 做同样的事情时,我得到了一个构建错误,没有任何理由或明显的调试方法:

```

$ gcloud beta functions deploy doThing --stage-bucket test-bucket --trigger-http --timeout=360s
Copying file:///var/folders/nw/.../T/tmpUJvuxd/fun.zip [Content-Type=application/zip]...
| [1 files][ 7.5 MiB/ 7.5 MiB]
Operation completed over 1 objects/7.5 MiB.
Deploying function (may take a while - up to 2 minutes)...failed.
ERROR: (gcloud.beta.functions.deploy) OperationError: code=13, message=Error in the build environment

```

在 GClould 日志中,我也没有得到任何其他详细信息 ==> https://pastebin.com/6H7DRkE8

我该如何调试这个部署问题?

最佳答案

经过更多研究,我找到了一种调试部署过程的方法。 gcloud该工具带有一组选项,这些选项不容易被发现,但提供了类似 verbosity 的功能。 .这就是调试部署过程所需要的。在这里找到所有选项: https://cloud.google.com/sdk/gcloud/reference/alpha/functions/deploy(页面底部)

在我的例子中,问题出在私有(private) NPM 存储库上,由于缺乏权限,它肯定无法被 check out 。

gcloud beta functions deploy <NAME> --stage-bucket <BUCKET> --verbosity debug

关于node.js - GCloud Functions调试部署失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44635309/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com