无法部署谷歌云功能 [英] Unable to deploy google cloud functions

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

问题描述

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

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

但我收到此错误,

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

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

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

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--

因此,如果您删除了云存储中的bucket,则需要重新创建这个bucket.例如,如果您的项目编号是 123456789 在 asia-south1 上运行,那么存储桶名称应该是: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!

享受吧!

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

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