Search code examples
google-cloud-platformgoogle-cloud-functionsterraformterraform-provider-gcp

Why can't I deploy to Cloud Functions?


I've been able to deploy for months and now suddenly this morning I am getting this error.

│ Error: Error while updating cloudfunction configuration: Error waiting for Updating CloudFunctions Function: Error code 3, message: Build failed: curl: (22) The requested URL returned error: 404 
│ 
│ gzip: stdin: unexpected end of file
│ tar: Child returned status 1
│ tar: Error is not recoverable: exiting now; Error ID: 637fe2a4
│ 
│   with google_cloudfunctions_function.syncFiles,
│   on functions.tf line 396, in resource "google_cloudfunctions_function" "syncFiles":
│  396: resource "google_cloudfunctions_function" "syncFiles" {
│ 

This is the terraform configuration. We zip the directory and give this to cloud functions to deploy

data "archive_file" "source-zip" {
  type        = "zip"
  source_dir  = "${path.root}/../dist/"
  output_path = "${path.root}/../dist/files/${var.app_name}.zip"
  excludes    = ["files/**"]
}

resource "google_storage_bucket_object" "deploy-zip" {
  name       = "${var.app_name}/${var.app_name}-${data.archive_file.source-zip.output_md5}.zip"
  bucket     = "${var.env_name}-deploy"
  source     = "${path.root}/../dist/files/${var.app_name}.zip"
  depends_on = [data.archive_file.source-zip]
}

output "deploy_zip" {
  value = google_storage_bucket_object.deploy-zip.name
}

What could cause this error?

Is this an internal problem?

I have a ticket open with Google support but nothing useful yet.


Solution

  • Please go to Cloud build, select your region, look at history/logs, that should tell you what is failing.

    Possibly a package issue.