jdamata / terraform-provider-sonarqube

Terraform provider for managing Sonarqube configuration
GNU General Public License v3.0
62 stars 50 forks source link

Provider crashes after upgrade from 0.16.2 to 0.16.3 #216

Closed david-ortiz-saez closed 6 months ago

david-ortiz-saez commented 8 months ago

Hi there,

Thank you for opening an issue.

Terraform Version

❯ terraform -v Terraform v1.1.9 on darwin_amd64

Affected Resource(s)

Please list the resources as a list, for example:

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,

Expected Behavior

What should have happened? Plan should work normally

Actual Behavior

What actually happened? When trying to launch a plan, we're getting this error:

Stack trace from the terraform-provider-sonarqube_v0.16.3 plugin:

panic: runtime error: index out of range [2] with length 2

goroutine 298 [running]:
github.com/jdamata/terraform-provider-sonarqube/sonarqube.resourceSonarqubeQualityProfileProjectAssociationRead(0xc000277500, {0xb52ee0?, 0xc0001af380})
    github.com/jdamata/terraform-provider-sonarqube/sonarqube/resource_sonarqube_qualityprofile_project_association.go:133 +0xfaf
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0xdb3740?, {0xdb3740?, 0xc0002c2960?}, 0xd?, {0xb52ee0?, 0xc0001af380?})
    github.com/hashicorp/terraform-plugin-sdk/v2@v2.27.0/helper/schema/resource.go:738 +0x178
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc00012f0a0, {0xdb3740, 0xc0002c2960}, 0xc00026a5b0, {0xb52ee0, 0xc0001af380})
    github.com/hashicorp/terraform-plugin-sdk/v2@v2.27.0/helper/schema/resource.go:1044 +0x59e
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadResource(0xc000125878, {0xdb3740?, 0xc0002c2810?}, 0xc0002750c0)
    github.com/hashicorp/terraform-plugin-sdk/v2@v2.27.0/helper/schema/grpc_provider.go:616 +0x497
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadResource(0xc00012d220, {0xdb3740?, 0xc000405950?}, 0xc00068f2c0)
    github.com/hashicorp/terraform-plugin-go@v0.16.0/tfprotov5/tf5server/server.go:751 +0x49e
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler({0xc508a0?, 0xc00012d220}, {0xdb3740, 0xc000405950}, 0xc0005435e0, 0x0)
    github.com/hashicorp/terraform-plugin-go@v0.16.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:386 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0003f0000, {0xdb64a0, 0xc00048c1a0}, 0xc0001905a0, 0xc0003dbfb0, 0x12595d0, 0x0)
    google.golang.org/grpc@v1.56.0/server.go:1337 +0xde3
google.golang.org/grpc.(*Server).handleStream(0xc0003f0000, {0xdb64a0, 0xc00048c1a0}, 0xc0001905a0, 0x0)
    google.golang.org/grpc@v1.56.0/server.go:1714 +0xa1b
google.golang.org/grpc.(*Server).serveStreams.func1.1()
    google.golang.org/grpc@v1.56.0/server.go:959 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
    google.golang.org/grpc@v1.56.0/server.go:957 +0x18c

Error: The terraform-provider-sonarqube_v0.16.3 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.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. Upgrade plugin from v0.16.2 to v0.16.3
  2. Run terraform plan

References

Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:

david-ortiz-saez commented 8 months ago

Created PR-128 to fix it.