Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gcloud deploy function error code 3

Tags:

gcloud

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

(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

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
  }));
};
like image 968
Pablo León Avatar asked Jun 30 '17 19:06

Pablo León


1 Answers

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.

like image 93
shekar Avatar answered Dec 06 '22 15:12

shekar