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

Terragrunt/Terraform: Error: Plugin did not respond #299

Closed
davidfuturelabs opened this issue Sep 20, 2024 · 4 comments
Closed

Terragrunt/Terraform: Error: Plugin did not respond #299

davidfuturelabs opened this issue Sep 20, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@davidfuturelabs
Copy link

davidfuturelabs commented Sep 20, 2024

Describe the bug

Error when trying import configuration already existent in terragrunt.

Error message

xxx@xxx environments % terragrunt import 'dbtcloud_environment.environments["Development"]'

dbtcloud_environment.environments["Development"]: Importing from ID "myid"...
dbtcloud_environment.environments["Development"]: Import prepared!
Prepared dbtcloud_environment for import
dbtcloud_environment.environments["Development"]: Refreshing state... [id=myid]

│ Error: Plugin did not respond

│ The plugin encountered an error, and failed to respond to the
│ plugin6.(*GRPCProvider).ReadResource call. The plugin logs may contain more
│ details.

Stack trace from the terraform-provider-dbtcloud_v0.3.16 plugin:

panic: runtime error: index out of range [1] with length 1

goroutine 12 [running]:
github.com/dbt-labs/terraform-provider-dbtcloud/pkg/sdkv2/resources.resourceEnvironmentRead({0x101758498?, 0x1400056e690?}, 0x1400063eb00, {0x101741420?, 0x1400043d2c0})
github.com/dbt-labs/terraform-provider-dbtcloud/pkg/sdkv2/resources/environment.go:188 +0xad0
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0x140002fc380, {0x101758498, 0x1400056e690}, 0xd?, {0x101741420, 0x1400043d2c0})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:823 +0xe8
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).RefreshWithoutUpgrade(0x140002fc380, {0x101758498, 0x1400056e690}, 0x140004b2750, {0x101741420, 0x1400043d2c0})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:1117 +0x430
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadResource(0x1400011b8a8, {0x101758498?, 0x1400056e540?}, 0x140000a8540)
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:708 +0x5ac
github.com/hashicorp/terraform-plugin-mux/tf5to6server.v5tov6Server.ReadResource({{0x101764740?, 0x1400011b8a8?}}, {0x101758498?, 0x1400056e540?}, 0x140000a8300?)
github.com/hashicorp/[email protected]/tf5to6server/tf5to6server.go:215 +0x228
github.com/hashicorp/terraform-plugin-mux/tf6muxserver.(*muxServer).ReadResource(0x1017584d0?, {0x101758498?, 0x1400056e240?}, 0x140000a8300)
github.com/hashicorp/[email protected]/tf6muxserver/mux_server_ReadResource.go:35 +0x184
github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ReadResource(0x140002635e0, {0x101758498?, 0x140002bd1a0?}, 0x140006441c0)
github.com/hashicorp/[email protected]/tfprotov6/tf6server/server.go:784 +0x224
github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ReadResource_Handler({0x10171a7e0?, 0x140002635e0}, {0x101758498, 0x140002bd1a0}, 0x1400063e300, 0x0)
github.com/hashicorp/[email protected]/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:482 +0x164
google.golang.org/grpc.(*Server).processUnaryRPC(0x140001bb000, {0x101758498, 0x140002bcf30}, {0x10175f950, 0x1400047c000}, 0x14000098000, 0x140003af3e0, 0x101da7868, 0x0)
google.golang.org/[email protected]/server.go:1369 +0xba0
google.golang.org/grpc.(*Server).handleStream(0x140001bb000, {0x10175f950, 0x1400047c000}, 0x14000098000)
google.golang.org/[email protected]/server.go:1780 +0xc80
google.golang.org/grpc.(*Server).serveStreams.func2.1()
google.golang.org/[email protected]/server.go:1019 +0x8c
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 39
google.golang.org/[email protected]/server.go:1030 +0x150

Error: The terraform-provider-dbtcloud_v0.3.16 plugin crashed!

This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.

Resource configuration

terragrunt import 'dbtcloud_environment.environments["Development"]' my_id

Expected behavior

Should import

Config (please complete the following information):

( the version can be retrieved running the command terraform providers )
Providers required by configuration:
.
└── provider[registry.terraform.io/dbt-labs/dbtcloud] ~> 0.3

Providers required by state:

provider[registry.terraform.io/dbt-labs/dbtcloud]
@davidfuturelabs davidfuturelabs added the bug Something isn't working label Sep 20, 2024
@b-per
Copy link
Collaborator

b-per commented Sep 26, 2024

Hi! Thanks for the report. I will have a look at it.

@b-per
Copy link
Collaborator

b-per commented Sep 26, 2024

Looking at the issue and related code, I think that you are missing one identifier to correctly import the environment.

As mentioned in the docs for the resource, importing an env requires both the project id and the env id

terraform import dbtcloud_environment.prod_environment "project_id:environment_id"

Is it the case that you are just providing the environment_id right now?

@b-per b-per added the Awaiting Response Waiting for response from reporter label Sep 26, 2024
@b-per
Copy link
Collaborator

b-per commented Sep 26, 2024

Even if this is the case, I can definitely update the provider so that this specific error is reported in a better way.

@b-per
Copy link
Collaborator

b-per commented Sep 26, 2024

I added better error handling in 0.3.18 and I think that this should in that case tell that there is an issue with the ID passed.
I am closing it for now but feel free to reopen if the issue is different.

@b-per b-per closed this as completed Sep 26, 2024
@b-per b-per removed the Awaiting Response Waiting for response from reporter label Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants