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

err: rpc error: code = Unavailable desc = transport is closing #10065

Closed
gurobokum opened this issue Sep 10, 2019 · 3 comments · Fixed by #10074
Closed

err: rpc error: code = Unavailable desc = transport is closing #10065

gurobokum opened this issue Sep 10, 2019 · 3 comments · Fixed by #10074
Assignees
Labels
bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. service/ecs Issues and PRs that pertain to the ecs service.
Milestone

Comments

@gurobokum
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 "me too" comments, 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

  • v.0.12.8

Affected Resource(s)

  • aws_ecs_task_definition

Terraform Configuration Files

resource "aws_ecs_task_definition" "lms_backend_prod" {
    family                   = "lms-backend-prod"
    network_mode             = "bridge"
    memory                   = 512
    cpu                      = 256
    container_definitions    = file("${path.module}/container-definitions/lms-backend-prod.json")
    task_role_arn            = "${aws_iam_role.lms_backend_ecs_task_prod.arn}" // <- this section I've changed
    execution_role_arn       = "${aws_iam_role.lms_backend_ecs_exec.arn}"
}

Panic Output

https://gist.github.com/JIoJIaJIu/e70884e9b017c1c669b564faa5a47960

Steps to Reproduce

Looks like the issue happens when I try to update existed (maybe used) aws_ecs_task_definition. Commenting or renaming the section with aws_ecs_task_definition helps to avoid the crash

  1. apply aws_ecs_task_definition
  2. change task_role_arn
  3. terraform apply/plan leads to crash
@ghost ghost added the service/ecs Issues and PRs that pertain to the ecs service. label Sep 10, 2019
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Sep 10, 2019
@bflad bflad 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 Sep 11, 2019
@bflad
Copy link
Contributor

bflad commented Sep 11, 2019

Relevant section from crash log:

2019-09-11T01:41:15.477+0800 [DEBUG] plugin.terraform-provider-aws_v2.22.0_x4: panic: runtime error: invalid memory address or nil pointer dereference
2019-09-11T01:41:15.477+0800 [DEBUG] plugin.terraform-provider-aws_v2.22.0_x4: [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x3964b09]
2019-09-11T01:41:15.477+0800 [DEBUG] plugin.terraform-provider-aws_v2.22.0_x4: 
2019-09-11T01:41:15.477+0800 [DEBUG] plugin.terraform-provider-aws_v2.22.0_x4: goroutine 132 [running]:
2019-09-11T01:41:15.478+0800 [DEBUG] plugin.terraform-provider-aws_v2.22.0_x4: github.com/terraform-providers/terraform-provider-aws/aws.containerDefinitions.Reduce.func1(0x1, 0x0, 0x4b51600)
2019-09-11T01:41:15.478+0800 [DEBUG] plugin.terraform-provider-aws_v2.22.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/aws/ecs_task_definition_equivalency.go:81 +0x49
2019-09-11T01:41:15.478+0800 [DEBUG] plugin.terraform-provider-aws_v2.22.0_x4: sort.insertionSort_func(0xc0010a1130, 0xc000997aa0, 0x0, 0x2)
2019-09-11T01:41:15.478+0800 [DEBUG] plugin.terraform-provider-aws_v2.22.0_x4: 	/opt/goenv/versions/1.12.6/src/sort/zfuncversion.go:12 +0xb1
2019-09-11T01:41:15.478+0800 [DEBUG] plugin.terraform-provider-aws_v2.22.0_x4: sort.quickSort_func(0xc0010a1130, 0xc000997aa0, 0x0, 0x2, 0x4)
2019-09-11T01:41:15.478+0800 [DEBUG] plugin.terraform-provider-aws_v2.22.0_x4: 	/opt/goenv/versions/1.12.6/src/sort/zfuncversion.go:158 +0x1f3
2019-09-11T01:41:15.478+0800 [DEBUG] plugin.terraform-provider-aws_v2.22.0_x4: sort.Slice(0x3d0f360, 0xc000997a80, 0xc0010a1130)
2019-09-11T01:41:15.478+0800 [DEBUG] plugin.terraform-provider-aws_v2.22.0_x4: 	/opt/goenv/versions/1.12.6/src/sort/slice.go:21 +0x129
2019-09-11T01:41:15.478+0800 [DEBUG] plugin.terraform-provider-aws_v2.22.0_x4: github.com/terraform-providers/terraform-provider-aws/aws.containerDefinitions.Reduce(0xc0009978e0, 0x1, 0x4, 0x4211300, 0xc000997840, 0x0)
2019-09-11T01:41:15.478+0800 [DEBUG] plugin.terraform-provider-aws_v2.22.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/aws/ecs_task_definition_equivalency.go:80 +0x22d
2019-09-11T01:41:15.478+0800 [DEBUG] plugin.terraform-provider-aws_v2.22.0_x4: github.com/terraform-providers/terraform-provider-aws/aws.EcsContainerDefinitionsAreEquivalent(0xc000fbe5a0, 0x1d4, 0xc000a06380, 0x1ad, 0xc000a81100, 0x40e601, 0xc0010a1558, 0xc000629530)
2019-09-11T01:41:15.478+0800 [DEBUG] plugin.terraform-provider-aws_v2.22.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/aws/ecs_task_definition_equivalency.go:38 +0x232
2019-09-11T01:41:15.478+0800 [DEBUG] plugin.terraform-provider-aws_v2.22.0_x4: github.com/terraform-providers/terraform-provider-aws/aws.resourceAwsEcsTaskDefinition.func3(0x4bd3811, 0x15, 0xc000fbe5a0, 0x1d4, 0xc000a06380, 0x1ad, 0xc0006e4380, 0x203000)
2019-09-11T01:41:15.478+0800 [DEBUG] plugin.terraform-provider-aws_v2.22.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_ecs_task_definition.go:81 +0xaf
2019-09-11T01:41:15.481+0800 [DEBUG] plugin.terraform-provider-aws_v2.22.0_x4: github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.schemaMap.diff(0xc0003fb860, 0x4bd3811, 0x15, 0xc00041c900, 0xc000996880, 0x545d7c0, 0xc0006e4380, 0x53f7100, 0x0, 0x0)
2019-09-11T01:41:15.481+0800 [DEBUG] plugin.terraform-provider-aws_v2.22.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/schema.go:893 +0x3d4

The code:

https://github.com/terraform-providers/terraform-provider-aws/blob/86d1e9792cd5e2f0df22f6974ecedf55fcd6a6e4/aws/ecs_task_definition_equivalency.go#L81

Needs conversion via aws.StringValue() to allow a missing environment name value.

return aws.StringValue(def.Environment[i].Name) < aws.StringValue(def.Environment[j].Name)

@ghost
Copy link

ghost commented Sep 20, 2019

This has been released in version 2.29.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 for triage. Thanks!

@ghost
Copy link

ghost commented Nov 1, 2019

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Nov 1, 2019
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/ecs Issues and PRs that pertain to the ecs service.
Projects
None yet
4 participants