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

Panic runtime error in 3.43.0 on okta_policy_mfa_default resource #1481

Closed
stmyers opened this issue Mar 8, 2023 · 6 comments
Closed

Panic runtime error in 3.43.0 on okta_policy_mfa_default resource #1481

stmyers opened this issue Mar 8, 2023 · 6 comments
Labels
bug panic Issue causes TF runtime to panic

Comments

@stmyers
Copy link

stmyers commented Mar 8, 2023

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

v1.3.9

Affected Resource(s)

  • okta_policy_mfa_default

Terraform Configuration Files

resource "okta_policy_mfa_default" "default_mfa_enrollment" {
  is_oie = true

  okta_password = {
    enroll = "REQUIRED"
  }
  okta_verify = {
    enroll = "OPTIONAL"
  }
  webauthn = {
    enroll = "OPTIONAL"
  }
  okta_email = {
    enroll = "OPTIONAL"
  }
  security_question = {
    enroll = "NOT_ALLOWED"
  }
  yubikey_token = {
    enroll = "OPTIONAL"
  }
}

Important Factoids

I pinned provider version to 3.42.0 to prevent the panic

Panic Output

Stack trace from the terraform-provider-okta_v3.43.0 plugin:

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

goroutine 490 [running]:
github.com/okta/terraform-provider-okta/okta.syncSettings(0x101f628?, 0x0)
github.com/okta/terraform-provider-okta/okta/resource_okta_policy_mfa.go:155 +0x1d
github.com/okta/terraform-provider-okta/okta.resourcePolicyMfaDefaultRead({0x101f628?, 0xc000502b40?}, 0x0?, {0xd88800?, 0xc000208120?})
github.com/okta/terraform-provider-okta/okta/resource_okta_policy_mfa_default.go:57 +0xe6
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0xc00044ce00, {0x101f660, 0xc0009f9d10}, 0xd?, {0xd88800, 0xc000208120})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.25.0/helper/schema/resource.go:724 +0x12e
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc00044ce00, {0x101f660, 0xc0009f9d10}, 0xc0005cb790, {0xd88800, 0xc000208120})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.25.0/helper/schema/resource.go:1015 +0x585
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadResource(0xc000498738, {0x101f660?, 0xc0009f9bf0?}, 0xc00051a7c0)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.25.0/helper/schema/grpc_provider.go:613 +0x4a5
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadResource(0xc000271ea0, {0x101f660?, 0xc0001bddd0?}, 0xc000523440)
github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/tf5server/server.go:748 +0x4b1
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler({0xe73ec0?, 0xc000271ea0}, {0x101f660, 0xc0001bddd0}, 0xc00059c690, 0x0)
github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:349 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0001d01e0, {0x10234d8, 0xc0004cfd40}, 0xc0006c4b40, 0xc0004bdce0, 0x15c1410, 0x0)
google.golang.org/grpc@v1.51.0/server.go:1340 +0xd33
google.golang.org/grpc.(*Server).handleStream(0xc0001d01e0, {0x10234d8, 0xc0004cfd40}, 0xc0006c4b40, 0x0)
google.golang.org/grpc@v1.51.0/server.go:1713 +0xa36
google.golang.org/grpc.(*Server).serveStreams.func1.2()
google.golang.org/grpc@v1.51.0/server.go:965 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/grpc@v1.51.0/server.go:963 +0x28a

Error: The terraform-provider-okta_v3.43.0 plugin crashed!

Appears to be these lines

_ = d.Set("is_oie", settings.Type == "AUTHENTICATORS")

@monde monde added bug panic Issue causes TF runtime to panic labels Mar 8, 2023
@monde
Copy link
Collaborator

monde commented Mar 8, 2023

Thanks @stmyers , I'll try and get a bug fix release out real quick, there was another panic issue as well that was reported.

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

@stmyers
Copy link
Author

stmyers commented Mar 8, 2023

I saw the other issue (#1480) you're referencing (I assume) but that is for an older version (3.32) so I think that's unrelated to this issue.

@virgofx
Copy link
Contributor

virgofx commented Mar 9, 2023

Not going to create another issue -- But going to add one more stack trace here:

3.43.0 / OIE

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x28 pc=0x1589fbe]

goroutine 155 [running]:
github.com/okta/terraform-provider-okta/okta.resourcePolicyPasswordDefaultRead({0x1925408?, 0xc000789770?}, 0xc0002d2f80, {0x1689a00?, 0xc0002f9680?})
        github.com/okta/terraform-provider-okta/okta/resource_okta_policy_password_default.go:215 +0xfe
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0xc0004a2fc0, {0x1925440, 0xc0002cb620}, 0xd?, {0x1689a00, 0xc0002f9680})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.25.0/helper/schema/resource.go:724 +0x12e
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc0004a2fc0, {0x1925440, 0xc0002cb620}, 0xc000881110, {0x1689a00, 0xc0002f9680}) 
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.25.0/helper/schema/resource.go:1015 +0x585
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadResource(0xc00068e270, {0x1925440?, 0xc0002cacc0?}, 0xc000886c40)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.25.0/helper/schema/grpc_provider.go:613 +0x4a5
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadResource(0xc000246000, {0x1925440?, 0xc00051b980?}, 0xc000053380)
        github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/tf5server/server.go:748 +0x4b1
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler({0x1775e00?, 0xc000246000}, {0x1925440, 0xc00051b980}, 0xc0001a4850, 0x0) 
        github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:349 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0001b61e0, {0x19292b8, 0xc0005841a0}, 0xc000449e60, 0xc00068dce0, 0x1ed39b0, 0x0)
        google.golang.org/grpc@v1.51.0/server.go:1340 +0xd33
google.golang.org/grpc.(*Server).handleStream(0xc0001b61e0, {0x19292b8, 0xc0005841a0}, 0xc000449e60, 0x0)
        google.golang.org/grpc@v1.51.0/server.go:1713 +0xa36
google.golang.org/grpc.(*Server).serveStreams.func1.2()
        google.golang.org/grpc@v1.51.0/server.go:965 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
        google.golang.org/grpc@v1.51.0/server.go:963 +0x28a

Error: The terraform-provider-okta_v3.43.0.exe plugin crashed!

@monde
Copy link
Collaborator

monde commented Mar 9, 2023

Right, that integer pointers fix I brought in to fix JSON serialization of ints opened up a bunch of small bugs. I had been avoiding fixing that. I am working on fix release, hoping to get that out today.

@virgofx
Copy link
Contributor

virgofx commented Mar 10, 2023

Confirmed that the above stack trace I posted (not the author's original) is fixed via 3.44.0

@monde
Copy link
Collaborator

monde commented Mar 10, 2023

Awesome, good to hear @virgofx

Closing this issue now, fix released in v3.44.0

@monde monde closed this as completed Mar 10, 2023
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
Projects
None yet
Development

No branches or pull requests

3 participants