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

Plugin crashed- Error: Plugin did not respond #142

Closed
mohamaa opened this issue Apr 14, 2023 · 3 comments · Fixed by #149 or #150
Closed

Plugin crashed- Error: Plugin did not respond #142

mohamaa opened this issue Apr 14, 2023 · 3 comments · Fixed by #149 or #150

Comments

@mohamaa
Copy link

mohamaa commented Apr 14, 2023

`launchdarkly_feature_flag_environment.mohamaa-featurex_env: Creating...

│ Error: Plugin did not respond

│ with launchdarkly_feature_flag_environment.mohamaa-featurex_env,
│ on main.tf line 27, in resource "launchdarkly_feature_flag_environment" "mohamaa-featurex_env":
│ 27: resource "launchdarkly_feature_flag_environment" "mohamaa-featurex_env" {

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

Stack trace from the terraform-provider-launchdarkly_v2.12.0 plugin:

panic: interface conversion: interface {} is nil, not map[string]interface {}

goroutine 83 [running]:
github.com/launchdarkly/terraform-provider-launchdarkly/launchdarkly.isPercentRollout(...)
github.com/launchdarkly/terraform-provider-launchdarkly/launchdarkly/fallthrough_helper.go:65
github.com/launchdarkly/terraform-provider-launchdarkly/launchdarkly.validateFallThroughResourceData(...)
github.com/launchdarkly/terraform-provider-launchdarkly/launchdarkly/fallthrough_helper.go:52
github.com/launchdarkly/terraform-provider-launchdarkly/launchdarkly.fallthroughFromResourceData(0x1a317e0?)
github.com/launchdarkly/terraform-provider-launchdarkly/launchdarkly/fallthrough_helper.go:75 +0x528
github.com/launchdarkly/terraform-provider-launchdarkly/launchdarkly.resourceFeatureFlagEnvironmentCreate({0x1c2e928, 0xc000113380}, 0x19a99c0?, {0x1931f40?, 0xc000308900})
github.com/launchdarkly/terraform-provider-launchdarkly/launchdarkly/resource_launchdarkly_feature_flag_environment.go:108 +0x143a
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xc0005100e0, {0x1c2e960, 0xc000348210}, 0xd?, {0x1931f40, 0xc000308900})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:707 +0x12e
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc0005100e0, {0x1c2e960, 0xc000348210}, 0xc000202680, 0xc000332900, {0x1931f40, 0xc000308900})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:837 +0xa85
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc000314018, {0x1c2e8b8?, 0xc0003095c0?}, 0xc00027cf00)
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1021 +0xe8d
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc00033e000, {0x1c2e960?, 0xc0001f18f0?}, 0xc000263c70)
github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:812 +0x515
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x1a83580?, 0xc00033e000}, {0x1c2e960, 0xc0001f18f0}, 0xc000112c60, 0x0)
github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0002ac700, {0x1c32c58, 0xc00031cb60}, 0xc0000d9d40, 0xc000300330, 0x2250800, 0x0)
google.golang.org/[email protected]/server.go:1283 +0xcfe
google.golang.org/grpc.(*Server).handleStream(0xc0002ac700, {0x1c32c58, 0xc00031cb60}, 0xc0000d9d40, 0x0)
google.golang.org/[email protected]/server.go:1620 +0xa2f
google.golang.org/grpc.(*Server).serveStreams.func1.2()
google.golang.org/[email protected]/server.go:922 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/[email protected]/server.go:920 +0x28a

Error: The terraform-provider-launchdarkly_v2.12.0 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.`

@mohamaa mohamaa changed the title Error: Plugin did not respond Plugin crashed- Error: Plugin did not respond Apr 14, 2023
@lucywyman
Copy link
Contributor

lucywyman commented Apr 14, 2023

Oh interesting - do you have a snippet of your Terraform manifest we can use to reproduce? Probably just the feature_flag resource.

@mohamaa
Copy link
Author

mohamaa commented Apr 14, 2023

Oh interesting - do you have a snippet of your Terraform manifest we can use to reproduce? Probably just the feature_flag resource.

`data "launchdarkly_team_member" "tesla" {
email = "[email protected]"
}

data "launchdarkly_environment" "dev" {
key = "development"
project_key = "projectx"
}

Create a new feature flag

resource "launchdarkly_feature_flag" "mohamaa-featurex" {
project_key = "projectx"
name = "mohamaa-featurex"
key = "mohamaa-featurexx"
description = "Adds the FeatureX to the displayed interface"
tags = ["managed-by-terraform"]
maintainer_id = data.launchdarkly_team_member.tesla.id
variation_type = "boolean"
variations {
value = true
}
variations {
value = false
}
}

resource "launchdarkly_feature_flag_environment" "mohamaa-featurex_env" {
flag_id = launchdarkly_feature_flag.mohamaa-featurex.id
env_key = data.launchdarkly_environment.dev.key
on = true
fallthrough {
# rollout_weights = [60000, 40000, 0]
# context_kind = "account"
# bucket_by = "accountId"
}
off_variation = 2
}
`

@sloloris
Copy link
Member

Hi @mohamaa ! I hope you managed to get past this, but it is due to the definition of an empty fallthrough block. Also, your configuration will fail again because the off_variation index exceeds the number of variations defined on the flag - we do not backfill extra variations without explicit definition.

Nonetheless, panicking is definitely not a desired behavior and we will consider this a bug in the provider to be fixed ASAP. Thank you for bringing this to our attention!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants