gcloud部署功能错误代码3 [英] gcloud deploy function error code 3
问题描述
我正在学习api.ai 教程为Facebook Messenger制作一个机器人,当我尝试使用以下命令部署该功能时:
I'm doing the tutorial of basic fulfillment and conversation setup of api.ai tutorial to make a bot for facebook messenger, and when I try to deploy the function with the command:
gcloud beta functions deploy testBot --stage-bucket testbot-e9bc4.appspot.com --trigger-http
(我认为其中"testBot"是项目的名称,"testbot-e9bc4.appspot.com"是bucket_name.) 它返回以下错误消息:
(where 'testBot' is the name of the project and 'testbot-e9bc4.appspot.com' is the bucket_name, I thought..) It return the following error message:
ERROR: (gcloud.beta.functions.deploy) OperationError: code=3, message=Source code size exceeds the limit
我已搜索但未找到任何答案,我不知道错误在哪里. 这是本教程中显示的JS文件:
I've searched but not found any answer, I don't know where is the error. this is the JS file that appear in the tutorial:
/
HTTP Cloud Function.
@param {Object} req Cloud Function request context.
@param {Object} res Cloud Function response context.
*/
exports.helloHttp = function helloHttp (req, res) {
response = "This is a sample response from your webhook!" //Default response from the webhook to show it's working
res.setHeader('Content-Type', 'application/json'); //Requires application/json MIME type
res.send(JSON.stringify({ "speech": response, "displayText": response
//"speech" is the spoken version of the response, "displayText" is the visual version
}));
};
推荐答案
在执行gcloud beta functions deploy testBot --stage-bucket testbot-e9bc4.appspot.com --trigger-http
命令之前,请确保您位于go代码所在的正确目录中.
Make sure you are in the correct directory where your go code resides before executing gcloud beta functions deploy testBot --stage-bucket testbot-e9bc4.appspot.com --trigger-http
command.
这篇关于gcloud部署功能错误代码3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!