hashicorp / terraform

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
https://www.terraform.io
Other
42.78k stars 9.56k forks source link

tf crash while while 'apply' with notification_config { } blanked out #23241

Closed romechax closed 5 years ago

romechax commented 5 years ago

Terraform Version

Terraform v0.12.12

Terraform Configuration Files

resource "aws_ssm_maintenance_window" "window" {
  name     = "test-maint-window-romeo1-tf"
  schedule = "cron(0 16 ? * TUE *)"
  duration = 3
  cutoff   = 1
}

resource "aws_ssm_maintenance_window_target" "target1" {
  window_id     = "${aws_ssm_maintenance_window.window.id}"
  name          = "maintenance-window-target-test-1"
  description   = "This is a maintenance window target"
  resource_type = "INSTANCE"

  targets {
    key    = "tag:app:name"
    values = ["${var.app-name}"]
  }
}

resource "aws_ssm_maintenance_window_task" "task" {
  window_id        = "${aws_ssm_maintenance_window.window.id}"
  name             = "maintenance-window-task"
  description      = "This is a maintenance window task"
  task_type        = "RUN_COMMAND"
  task_arn         = "AWS-RunPatchBaseline"
  priority         = 1
  service_role_arn = "${var.service-role}"  #this is SSM Role
  max_concurrency  = "2"
  max_errors       = "1"

  targets {
    key    = "WindowTargetIds"
    values = ["${aws_ssm_maintenance_window_target.target1.id}"]
  }

  task_invocation_parameters {
    run_command_parameters {
      output_s3_bucket     = "${var.s3-bucket-name}" #S3 bucket 
      #output_s3_key_prefix = "output"
      service_role_arn     = "${var.service-role}"
      timeout_seconds      = 600

      notification_config {
          }
        parameter {
        name   = "Operation"
        values = ["Install"]
      }
    }
 }
}

Debug Output

Crash Output

Expected Behavior

Actual Behavior

Steps to Reproduce

Additional Context

References

romechax commented 5 years ago

Crash Report -

Plan: 0 to add, 1 to change, 0 to destroy.

Do you want to perform these actions? Terraform will perform the actions described above. Only 'yes' will be accepted to approve.

Enter a value: yes

aws_ssm_maintenance_window_task.task: Modifying... [id=24b8b4d4-934b-41ab-8c43-ea1fe2c5af3c]

Error: rpc error: code = Unavailable desc = transport is closing

panic: interface conversion: interface {} is nil, not map[string]interface {} 2019-10-31T11:51:25.454+0530 [DEBUG] plugin.terraform-provider-aws_v2.33.0_x4.exe: 2019-10-31T11:51:25.454+0530 [DEBUG] plugin.terraform-provider-aws_v2.33.0_x4.exe: goroutine 30 [running]: 2019-10-31T11:51:25.454+0530 [DEBUG] plugin.terraform-provider-aws_v2.33.0_x4.exe: github.com/terraform-providers/terraform-provider-aws/aws.expandAwsSsmTaskInvocationRunCommandParametersNotificationConfig(0xc000a031c0, 0x1, 0x1, 0x13) 2019-10-31T11:51:25.454+0530 [DEBUG] plugin.terraform-provider-aws_v2.33.0_x4.exe: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_ssm_maintenance_window_task.go:576 +0x30d 2019-10-31T11:51:25.454+0530 [DEBUG] plugin.terraform-provider-aws_v2.33.0_x4.exe: github.com/terraform-providers/terraform-provider-aws/aws.expandAwsSsmTaskInvocationRunCommandParameters(0xc000a031a0, 0x1, 0x1, 0x16) 2019-10-31T11:51:25.454+0530 [DEBUG] plugin.terraform-provider-aws_v2.33.0_x4.exe: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_ssm_maintenance_window_task.go:494 +0x632 2019-10-31T11:51:25.454+0530 [DEBUG] plugin.terraform-provider-aws_v2.33.0_x4.exe: github.com/terraform-providers/terraform-provider-aws/aws.expandAwsSsmTaskInvocationParameters(0xc000a03180, 0x1, 0x1, 0x3d961a0) 2019-10-31T11:51:25.454+0530 [DEBUG] plugin.terraform-provider-aws_v2.33.0_x4.exe: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_ssm_maintenance_window_task.go:395 +0x48c 2019-10-31T11:51:25.454+0530 [DEBUG] plugin.terraform-provider-aws_v2.33.0_x4.exe: github.com/terraform-providers/terraform-provider-aws/aws.resourceAwsSsmMaintenanceWindowTaskUpdate(0xc0003abb20, 0x3d3f8a0, 0xc00030ad80, 0x24, 0x7f1d1e0) 2019-10-31T11:51:25.454+0530 [DEBUG] plugin.terraform-provider-aws_v2.33.0_x4.exe: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_ssm_maintenance_window_task.go:780 +0x894 2019-10-31T11:51:25.454+0530 [DEBUG] plugin.terraform-provider-aws_v2.33.0_x4.exe: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(Resource).Apply(0xc0005f8b00, 0xc0008e0b40, 0xc0009793e0, 0x3d3f8a0, 0xc00030ad80, 0xc0005c1101, 0xc0009a0900, 0x40ef68) 2019-10-31T11:51:25.454+0530 [DEBUG] plugin.terraform-provider-aws_v2.33.0_x4.exe: /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.1.1/helper/schema/resource.go:311 +0x26a 2019-10-31T11:51:25.454+0530 [DEBUG] plugin.terraform-provider-aws_v2.33.0_x4.exe: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(Provider).Apply(0xc0006a3900, 0xc0009b1918, 0xc0008e0b40, 0xc0009793e0, 0xc00095f3a8, 0xc000b0f310, 0x427f5c0) 2019-10-31T11:51:25.454+0530 [DEBUG] plugin.terraform-provider-aws_v2.33.0_x4.exe: /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.1.1/helper/schema/provider.go:294 +0xa0 2019-10-31T11:51:25.454+0530 [DEBUG] plugin.terraform-provider-aws_v2.33.0_x4.exe: github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(GRPCProviderServer).ApplyResourceChange(0xc0000071c0, 0x556c6c0, 0xc000780c00, 0xc00011dbc0, 0xc0000071c0, 0xc000780c00, 0xc00064fa80) 2019-10-31T11:51:25.454+0530 [DEBUG] plugin.terraform-provider-aws_v2.33.0_x4.exe: /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.1.1/internal/helper/plugin/grpc_provider.go:885 +0x889 2019-10-31T11:51:25.455+0530 [DEBUG] plugin.terraform-provider-aws_v2.33.0_x4.exe: github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x4bc88c0, 0xc0000071c0, 0x556c6c0, 0xc000780c00, 0xc00011db60, 0x0, 0x556c6c0, 0xc000780c00, 0xc0008b2000, 0x9d2) 2019-10-31T11:51:25.455+0530 [DEBUG] plugin.terraform-provider-aws_v2.33.0_x4.exe: /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.1.1/internal/tfplugin5/tfplugin5.pb.go:3189 +0x21e 2019-10-31T11:51:25.455+0530 [DEBUG] plugin.terraform-provider-aws_v2.33.0_x4.exe: google.golang.org/grpc.(Server).processUnaryRPC(0xc0000ca160, 0x558bfa0, 0xc000504c00, 0xc000846700, 0xc000870b70, 0x7ef15a0, 0x0, 0x0, 0x0) 2019-10-31T11:51:25.455+0530 [DEBUG] plugin.terraform-provider-aws_v2.33.0_x4.exe: /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/grpc@v1.23.0/server.go:995 +0x467 2019-10-31T11:51:25.455+0530 [DEBUG] plugin.terraform-provider-aws_v2.33.0_x4.exe: google.golang.org/grpc.(Server).handleStream(0xc0000ca160, 0x558bfa0, 0xc000504c00, 0xc000846700, 0x0) 2019-10-31T11:51:25.455+0530 [DEBUG] plugin.terraform-provider-aws_v2.33.0_x4.exe: /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/grpc@v1.23.0/server.go:1275 +0xd9e 2019-10-31T11:51:25.455+0530 [DEBUG] plugin.terraform-provider-aws_v2.33.0_x4.exe: google.golang.org/grpc.(Server).serveStreams.func1.1(0xc000536470, 0xc0000ca160, 0x558bfa0, 0xc000504c00, 0xc000846700) 2019-10-31T11:51:25.455+0530 [DEBUG] plugin.terraform-provider-aws_v2.33.0_x4.exe: /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/grpc@v1.23.0/server.go:710 +0xc2 2019-10-31T11:51:25.455+0530 [DEBUG] plugin.terraform-provider-aws_v2.33.0_x4.exe: created by google.golang.org/grpc.(Server).serveStreams.func1 2019-10-31T11:51:25.455+0530 [DEBUG] plugin.terraform-provider-aws_v2.33.0_x4.exe: /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/grpc@v1.23.0/server.go:708 +0xa8 2019/10/31 11:51:25 [DEBUG] aws_ssm_maintenance_window_task.task: apply errored, but we're indicating that via the Error pointer rather than returning it: rpc error: code = Unavailable desc = transport is closing 2019/10/31 11:51:25 [TRACE] : eval: terraform.EvalMaybeTainted 2019/10/31 11:51:25 [TRACE] : eval: terraform.EvalWriteState 2019/10/31 11:51:25 [TRACE] EvalWriteState: writing current state object for aws_ssm_maintenance_window_task.task 2019/10/31 11:51:25 [TRACE] : eval: terraform.EvalApplyProvisioners 2019/10/31 11:51:25 [TRACE] EvalApplyProvisioners: aws_ssm_maintenance_window_task.task is not freshly-created, so no provisioning is required 2019/10/31 11:51:25 [TRACE] : eval: terraform.EvalMaybeTainted 2019/10/31 11:51:25 [TRACE] : eval: terraform.EvalWriteState 2019/10/31 11:51:25 [TRACE] EvalWriteState: writing current state object for aws_ssm_maintenance_window_task.task 2019/10/31 11:51:25 [TRACE] : eval: terraform.EvalIf 2019/10/31 11:51:25 [TRACE] : eval: terraform.EvalIf 2019/10/31 11:51:25 [TRACE] : eval: terraform.EvalWriteDiff 2019/10/31 11:51:25 [TRACE] : eval: terraform.EvalApplyPost 2019/10/31 11:51:25 [ERROR] : eval: terraform.EvalApplyPost, err: rpc error: code = Unavailable desc = transport is closing 2019/10/31 11:51:25 [ERROR] : eval: terraform.EvalSequence, err: rpc error: code = Unavailable desc = transport is closing 2019/10/31 11:51:25 [TRACE] [walkApply] Exiting eval tree: aws_ssm_maintenance_window_task.task 2019/10/31 11:51:25 [TRACE] vertex "aws_ssm_maintenance_window_task.task": visit complete 2019/10/31 11:51:25 [TRACE] dag/walk: upstream of "provider.aws (close)" errored, so skipping 2019/10/31 11:51:25 [TRACE] dag/walk: upstream of "meta.count-boundary (EachMode fixup)" errored, so skipping 2019/10/31 11:51:25 [TRACE] dag/walk: upstream of "root" errored, so skipping 2019/10/31 11:51:25 [TRACE] statemgr.Filesystem: not making a backup, because the new snapshot is identical to the old 2019/10/31 11:51:25 [TRACE] statemgr.Filesystem: no state changes since last snapshot 2019/10/31 11:51:25 [TRACE] statemgr.Filesystem: writing snapshot at terraform.tfstate 2019/10/31 11:51:25 [TRACE] statemgr.Filesystem: removing lock metadata file .terraform.tfstate.lock.info 2019/10/31 11:51:25 [TRACE] statemgr.Filesystem: unlocked by closing terraform.tfstate 2019-10-31T11:51:25.477+0530 [DEBUG] plugin: plugin process exited: path="D:\UserData\z0041faa\Documents\Project\Mosaic\SSM Implementation\Tf-scripts.terraform\plugins\windows_amd64\terraform-provider-aws_v2.33.0_x4.exe" pid=388876 error="exit status 2" 2019-10-31T11:51:25.482+0530 [DEBUG] plugin: plugin exited

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!

ghost commented 5 years ago

This issue has been automatically migrated to terraform-providers/terraform-provider-aws#10702 because it looks like an issue with that provider. If you believe this is not an issue with the provider, please reply to terraform-providers/terraform-provider-aws#10702.

ghost commented 4 years ago

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.