无法部署Google Cloud功能 [英] Unable to deploy google cloud functions

查看:103
本文介绍了无法部署Google Cloud功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用我的控制台在Google云平台上部署云功能.我使用的命令是

I tried to deploy a cloud function on the google cloud platform using the my console. The command I used was,

gcloud functions deploy function_name --runtime=python37 --memory=1024MB --region=asia-northeast1 --allow-unauthenticated --trigger-http

但是我遇到了这个错误,

But I am getting this error,

错误:(gcloud.functions.deploy)OperationError:代码= 3,消息=构建失败:无法解析存储源:googleapi:错误404:未找到,未找到

ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Build failed: could not resolve storage source: googleapi: Error 404: Not Found, notFound

我尝试使用Google搜索,但似乎以前没有人遇到过此错误消息.我还尝试过更改项目,并且部署工作正常.

I tried googling around but it seems like no one had faced this error message before. I have also tried changing project and deployment is working fine.

gcloud config set project another_project

如果有人对导致此错误的原因以及如何解决此问题有任何了解,请多加赞赏.谢谢!

Appreciate it if anyone have any idea on what is causing this error and how I can solve it. Thanks!

推荐答案

根据此处的文档- https://cloud.google.com/functions/docs/building 它说:因为Cloud Storage直接在您的项目中使用,所以在名为:

As per the documentation here - https://cloud.google.com/functions/docs/building it says that : Because Cloud Storage is used directly in your project, the source code directory for your functions is visible, in a bucket named:

gcf-sources-< PROJECT_NUMBER>-< REGION>

因此,如果您删除云存储中的存储桶,则需要重新创建该存储桶.例如,如果您在Asian-south1上运行的项目号为123456789,则存储桶名称应为: gcf-sources-123456789-asia-south1

Therefore, if you delete the bucket in cloud storage, then you need to re create this bucket. For example if your project number is 123456789 running on asia-south1 then the bucket name should be: gcf-sources-123456789-asia-south1

一旦重新创建存储桶,则可以使用gcloud或firebase cli进行部署,它应该可以正常工作.

Once you re create the bucket then you can use gcloud or firebase cli to deploy and it should work normally.

希望这会有所帮助.它对我有用!

Hope this helps. It worked for me!

享受!

这篇关于无法部署Google Cloud功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆