hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.32k stars 1.73k forks source link

google_dataflow_flex_template_job state becomes invalid after upgrading provider from 4.18 to 4.78 #18032

Open yeweidaniel opened 5 months ago

yeweidaniel commented 5 months ago

Community Note

Terraform Version & Provider Version(s)

Terraform v0.14.9 on Linux

Affected Resource(s)

google_dataflow_flex_template_job

Terraform Configuration

terraform {
  required_version = ">=0.14"
  required_providers {
    google-beta = "= 4.18"
  }
}

resource "google_dataflow_flex_template_job" "streaming_pipeline_synth_source" {
  provider                = google-beta
  project                 = "<your project>"
  name                    = "foo"
  container_spec_gcs_path = "gs://path-to-template.json"
  parameters = {
    experiments           = "upload_graph"
    usePublicIps          = false
    maxNumWorkers         = "2"
    enableStreamingEngine = true

    workerMachineType = "n1-highmem-4"
  }
  on_delete = "drain"
  region    = "us-central1"
}

Debug Output

Error: json: error calling MarshalJSON for type googleapi.RawMessage: unexpected end of JSON input

Expected Behavior

Terraform apply should still work.

Actual Behavior

The error "error calling MarshalJSON" is shown.

Steps to reproduce

  1. terraform apply which succeeds
  2. Change google-beta provider version to 4.78
  3. terraform init -upgrade then terraform apply again which results in the MarshalJSON error.

Important Factoids

No response

References

No response

ggtisc commented 4 months ago

Hi @yeweidaniel!

After many tries following your instructions to replicate this issue all the scenarios were successfully without errors. I suggest you make the most basic troubleshooting like clean memory, restart your environment and try again