terraform-provider-cloudfoundry icon indicating copy to clipboard operation
terraform-provider-cloudfoundry copied to clipboard

Binding empty service id to cloudfoundry app resource

Open soubhagya-pradhan opened this issue 4 years ago • 1 comments

The cloud foundry app resource gets created with empty ("") service id value eg: log service id.

service_binding {
    service_instance = var.log_service_id
  } 

However, while re appling it gives below error: Stack trace from the terraform-provider-cloudfoundry_v0.15.0 plugin:

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

goroutine 89 [running]: github.com/terraform-providers/terraform-provider-cloudfoundry/cloudfoundry.getListMapChanges({0xedcd00, 0xc00043f770}, {0xedcd00, 0xc00043f758}, 0x10e7e20) github.com/terraform-providers/terraform-provider-cloudfoundry/cloudfoundry/utils_terraform.go:132 +0x4ae github.com/terraform-providers/terraform-provider-cloudfoundry/cloudfoundry.resourceAppUpdate({0x126ede8, 0xc00022ca40}, 0xc00007eb00, {0xfc2780, 0xc0003ab400}) github.com/terraform-providers/terraform-provider-cloudfoundry/cloudfoundry/resource_cf_app.go:414 +0xb16 github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).update(0xc00022bce0, {0x126ede8, 0xc00022ca40}, 0x24, {0xfc2780, 0xc0003ab400}) github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:364 +0x12e github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc00022bce0, {0x126ede8, 0xc00022ca40}, 0xc000490380, 0xc00021b120, {0xfc2780, 0xc0003ab400}) github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:464 +0x6ba github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc0000a8018, {0x126ede8, 0xc00022ca40}, 0xc000452370) github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:955 +0x9aa github.com/hashicorp/terraform-plugin-go/tfprotov5/server.(*server).ApplyResourceChange(0xc000492aa0, {0x126ee90, 0xc0003841e0}, 0x1293468) github.com/hashicorp/[email protected]/tfprotov5/server/server.go:332 +0x6c github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x104b040, 0xc000492aa0}, {0x126ee90, 0xc0003841e0}, 0xc000342060, 0x0) github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:380 +0x170 google.golang.org/grpc.(*Server).processUnaryRPC(0xc0003ce700, {0x1283548, 0xc000556300}, 0xc000580100, 0xc0005b5260, 0x19c9620, 0x0) google.golang.org/[email protected]/server.go:1194 +0xc8f google.golang.org/grpc.(*Server).handleStream(0xc0003ce700, {0x1283548, 0xc000556300}, 0xc000580100, 0x0) google.golang.org/[email protected]/server.go:1517 +0xa2a google.golang.org/grpc.(*Server).serveStreams.func1.2() google.golang.org/[email protected]/server.go:859 +0x98 created by google.golang.org/grpc.(*Server).serveStreams.func1 google.golang.org/[email protected]/server.go:857 +0x294

Error: The terraform-provider-cloudfoundry_v0.15.0 plugin crashed!

soubhagya-pradhan avatar Dec 14 '21 06:12 soubhagya-pradhan

thanks @soubhagya-pradhan looks like some validation checking is missing. Further down some blind type conversion is done causing a crash, will check.

loafoe avatar Dec 14 '21 07:12 loafoe