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

Error when creating okta_resource_set #1278

Closed
chimerstad opened this issue Sep 1, 2022 · 2 comments · Fixed by #1299
Closed

Error when creating okta_resource_set #1278

chimerstad opened this issue Sep 1, 2022 · 2 comments · Fixed by #1299
Labels
bug panic Issue causes TF runtime to panic triaged Triaged into internal Jira

Comments

@chimerstad
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v1.2.8
on darwin_amd64
+ provider registry.terraform.io/okta/okta v3.35.0

Also happens with 1.1.5

Affected Resource(s)

  • okta_resource_set

Terraform Configuration Files

resource "okta_resource_set" "workflows_test" {
  label       = "Workflow Resource Set"
  description = "workflow test"
  resources = [
    "orn:oktapreview:workflow:00o3knqd1ugK5T0ZD1d6:flows"
  ]
}

Debug Output

https://gist.github.com/chimerstad/1051ca4e75ce2977cd2a2bd83dc858ac

Panic Output

I didn't find a crash.log but the shell output seems to match the end of the debug gist linked above.

https://gist.github.com/chimerstad/f1ecee6810a06a9e2f7997cd7c856465

Expected Behavior

Creates a new resource set for "all delegable flows" and have that available for use by other TF resources e.g. okta_admin_role_custom_assignments

Actual Behavior

The resource set was created, then the above panic output is returned. A subsequent attempt at terraform apply reveals that the newly created resource set isn't tracked by Terraform.

https://gist.github.com/chimerstad/e5fff21a601e83af2a11fa5a37c3ebf8

Steps to Reproduce

  1. terraform apply
@monde monde added bug panic Issue causes TF runtime to panic labels Sep 1, 2022
@monde
Copy link
Collaborator

monde commented Sep 1, 2022

Thanks @chimerstad , looks like this code path needs better type handling.

2022-08-31T17:48:56.583-0700 [DEBUG] provider.terraform-provider-okta_v3.35.0: panic: interface conversion: interface {} is nil, not map[string]interface {}
2022-08-31T17:48:56.583-0700 [DEBUG] provider.terraform-provider-okta_v3.35.0: 
2022-08-31T17:48:56.583-0700 [DEBUG] provider.terraform-provider-okta_v3.35.0: goroutine 23 [running]:
2022-08-31T17:48:56.583-0700 [DEBUG] provider.terraform-provider-okta_v3.35.0: github.com/okta/terraform-provider-okta/okta.flattenResourceSetResources({0xc00000e3b0, 0x1, 0x1a19d5a})
2022-08-31T17:48:56.583-0700 [DEBUG] provider.terraform-provider-okta_v3.35.0: 	github.com/okta/terraform-provider-okta/okta/resource_okta_resource_set.go:133 +0x297
2022-08-31T17:48:56.584-0700 [DEBUG] provider.terraform-provider-okta_v3.35.0: github.com/okta/terraform-provider-okta/okta.resourceResourceSetRead({0x1b7ba48, 0xc00074a960}, 0xc0003dbd00, {0x19067e0, 0xc000233680})
2022-08-31T17:48:56.584-0700 [DEBUG] provider.terraform-provider-okta_v3.35.0: 	github.com/okta/terraform-provider-okta/okta/resource_okta_resource_set.go:74 +0x3e9
2022-08-31T17:48:56.584-0700 [DEBUG] provider.terraform-provider-okta_v3.35.0: github.com/okta/terraform-provider-okta/okta.resourceResourceSetCreate({0x1b7ba48, 0xc00074a960}, 0x0, {0x19067e0, 0xc000233680})
2022-08-31T17:48:56.584-0700 [DEBUG] provider.terraform-provider-okta_v3.35.0: 	github.com/okta/terraform-provider-okta/okta/resource_okta_resource_set.go:56 +0x297
2022-08-31T17:48:56.584-0700 [DEBUG] provider.terraform-provider-okta_v3.35.0: github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xc000503c00, {0x1b7ba80, 0xc0006a6c60}, 0xd, {0x19067e0, 0xc000233680})
2022-08-31T17:48:56.584-0700 [DEBUG] provider.terraform-provider-okta_v3.35.0: 	github.com/hashicorp/terraform-plugin-sdk/v2@v2.19.0/helper/schema/resource.go:707 +0x12e
2022-08-31T17:48:56.584-0700 [DEBUG] provider.terraform-provider-okta_v3.35.0: github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc000503c00, {0x1b7ba80, 0xc0006a6c60}, 0xc00011eb60, 0xc0003dbb80, {0x19067e0, 0xc000233680})
2022-08-31T17:48:56.584-0700 [DEBUG] provider.terraform-provider-okta_v3.35.0: 	github.com/hashicorp/terraform-plugin-sdk/v2@v2.19.0/helper/schema/resource.go:837 +0xc29
2022-08-31T17:48:56.584-0700 [DEBUG] provider.terraform-provider-okta_v3.35.0: github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc00012a4e0, {0x1b7ba80, 0xc0006a6ae0}, 0xc0003150e0)
2022-08-31T17:48:56.584-0700 [DEBUG] provider.terraform-provider-okta_v3.35.0: 	github.com/hashicorp/terraform-plugin-sdk/v2@v2.19.0/helper/schema/grpc_provider.go:1021 +0xe3c
2022-08-31T17:48:56.584-0700 [DEBUG] provider.terraform-provider-okta_v3.35.0: github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc00012e280, {0x1b7ba80, 0xc0006a6240}, 0xc0004aa070)
2022-08-31T17:48:56.584-0700 [DEBUG] provider.terraform-provider-okta_v3.35.0: 	github.com/hashicorp/terraform-plugin-go@v0.12.0/tfprotov5/tf5server/server.go:813 +0x551
2022-08-31T17:48:56.584-0700 [DEBUG] provider.terraform-provider-okta_v3.35.0: github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x19e5740, 0xc00012e280}, {0x1b7ba80, 0xc0006a6240}, 0xc0004aa000, 0x0)
2022-08-31T17:48:56.584-0700 [DEBUG] provider.terraform-provider-okta_v3.35.0: 	github.com/hashicorp/terraform-plugin-go@v0.12.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x170
2022-08-31T17:48:56.584-0700 [DEBUG] provider.terraform-provider-okta_v3.35.0: google.golang.org/grpc.(*Server).processUnaryRPC(0xc000326a80, {0x1b8c040, 0xc000548680}, 0xc00071e000, 0xc000282e10, 0x215b060, 0x0)
2022-08-31T17:48:56.584-0700 [DEBUG] provider.terraform-provider-okta_v3.35.0: 	google.golang.org/grpc@v1.48.0/server.go:1295 +0xb03
2022-08-31T17:48:56.584-0700 [DEBUG] provider.terraform-provider-okta_v3.35.0: google.golang.org/grpc.(*Server).handleStream(0xc000326a80, {0x1b8c040, 0xc000548680}, 0xc00071e000, 0x0)
2022-08-31T17:48:56.584-0700 [DEBUG] provider.terraform-provider-okta_v3.35.0: 	google.golang.org/grpc@v1.48.0/server.go:1636 +0xa2a
2022-08-31T17:48:56.584-0700 [DEBUG] provider.terraform-provider-okta_v3.35.0: google.golang.org/grpc.(*Server).serveStreams.func1.2()
2022-08-31T17:48:56.584-0700 [DEBUG] provider.terraform-provider-okta_v3.35.0: 	google.golang.org/grpc@v1.48.0/server.go:932 +0x98
2022-08-31T17:48:56.584-0700 [DEBUG] provider.terraform-provider-okta_v3.35.0: created by google.golang.org/grpc.(*Server).serveStreams.func1
2022-08-31T17:48:56.584-0700 [DEBUG] provider.terraform-provider-okta_v3.35.0: 	google.golang.org/grpc@v1.48.0/server.go:930 +0x294

@monde
Copy link
Collaborator

monde commented Sep 12, 2022

Okta internal reference: https://oktainc.atlassian.net/browse/OKTA-531869

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug panic Issue causes TF runtime to panic triaged Triaged into internal Jira
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants