Closed poroping closed 3 years ago
Resource fortios_system_sdwan_health_check crashes when used with dynamic_sort_subtable.
fortios_system_sdwan_health_check
Stack trace from the terraform-provider-fortios_v2.3.4 plugin: panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0xb8 pc=0x2101882] goroutine 81 [running]: github.com/poroping/terraform-provider-fortios/fortios.dynamic_sort_subtable.func1(0x1, 0x0, 0xc00160d450) github.com/poroping/terraform-provider-fortios/fortios/config.go:65 +0x122 sort.insertionSort_func(0xc00160d4c0, 0xc0004a1a00, 0x0, 0x2) sort/zfuncversion.go:12 +0xb1 sort.quickSort_func(0xc00160d4c0, 0xc0004a1a00, 0x0, 0x2, 0x4) sort/zfuncversion.go:158 +0x1f3 sort.Slice(0x21a64e0, 0xc0004a19e0, 0xc00160d4c0) sort/slice.go:17 +0xf1 github.com/poroping/terraform-provider-fortios/fortios.dynamic_sort_subtable(0xc000f33f80, 0x2, 0x2, 0x23ac119, 0x7, 0xc00184acb0) github.com/poroping/terraform-provider-fortios/fortios/config.go:62 +0x119 github.com/poroping/terraform-provider-fortios/fortios.flattenSystemsdwanHealthCheckMembers(0x21a6120, 0xc0004a0fe0, 0xc00184acb0, 0x23abaac, 0x7, 0xc001847476, 0x6, 0xc0010bda2c, 0x4, 0xc000f7dd70) github.com/poroping/terraform-provider-fortios/fortios/resource_system_sdwan_health_check.go:679 +0x28b github.com/poroping/terraform-provider-fortios/fortios.refreshObjectSystemsdwanHealthCheck(0xc00184acb0, 0xc000f64030, 0xc001847476, 0x6, 0x4, 0xc000f7dd70) github.com/poroping/terraform-provider-fortios/fortios/resource_system_sdwan_health_check.go:945 +0x2f0b github.com/poroping/terraform-provider-fortios/fortios.resourceSystemsdwanHealthCheckRead(0xc00184acb0, 0x2187f60, 0xc000f7ec60, 0x4, 0xc00124f718) github.com/poroping/terraform-provider-fortios/fortios/resource_system_sdwan_health_check.go:591 +0x406 github.com/poroping/terraform-provider-fortios/fortios.resourceSystemsdwanHealthCheckUpdate(0xc00184acb0, 0x2187f60, 0xc000f7ec60, 0x24, 0x3605980) github.com/poroping/terraform-provider-fortios/fortios/resource_system_sdwan_health_check.go:522 +0x488 github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).Apply(0xc000d0f4a0, 0xc00185bdb0, 0xc00188f500, 0x2187f60, 0xc000f7ec60, 0x222ef01, 0xc000beaf98, 0xc000f7c690) github.com/hashicorp/terraform-plugin-sdk@v1.17.2/helper/schema/resource.go:326 +0x263 github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Provider).Apply(0xc00080c280, 0xc00160da38, 0xc00185bdb0, 0xc00188f500, 0xc0010f73a8, 0xc0015885b0, 0x2230e40) github.com/hashicorp/terraform-plugin-sdk@v1.17.2/helper/schema/provider.go:294 +0x99 github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).ApplyResourceChange(0xc0008357c8, 0x2820480, 0xc0012ef530, 0xc00184b7a0, 0xc0008357c8, 0x0, 0xc00108fba0) github.com/hashicorp/terraform-plugin-sdk@v1.17.2/internal/helper/plugin/grpc_provider.go:895 +0x8b4 github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x235d540, 0xc0008357c8, 0x2820480, 0xc0012ef530, 0xc001084cc0, 0x0, 0x2820480, 0xc0012ef530, 0xc0012f8000, 0x957) github.com/hashicorp/terraform-plugin-sdk@v1.17.2/internal/tfplugin5/tfplugin5.pb.go:3305 +0x217 google.golang.org/grpc.(*Server).processUnaryRPC(0xc000d641c0, 0x282d0e0, 0xc000683380, 0xc001732000, 0xc00103ced0, 0x35c9140, 0x0, 0x0, 0x0) google.golang.org/grpc@v1.32.0/server.go:1194 +0x50a google.golang.org/grpc.(*Server).handleStream(0xc000d641c0, 0x282d0e0, 0xc000683380, 0xc001732000, 0x0) google.golang.org/grpc@v1.32.0/server.go:1517 +0xcfd google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc000802960, 0xc000d641c0, 0x282d0e0, 0xc000683380, 0xc001732000) google.golang.org/grpc@v1.32.0/server.go:859 +0xa1 created by google.golang.org/grpc.(*Server).serveStreams.func1 google.golang.org/grpc@v1.32.0/server.go:857 +0x204 Error: The terraform-provider-fortios_v2.3.4 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.
Fixed in release 2.3.5
Resource
fortios_system_sdwan_health_check
crashes when used with dynamic_sort_subtable.