poroping/terraform-provider-fortios

panic if user doesn't have permissions

Opened this issue · 0 comments

Handle this error upstream.

╷
│ Error: Plugin did not respond
│ 
│   with provider["registry.terraform.io/poroping/fortios"],
│   on main.tf line 30, in provider "fortios":
│   30: provider "fortios" {
│ 
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ConfigureProvider call. The plugin logs may contain more details.
╵

Stack trace from the terraform-provider-fortios_v3.1.3 plugin:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0xb0 pc=0xbab0df]

goroutine 27 [running]:
github.com/poroping/forti-sdk-go/v2/client.NewClientBase(0xc002070a20)
        github.com/poroping/forti-sdk-go/v2@v2.1.5/client/client.go:75 +0x25f
github.com/poroping/forti-sdk-go/v2/client.NewClient(0xc0018a2400)
        github.com/poroping/forti-sdk-go/v2@v2.1.5/client/client.go:26 +0x1d
github.com/poroping/terraform-provider-fortios/v2/internal/provider.configure.func1({0x214bba7, 0x6}, 0xc00205ec60)
        github.com/poroping/terraform-provider-fortios/v2/internal/provider/provider.go:171 +0x458
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Provider).Configure(0xc000280fc0, {0x26904c0, 0xc00205ec60}, 0xc001865160)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.10.1/helper/schema/provider.go:296 +0x23e
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ConfigureProvider(0xc000133428, {0x2690418, 0xc0005603c0}, 0xc000536348)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.10.1/helper/schema/grpc_provider.go:523 +0x27b
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).Configure(0xc00032e6e0, {0x26904c0, 0xc00205e1e0}, 0xc000560100)
        github.com/hashicorp/terraform-plugin-go@v0.7.0/tfprotov5/tf5server/server.go:553 +0x3d3
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_Configure_Handler({0x20d7460, 0xc00032e6e0}, {0x26904c0, 0xc00205e1e0}, 0xc000281080, 0x0)
        github.com/hashicorp/terraform-plugin-go@v0.7.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:331 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000230a80, {0x269f898, 0xc0005281a0}, 0xc00014f440, 0xc001324690, 0x3030f18, 0x0)
        google.golang.org/grpc@v1.44.0/server.go:1282 +0xccf
google.golang.org/grpc.(*Server).handleStream(0xc000230a80, {0x269f898, 0xc0005281a0}, 0xc00014f440, 0x0)
        google.golang.org/grpc@v1.44.0/server.go:1616 +0xa2a
google.golang.org/grpc.(*Server).serveStreams.func1.2()
        google.golang.org/grpc@v1.44.0/server.go:921 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
        google.golang.org/grpc@v1.44.0/server.go:919 +0x294

Error: The terraform-provider-fortios_v3.1.3 plugin crashed!