orcasecurity / terraform-provider-orcasecurity

Orca Security Terraform Provider
https://registry.terraform.io/providers/orcasecurity/orcasecurity/latest/docs
Mozilla Public License 2.0
4 stars 2 forks source link

Orca Provider Crashing For orcasecurity_business_unit #102

Open markekibbe opened 6 days ago

markekibbe commented 6 days ago

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)

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/terraform-plugin-framework@v1.3.4/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/terraform-plugin-framework@v1.3.4/internal/fwserver/server_applyresourcechange.go:57 +0x39c
github.com/hashicorp/terraform-plugin-framework/internal/proto6server.(*Server).ApplyResourceChange(0x4000121760, {0x8eb3a8?, 0x40001b6e10?}, 0x40004a0410)
        github.com/hashicorp/terraform-plugin-framework@v1.3.4/internal/proto6server/server_applyresourcechange.go:55 +0x1a8
github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ApplyResourceChange(0x400036e140, {0x8eb3a8?, 0x40000b3320?}, 0x4000244070)
        github.com/hashicorp/terraform-plugin-go@v0.18.0/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/terraform-plugin-go@v0.18.0/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/grpc@v1.56.3/server.go:1335 +0xc68
google.golang.org/grpc.(*Server).handleStream(0x40002b23c0, {0x8eec10, 0x400020c340}, 0x40004f2000, 0x0)
        google.golang.org/grpc@v1.56.3/server.go:1712 +0x854
google.golang.org/grpc.(*Server).serveStreams.func1.1()
        google.golang.org/grpc@v1.56.3/server.go:947 +0xb4
created by google.golang.org/grpc.(*Server).serveStreams.func1
        google.golang.org/grpc@v1.56.3/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 commented 4 days ago

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

markekibbe commented 21 hours ago

Patrick,

Alright. Thank You!

Highly appreciate your diligence!

Thanks,

Mark Kibbe (he/him/his)

Senior Cloud Computer Engineer

Platforms & Cloud | Digital Innovation Factory | Enterprise Solutions & Operations

M 440.396.2962

@.**@.>

saic.comhttp://www.saic.com/

[cid:1698c9c6-1956-4bfe-a28b-39ded9937366]

[cid:880cebfc-aa06-46ff-ba14-f984ae20c3ce]

Please note that I follow SAIC’s 9/80 work schedule and am out of the office every other Friday.


From: patrickb-orca @.> Sent: Friday, November 8, 2024 8:39 AM To: orcasecurity/terraform-provider-orcasecurity @.> Cc: Kibbe, Mark E. [US] @.>; Author @.> Subject: [EXTERNAL] Re: [orcasecurity/terraform-provider-orcasecurity] Orca Provider Crashing For orcasecurity_business_unit (Issue #102)

EXTERNAL EMAIL -- This message originates from outside of SAIC

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

— Reply to this email directly, view it on GitHubhttps://github.com/orcasecurity/terraform-provider-orcasecurity/issues/102#issuecomment-2464792029, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A3VA466RRBMOPJPTOHDH6MTZ7S5JPAVCNFSM6AAAAABRJNHFEOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRUG44TEMBSHE. You are receiving this because you authored the thread.Message ID: @.***>

The information contained in this e-mail and any attachments from Science Applications International Corporation ("SAIC") may contain sensitive, privileged and/or proprietary information, and is intended only for the named recipient to whom it was originally addressed. If you are not the intended recipient, any disclosure, distribution, or copying of this e-mail or its attachments is strictly prohibited. If you have received this e-mail in error, please notify the sender immediately by return e-mail and permanently delete the e-mail and any attachments.

patrickb-orca commented 10 hours ago

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!