Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orca Provider Crashing For orcasecurity_business_unit #102

Open
markekibbe opened this issue Nov 6, 2024 · 6 comments
Open

Orca Provider Crashing For orcasecurity_business_unit #102

markekibbe opened this issue Nov 6, 2024 · 6 comments

Comments

@markekibbe
Copy link

Terraform Version

Run terraform -v to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.
1.5.5 -> Unable to upgrade due to BUSL

Affected Resource(s)

  • orcasecurity_business_unit

Terraform Configuration Files

provider "orcasecurity" {
  api_endpoint = "https://app.us.orcasecurity-gov.io/api"
  # ORCASECURITY_API_ENDPOINT
  # ORCASECURITY_API_TOKEN
}

resource "orcasecurity_business_unit" "business_unit_for_aws" {
  name = "test"
  global_filter = false

  # redacted aws cloud account ID number
  # filter_data = {
  #   cloud_vendor_id = [
  #     "1234"
  #   ]
  # }

  # lifecycle {
  #   ignore_changes = [
  #     filter_data,
  #     shiftleft_filter_data
  #   ]
  # }
}

Panic Output


│ Error: Request cancelled

│ The plugin6.(*GRPCProvider).ApplyResourceChange request was cancelled.

Stack trace from the terraform-provider-orcasecurity_v0.0.11 plugin:

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

goroutine 62 [running]:
terraform-provider-orcasecurity/orcasecurity/business_unit.(*businessUnitResource).Create(0x4000206040, {0x8eb3a8, 0x40001b6f60}, {{{{0x8eeab0, 0x4000490390}, {0x6d01e0, 0x40001b7b60}}, {0x8f01f8, 0x40004a0190}}, {{{0x8eeab0, ...}, ...}, ...}, ...}, ...)
        terraform-provider-orcasecurity/orcasecurity/business_unit/resource.go:213 +0x1e0
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).CreateResource(0x4000121760, {0x8eb3a8, 0x40001b6f60}, 0x40001f7320, 0x40001f72c0)
        github.com/hashicorp/[email protected]/internal/fwserver/server_createresource.go:101 +0x410
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).ApplyResourceChange(0x8eb3a8?, {0x8eb3a8, 0x40001b6f60}, 0x40004a0460, 0x40001f7490)
        github.com/hashicorp/[email protected]/internal/fwserver/server_applyresourcechange.go:57 +0x39c
github.com/hashicorp/terraform-plugin-framework/internal/proto6server.(*Server).ApplyResourceChange(0x4000121760, {0x8eb3a8?, 0x40001b6e10?}, 0x40004a0410)
        github.com/hashicorp/[email protected]/internal/proto6server/server_applyresourcechange.go:55 +0x1a8
github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ApplyResourceChange(0x400036e140, {0x8eb3a8?, 0x40000b3320?}, 0x4000244070)
        github.com/hashicorp/[email protected]/tfprotov6/tf6server/server.go:819 +0x3c4
github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ApplyResourceChange_Handler({0x787c00?, 0x400036e140}, {0x8eb3a8, 0x40000b3320}, 0x4000244000, 0x0)
        github.com/hashicorp/[email protected]/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:422 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0x40002b23c0, {0x8eec10, 0x400020c340}, 0x40004f2000, 0x4000386900, 0xd90720, 0x0)
        google.golang.org/[email protected]/server.go:1335 +0xc68
google.golang.org/grpc.(*Server).handleStream(0x40002b23c0, {0x8eec10, 0x400020c340}, 0x40004f2000, 0x0)
        google.golang.org/[email protected]/server.go:1712 +0x854
google.golang.org/grpc.(*Server).serveStreams.func1.1()
        google.golang.org/[email protected]/server.go:947 +0xb4
created by google.golang.org/grpc.(*Server).serveStreams.func1
        google.golang.org/[email protected]/server.go:958 +0x184

Error: The terraform-provider-orcasecurity_v0.0.11 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.

Expected Behavior

An OU created

Actual Behavior

Crash

Steps to Reproduce

  1. terraform apply

Important Factoids

I have attempted to use the resource with various portions populated, but am not proving successful. Also this is a FedRAMP instance.

@patrickb-orca
Copy link
Collaborator

Hi Mark, I'm still looking into this. Please expect a reply early next week.

@markekibbe
Copy link
Author

markekibbe commented Nov 12, 2024 via email

@patrickb-orca
Copy link
Collaborator

Sounds great. I was able to replicate the issue in my US instance of Orca. I'm also getting that error "nil pointer dereference". After some initial development, I fixed the error, but I'd like a few more man-hours to solve this across more cases. Please allow me a day or 2 more to fix this, merge a PR, and publish the new provider. Thank you for your patience and for reporting this!

@markekibbe
Copy link
Author

Sounds great. I was able to replicate the issue in my US instance of Orca. I'm also getting that error "nil pointer dereference". After some initial development, I fixed the error, but I'd like a few more man-hours to solve this across more cases. Please allow me a day or 2 more to fix this, merge a PR, and publish the new provider. Thank you for your patience and for reporting this!

Patrick,

I've replied internally via the Orca case management system, but this is excellent news. Thank you for the rapid iteration here.

Are you able to access your internal case management system? If so, I'd like to get your thoughts there as I provided a few additional details that cannot be publicly disclosed.

@patrickb-orca
Copy link
Collaborator

Fixed here: #107

Please allow us a couple days to publish the change to our Terraform provider.

@patrickb-orca
Copy link
Collaborator

@markekibbe please pull the provider version v0.0.13. Once you've validated it works for you, I'll close this issue. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants