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

[Bug]: Provider Crashes #27228

Closed
dstenoien opened this issue Oct 13, 2022 · 5 comments · Fixed by #27257
Closed

[Bug]: Provider Crashes #27228

dstenoien opened this issue Oct 13, 2022 · 5 comments · Fixed by #27257
Assignees
Labels
bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. service/appstream Issues and PRs that pertain to the appstream service.
Milestone

Comments

@dstenoien
Copy link

dstenoien commented Oct 13, 2022

Terraform Core Version

1.1.7

AWS Provider Version

4.34.0

Affected Resource(s)

aws_db_instance

Expected Behavior

Building an RDS instance from snapshot. Normally this process runs fine with no error.

Actual Behavior

RDS does not get created and provider just crashes

Relevant Error/Panic Output Snippet

Stack trace from the terraform-provider-aws_v4.34.0_x5 plugin:

panic: interface conversion: interface {} is []interface {}, not *schema.Set

goroutine 421 [running]:
github.com/hashicorp/terraform-provider-aws/internal/service/appstream.resourceStackUpdate({0xb0f9b40, 0xc003940120}, 0xc004bd0a80, {0x8fa7980?, 0xc0005b4000?})
github.com/hashicorp/terraform-provider-aws/internal/service/appstream/stack.go:338 +0xbd6
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).update(0xb0f9b40?, {0xb0f9b40?, 0xc003940120?}, 0xd?, {0x8fa7980?, 0xc0005b4000?})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:736 +0x87
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc000cbec40, {0xb0f9b40, 0xc003940120}, 0xc001f23860, 0xc004bd0780, {0x8fa7980, 0xc0005b4000})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:847 +0x82c
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc00000c6d8, {0xb0f9b40?, 0xc003940000?}, 0xc0049cfbd0)
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1021 +0xe3c
github.com/hashicorp/terraform-plugin-mux/tf5muxserver.muxServer.ApplyResourceChange({0xc002859440, 0xc0028594a0, {0xc003dd2c20, 0x2, 0x2}, 0xc002859470, 0xc0028832f0, 0xc00396be20, 0xc0028594d0}, {0xb0f9b40, ...}, ...)
github.com/hashicorp/[email protected]/tf5muxserver/mux_server_ApplyResourceChange.go:27 +0x142
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc0016e06e0, {0xb0f9b40?, 0xc00393ced0?}, 0xc0049b6d20)
github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:818 +0x574
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0xa041960?, 0xc0016e06e0}, {0xb0f9b40, 0xc00393ced0}, 0xc0049b6cb0, 0x0)
github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc003743860, {0xb0ff440, 0xc0010da1a0}, 0xc004bc7560, 0xc003e2e810, 0x108a5460, 0x0)
google.golang.org/[email protected]/server.go:1295 +0xb0b
google.golang.org/grpc.(*Server).handleStream(0xc003743860, {0xb0ff440, 0xc0010da1a0}, 0xc004bc7560, 0x0)
google.golang.org/[email protected]/server.go:1636 +0xa1b
google.golang.org/grpc.(*Server).serveStreams.func1.2()
google.golang.org/[email protected]/server.go:932 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/[email protected]/server.go:930 +0x28a

Error: The terraform-provider-aws_v4.34.0_x5 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.

Terraform Configuration Files

resource "aws_db_instance" "oracle-rds" {
    timeouts {
        create = "2h"
        delete = "2h"
    }
    lifecycle {
        ignore_changes = [snapshot_identifier,character_set_name,kms_key_id]
    }
    allocated_storage          = var.snapshot_restore == true ? null : var.rds_allocated_storage
    max_allocated_storage      = 4998
    snapshot_identifier        = var.snapshot_restore == true && var.ignore_snapshot != true ? data.aws_db_snapshot.db_restore_snap[0].id : null # data.aws_db_snapshot.db_restore_snap[0].id

    storage_type               = "gp2"
    engine                     = "oracle-se2"
    instance_class             = var.rds_instance_size
    db_name                    = var.oracle_rds_db_name
    username                   = var.oracle_rds_user
    password                   = var.oracle_rds_pass
    port                       = 1521
    multi_az                   = var.rds_multi_az
    vpc_security_group_ids     = ["${aws_security_group.db_oracle.id}"]
    db_subnet_group_name       = "${aws_db_subnet_group.oracle_subnet_group.name}"
    license_model              = "license-included" # "bring-your-own-license"
    ca_cert_identifier         = "rds-ca-2019"
    maintenance_window         = "wed:05:14-wed:05:44"
    backup_window              = "04:22-04:52"
    backup_retention_period    = var.env != "prod" ? 1 : 3
    skip_final_snapshot        = var.env != "prod" ? true : false
    deletion_protection        = false 
    character_set_name         = "AL32UTF8"
    storage_encrypted          = true
    kms_key_id                 = "${aws_kms_key.rds.arn}"
    option_group_name          = aws_db_option_group.RDSTraxOption.id
    identifier                 = "${var.account_name}-${var.env}-trax-oracle-rds"
    final_snapshot_identifier  = "${var.account_name}-${var.env}-trax-oracle-rds-snapshot-${formatdate("MMDDYYHHmmss", timestamp())}"
    parameter_group_name       = aws_db_parameter_group.db_parameter_group.id

    auto_minor_version_upgrade            = true
    enabled_cloudwatch_logs_exports       = ["alert", "audit", "listener", "trace" ]
    performance_insights_enabled          = true
    performance_insights_retention_period = 7
    monitoring_role_arn                   = var.first_region == true ? aws_iam_role.rds_monitoring_role[0].arn : data.aws_iam_role.rds_monitoring_role[0].arn
    monitoring_interval                   = 60 

}

Steps to Reproduce

Plan works, but once you start the apply it fails right away.

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

No response

@dstenoien dstenoien added bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. labels Oct 13, 2022
@github-actions github-actions bot added crash Results from or addresses a Terraform crash or kernel panic. service/rds Issues and PRs that pertain to the rds service. labels Oct 13, 2022
@github-actions
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • 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.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@breathingdust breathingdust added regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. and removed needs-triage Waiting for first response or review from a maintainer. labels Oct 13, 2022
@ewbankkit ewbankkit added service/appstream Issues and PRs that pertain to the appstream service. and removed service/rds Issues and PRs that pertain to the rds service. labels Oct 13, 2022
@gdavison gdavison self-assigned this Oct 13, 2022
@gdavison gdavison removed the regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. label Oct 13, 2022
@TheOnion7
Copy link

exactly the same here on 4.33, 4.34 and 4.35
on a huge number of resource types on aws. We're stuck with a hotfix impossible to deploy.

Examples of errors we got:

│ Error: Plugin did not respond

│ with aws_appstream_stack.resource_name["STACK-NAME"],
│ on stacks.tf line 1, in resource "aws_appstream_stack" "resource_name":
│ 1: resource "aws_appstream_stack" "resource_name" {

│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
│ contain more details.

Also got many Request Cancelled errors.

And finally:

*panic: interface conversion: interface {} is schema.Set, not []interface {}

@TheOnion7
Copy link

TheOnion7 commented Oct 20, 2022

Update:
We're using AWS Appstream 2.0
I've found a workaround. By removing my Appstream Stacks User settings from the stacks.tf file (which contains the code to deploy the AS2.0 stacks) the panic error went away and I've been able to deploy my code.

I saw a PR already opened to fix something related to that, mainly about the application settings from appstream.
I don't know if you're using Appsream or not. But it might give you a hint.

@github-actions github-actions bot added this to the v4.36.0 milestone Oct 20, 2022
@github-actions
Copy link

This functionality has been released in v4.36.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 Nov 20, 2022
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. service/appstream Issues and PRs that pertain to the appstream service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants