Content-Length error

I tried to deploy a cloud function like this:

user[at]cloudshell:~ (bookshelf-414713)$ gcloud functions deploy bookshelf --runtime java17 --trigger-http --entry-point cloudcode.bookshelf.Bookshelf --allow-unauthentica

and got the following error:

ERROR: (gcloud.functions.deploy) Failed to upload the function source code to signed url: https://storage.googleapis.com/uploads-381804693288.us-central1.cloudfunctions.appspot.com/8421e509-.... Status: [400:b"EntityTooLargeYour proposed upload is larger than the maximum object size specified in your Policy Document.

Content-length exceeds upper bound on range

"]

How to resolve?

 

[note: post has removed some xml characters in error]

6 1 112
1 REPLY 1

To resolve the "EntityTooLarge" error when deploying a Cloud Function:

  1. Reduce function code size.
  2. Use a deployment zip file.
  3. Update the Policy Document for the Cloud Storage bucket to increase the maximum object size limit.
  4. Consider splitting the function into smaller parts.
  5. Review and minimize dependencies.
Top Labels in this Space