Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terraformer error importing google_comput_instance with terraform-provider-google #15059

Closed
Kavuti opened this issue Jul 6, 2023 · 9 comments
Assignees
Labels

Comments

@Kavuti
Copy link

Kavuti commented Jul 6, 2023

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

0.13.6

Affected Resource(s)

I'm actually using Terraformer to import a manually created instance.

  • google_compute_instance

Terraform Configuration Files

providers.tf

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

provider "google" {
  project = "geometric-orbit-387800"
  region  = "europe-west1"
}

Panic Output

https://gist.github.com/Kavuti/7fb0b2dfbe375a7830aa27e93eb6e359

Expected Behavior

I would expect that Terraformer would import correctly the compute instance.

Actual Behavior

Terraformer returns an error in the logs and declares that it should be reported to the provider developer.

Steps to Reproduce

  1. tfenv use 0.13.6
  2. terraformer import google --resources=instances --regions=your-region --projects=your-project
@Kavuti Kavuti added the bug label Jul 6, 2023
@edwardmedia edwardmedia self-assigned this Jul 6, 2023
@edwardmedia
Copy link
Contributor

@Kavuti where did you see below command? Here are some methods I would follow.

terraformer import google --resources=instances --regions=your-region --projects=your-project

@Kavuti
Copy link
Author

Kavuti commented Jul 6, 2023

@edwardmedia That is just a normal terraformer command. I checked which parameters it needed in order to import my resources and then I created the command. The link you posted is good if you are sure about what you already wrote in your Terraform code and you want to just import the resource in the state.
In my case, I know I was missing some configuration options while deploying the instance with Terraform instead of using the GCP Marketplace UI, so I wanted to try Terraformer to have the Terraform code generated and compare the two versions.

@edwardmedia
Copy link
Contributor

@Kavuti Oh, I guess you were talking about this? That is a separate repo. Yeah, I have little experience with that. What we are concerned about is here. If you see its functionality failure, here is the place. For terraformer, you may go to its repo to report issues. Does this make sense?

@Kavuti
Copy link
Author

Kavuti commented Jul 7, 2023

I would normally agree with you, but look at the lines 23-33 of the attached logs:

2023-07-06T11:19:16.688+0200 [ERROR] plugin.terraform-provider-google_v4.72.0_x5: Response contains error diagnostic: diagnostic_severity=ERROR tf_proto_version=5.3 tf_req_id=1349bcf0-f9e2-b2ac-3b36-c25d836462a6 tf_rpc=Configure diagnostic_attribute="" tf_provider_addr=registry.terraform.io/hashicorp/google @caller=github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/internal/diag/diagnostics.go:55 @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: fwmodels.ProviderModel
  | Suggested `types` Type: basetypes.ObjectValue
  | Suggested Pointer Type: *fwmodels.ProviderModel
   diagnostic_summary="Value Conversion Error" timestamp="2023-07-06T11:19:16.687+0200"

The tool informs that the error it encounters is relatable to the provider more than the tool itself.
I tested the behavior also with the 4.68.0 of the provider and the error is the same.

@edwardmedia
Copy link
Contributor

edwardmedia commented Jul 7, 2023

@Kavuti can you share the config and detailed steps you used for your testing?

@edwardmedia
Copy link
Contributor

@Kavuti is this still an issue?

@edwardmedia
Copy link
Contributor

@Kavuti closing this assuming it is no longer an issue.

@koi8
Copy link

koi8 commented Aug 10, 2023

The issue still exists. I was trying to downgrade versions of terraformer and nothing changes. The only thing is changed for me - google cloud provider got upgraded.

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants