Search code examples
google-cloud-platformgoogle-cloud-functionsgcloudgoogle-cloud-deploy

Unable to deploy Google Cloud Function due to mysterious --production=false flag


For some reason, I can no longer deploy existing google functions from my local machine or from github actions. Whenever I deploy using the gcloud functions deploy command, I get the following error in the console: ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Build failed: Unknown Syntax Error: Invalid option name ("--production=false"). I am not using a --production=false option in my gcloud deploy command, so I don't really understand where that is coming from.

Build logs always failing on:
Step #1 - "build": Unable to delete previous cache image: DELETE https://us.gcr.io/v2/{{projectId}}/gcf/{{region}}/{{guid}}/cache/manifests/sha256:{{imageId}}: GOOGLE_MANIFEST_DANGLING_TAG: Manifest is still referenced by tag: latest.

Deploy command:

gcloud functions deploy --runtime=nodejs16 --region=us-central1 {{function_name}} --entry-point={{node_function}} --trigger-topic={{topic_name}}

Attempted with the following gcloud versions and got the same result each time:
370, 371, 369, 360

I am not sure where this is coming from. I did not have this problem when I deployed just yesterday and it is not specific to my local machine.


Solution

  • This was due to a regression issue on Google's part. They released a fix for it today and deploys are working again now.

    Issue: https://github.com/GoogleCloudPlatform/buildpacks/issues/175#issuecomment-1030519240