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

Crash - aws_cognito_identity_provider when updating idp_identifiers #19792

Closed
haavardw opened this issue Jun 14, 2021 · 3 comments · Fixed by #19819
Closed

Crash - aws_cognito_identity_provider when updating idp_identifiers #19792

haavardw opened this issue Jun 14, 2021 · 3 comments · Fixed by #19819
Labels
bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic.
Milestone

Comments

@haavardw
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 CLI and Terraform AWS Provider Version

Terraform v1.0.0
on linux_amd64
+ provider registry.terraform.io/hashicorp/aws v3.45.0

Affected Resource(s)

  • aws_cognito_identity_provider

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key: https://keybase.io/hashicorp

Debug Output

https://gist.github.com/haavardw/ba266a8b4fcb93b89c08747e99c45832

Info

  • Previous state: One aws_cognito_identity_provider
  • New state: Added another aws_cognito_identity_provider and setting idp_identifiers for the already existing.
  • After first crash, the new identity provider was created in aws, but did not exist in the state.
  • Same crash when doing a apply -target on the already existing identity provider.
  • Manually resolved the issue by
    • importing the newly created identity provider from aws
    • manually setting the idp_identifiers for the already existing identity provider and then refresh -target the already existing resource.
@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/cognito labels Jun 14, 2021
@ewbankkit
Copy link
Contributor

panic: interface conversion: interface {} is nil, not []interface {}

goroutine 116 [running]:
github.com/terraform-providers/terraform-provider-aws/aws.resourceAwsCognitoIdentityProviderUpdate(0xc001b25b00, 0x63161c0, 0xc001d2e000, 0x0, 0xffffffffffffffff)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-aws/aws/resource_aws_cognito_identity_provider.go:194 +0x63f
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).update(0xc00041d0a0, 0x7c5a368, 0xc001b4afc0, 0xc001b25b00, 0x63161c0, 0xc001d2e000, 0x0, 0x0, 0x0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.6.1/helper/schema/resource.go:352 +0x1ee
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc00041d0a0, 0x7c5a368, 0xc001b4afc0, 0xc001b40fc0, 0xc001b78900, 0x63161c0, 0xc001d2e000, 0x0, 0x0, 0x0, ...)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.6.1/helper/schema/resource.go:464 +0x390
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc00059a438, 0x7c5a368, 0xc001b4afc0, 0xc001b05270, 0xc001b4afc0, 0x6ef0f20, 0xc001b74600)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.6.1/helper/schema/grpc_provider.go:955 +0x8ef
github.com/hashicorp/terraform-plugin-go/tfprotov5/server.(*server).ApplyResourceChange(0xc00221a720, 0x7c5a410, 0xc001b4afc0, 0xc001b40e70, 0xc00221a720, 0xc001b74690, 0xc00012cba0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-go@v0.3.0/tfprotov5/server/server.go:332 +0xb5
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x6ef0f20, 0xc00221a720, 0x7c5a410, 0xc001b74690, 0xc001b430e0, 0x0, 0x7c5a410, 0xc001b74690, 0xc001e8a000, 0x7f7)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-go@v0.3.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:380 +0x214
google.golang.org/grpc.(*Server).processUnaryRPC(0xc00147a8c0, 0x7c7bed8, 0xc00142de00, 0xc000152a00, 0xc0007c98c0, 0xb3de840, 0x0, 0x0, 0x0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/grpc@v1.32.0/server.go:1194 +0x52b
google.golang.org/grpc.(*Server).handleStream(0xc00147a8c0, 0x7c7bed8, 0xc00142de00, 0xc000152a00, 0x0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/grpc@v1.32.0/server.go:1517 +0xd0c
google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc001404820, 0xc00147a8c0, 0x7c7bed8, 0xc00142de00, 0xc000152a00)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/grpc@v1.32.0/server.go:859 +0xab
created by google.golang.org/grpc.(*Server).serveStreams.func1
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/grpc@v1.32.0/server.go:857 +0x1fd

if d.HasChange("idp_identifiers") {
params.IdpIdentifiers = expandStringList(d.Get("supported_login_providers").([]interface{}))
}

@ewbankkit ewbankkit added bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. and removed needs-triage Waiting for first response or review from a maintainer. labels Jun 14, 2021
@github-actions github-actions bot added this to the v3.46.0 milestone Jun 16, 2021
@github-actions
Copy link

This functionality has been released in v3.46.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants