terraformer: Getting error while running terraformer on google provider

Getting below error:

2023-04-26T05:11:12.776Z [ERROR] plugin.terraform-provider-google_v4.63.0_x5: Response contains error diagnostic: @caller=github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/internal/diag/diagnostics.go:55 diagnostic_attribute=“” diagnostic_severity=ERROR diagnostic_summary=“Value Conversion Error” tf_req_id=8f4a4a53-80a0-9b9a-5d77-c095be339355 @module=sdk.proto diagnostic_detail= | An unexpected error was encountered trying to build a value. This is always an error in the provider. Please report the following to the provider developer: | | Received null value, however the target type cannot handle null values. Use the corresponding types package type, a pointer type or a custom type that handles null values. | | Path: | Target Type: google.ProviderModel | Suggested types Type: basetypes.ObjectValue | Suggested Pointer Type: *google.ProviderModel tf_proto_version=5.3 tf_provider_addr=registry.terraform.io/hashicorp/google tf_rpc=Configure timestamp=2023-04-26T05:11:12.776Z

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 8
  • Comments: 25 (1 by maintainers)

Commits related to this issue

Most upvoted comments

I found that 4.59.0 is the highest “hashicorp/google” provider version that works with Terraformer as of 7/11/23.

Terraformer v0.8.24 (darwin_arm64) Terraform v1.5.2 (darwin_arm64) terraform-provider-google_v4.59.0_x5 (darwin_arm64)

I also tried with a full amd_64 stack and got the same results.

@somaz94 :

what is GCP v4.0.0?

That is provider version, as below in the tf configuration (modify after export from terraformer):

terraform {
  required_providers {
    google = {
      source = "hashicorp/google"
      version = "4.0.0"
    }
  }
  required_version = ">= 0.13"
}

Thanks @musyaf11 and @stephen-dunne I can confirm switching to GCP v4.0.0 fixes the issue for me

@sergeylanzman issue stands and is being worked on. Can anyone please remove the stale label to avoid keep alives’ noise?

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@nicklinnell, not sure what the cause of this error, is since I even tried to change the GCP provider to 4.0.0. and it works well for me. My colleague at work also tried this and it works as well for him as well.

btw, here are the versions on my end and colleagues:

  • Terraform v1.4.6
  • Terraformer v.0.8.22
  • GCP v.4.0.0/4.6.0

Problem exists with the 5.x providers as well

Thanks @musyaf11 and @stephen-dunne I can confirm switching to GCP v4.0.0 fixes the issue for me

FYI, stepping back again to GCP 4.0.0 after wiping the environment worked for me !

@musyaf11 yes, I’m actually running this in a “clean” docker container the reinitialises terraform new each time it runs so there are no files other than a main.tf containing:

terraform {
  required_providers {
    google = {
      source = "hashicorp/google"
      version = "4.60.0"
    }
  }
  required_version = ">= 0.13"
}
provider "google" {
  credentials = file("/mycreds.json")
}

Following along as well, just started looking at terraformer for use with our google cloud DNS setup. Looks like I picked a good time to start ! 😄

Followed the steps above to wipe env. Have successfully pinned the provider to 4.60.0 as shown below but error still occurring

C:\Users\steved\Documents\dns\******>terraform init

Initializing the backend...

Initializing provider plugins...
- Finding hashicorp/google versions matching "4.60.0"...
- Installing hashicorp/google v4.60.0...
- Installed hashicorp/google v4.60.0 (signed by HashiCorp)

Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.

C:\Users\steved\Documents\dns\******>terraformer plan google --resources=dns --projects=******* --regions=europe-west2
2023/05/05 11:18:19 google importing project ******* region europe-west2
2023-05-05T11:18:21.009+0100 [ERROR] plugin.terraform-provider-google_v4.60.0_x5.exe: Response contains error diagnostic: @caller=github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/internal/diag/diagnostics.go:55 diagnostic_attribute=""
  diagnostic_detail=
  | An unexpected error was encountered trying to build a value. This is always an error in the provider. Please report the following to the provider developer:
  |
  | Received null value, however the target type cannot handle null values. Use the corresponding `types` package type, a pointer type or a custom type that handles null values.
  |
  | Path:
  | Target Type: google.ProviderModel
  | Suggested `types` Type: basetypes.ObjectValue
  | Suggested Pointer Type: *google.ProviderModel
   tf_proto_version=5.3 tf_req_id=8abde5cc-24c6-3298-769e-ea5181d05d53 @module=sdk.proto diagnostic_severity=ERROR diagnostic_summary="Value Conversion Error" tf_provider_addr=registry.terraform.io/hashicorp/google tf_rpc=Configure timestamp="2023-05-05T11:18:21.008+0100"```

Also spews out the following, not sure if related

2023/05/05 11:18:25 rpc error: code = Unavailable desc = error reading from server: read tcp 127.0.0.1:50264->127.0.0.1:10000: wsarecv: An existing connection was forcibly closed by the remote host.
2023/05/05 11:18:25 WARN: Fail read resource from provider, wait 300ms before retry

e2a:

C:\Users\steved\Documents\dns\******>terraform --version
Terraform v1.4.6
on windows_amd64
+ provider registry.terraform.io/hashicorp/google v4.60.0

C:\Users\steved\Documents\dns\******>terraformer version
Terraformer v0.8.22