Description
I am able to create Flex Gateway API using version 1.6.1 as well as 1.7.0. However, when I am trying to add routing rules, I am getting following error.
I have attached Terraform template code for reference.
anypoint_apim_flexgateway.petstore-api: Refreshing state... [id=19816717]
╷
│ Error: Plugin did not respond
│
│ with anypoint_apim_flexgateway.petstore-api,
│ on main.tf line 1, in resource "anypoint_apim_flexgateway" "petstore-api":
│ 1: resource "anypoint_apim_flexgateway" "petstore-api" {
│
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).PlanResourceChange call. The plugin
│ logs may contain more details.
╵
Stack trace from the terraform-provider-anypoint_v1.7.0.exe plugin:
panic: missing field in set: routing.0.rules.1344164925.methods.1040875975.1040875975
goroutine 56 [running]:
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*DiffFieldReader).readSet(0x2bacc30, {0x2cf5740, 0x5, 0x5}, 0x2d40a08)
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/field_reader_diff.go:212 +0x69c
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*DiffFieldReader).ReadField(0x2bacc30, {0x2cf5740, 0x5, 0x5})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/field_reader_diff.go:74 +0x37a
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.readObjectField({0xfb345c, 0x2bacc30}, {0x2cf54a0, 0x4, 0x6}, 0x2ce64a0)
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/field_reader.go:236 +0x1a7
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*DiffFieldReader).ReadField(0x2bacc30, {0x2cf54a0, 0x4, 0x6})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/field_reader_diff.go:76 +0x309
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*DiffFieldReader).readSet(0x2bacc30, {0x2bad350, 0x3, 0x3}, 0x2d40968)
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/field_reader_diff.go:206 +0x38c
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*DiffFieldReader).ReadField(0x2bacc30, {0x2bad350, 0x3, 0x3})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/field_reader_diff.go:74 +0x37a
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.readObjectField({0xfb345c, 0x2bacc30}, {0x2d5b0c0, 0x2, 0x2}, 0x2ce6460)
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/field_reader.go:236 +0x1a7
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*DiffFieldReader).ReadField(0x2bacc30, {0x2d5b0c0, 0x2, 0x2})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/field_reader_diff.go:76 +0x309
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.readListField({0xfb345c, 0x2bacc30}, {0x2d60700, 0x1, 0x1})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/field_reader.go:203 +0x2a3
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*DiffFieldReader).ReadField(0x2bacc30, {0x2d60700, 0x1, 0x1})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/field_reader_diff.go:70 +0x1de
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*MultiLevelFieldReader).ReadFieldMerge(0x2d5ac20, {0x2d60700, 0x1, 0x1}, {0xe4af12, 0x7})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/field_reader_multi.go:45 +0xf3
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ResourceDiff).get(0x2ce64e0, {0x2d60700, 0x1, 0x1}, {0xe4af12, 0x7})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource_diff.go:544 +0x77
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ResourceDiff).GetOk(0x2ce64e0, {0xe4af90, 0x7})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource_diff.go:385 +0x83
github.com/mulesoft-anypoint/terraform-provider-anypoint/anypoint.validateRoutingUpstreams(0x2ce64e0)
github.com/mulesoft-anypoint/terraform-provider-anypoint/anypoint/resource_apim_flexgateway.go:1216 +0x9b
github.com/mulesoft-anypoint/terraform-provider-anypoint/anypoint.resourceApimFlexGateway.func1({0xfb7590, 0x2a924f8}, 0x2ce64e0, {0xe21a40, 0x2990758})
github.com/mulesoft-anypoint/terraform-provider-anypoint/anypoint/resource_apim_flexgateway.go:481 +0x1f
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.Diff(0x2a31100, {0xfb7590, 0x2a924f8}, 0x28b8230, 0x2a93200, 0xea4528, {0xe21a40, 0x2990758}, 0x0)
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/schema.go:699 +0x464
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).SimpleDiff(0x2a6a8c0, {0xfb7590, 0x2a924f8}, 0x28b8230, 0x2a93200, {0xe21a40, 0x2990758})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:890 +0x6a
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).PlanResourceChange(0x2baad10, {0xfb7590, 0x2a924c8}, 0x2d205a0)
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:741 +0xabd
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).PlanResourceChange(0x2a06f00, {0xfb7590, 0x2a921f8}, 0x2a96a00)
github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:783 +0x59e
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_PlanResourceChange_Handler({0xe121a0, 0x2a06f00}, {0xfb7590, 0x2a921f8}, 0x2a969c0, 0x0)
github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:367 +0x98
google.golang.org/grpc.(*Server).processUnaryRPC(0x284f7a8, {0xfb92bc, 0x2cd8008}, 0x2a9bc28, 0x2bac570, 0x16ccdf4, 0x0)
google.golang.org/[email protected]/server.go:1295 +0xa40
google.golang.org/grpc.(*Server).handleStream(0x284f7a8, {0xfb92bc, 0x2cd8008}, 0x2a9bc28, 0x0)
google.golang.org/[email protected]/server.go:1636 +0xa11
google.golang.org/grpc.(*Server).serveStreams.func1.2()
google.golang.org/[email protected]/server.go:932 +0xaf
created by google.golang.org/grpc.(*Server).serveStreams.func1 in goroutine 36
google.golang.org/[email protected]/server.go:930 +0x206
Error: The terraform-provider-anypoint_v1.7.0.exe 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.