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

context cancellation can happen in any call #30655

Closed
enriquesanz-sqy opened this issue Mar 11, 2022 · 4 comments · Fixed by #30987
Closed

context cancellation can happen in any call #30655

enriquesanz-sqy opened this issue Mar 11, 2022 · 4 comments · Fixed by #30987
Assignees
Labels
bug confirmed a Terraform Core team member has reproduced this issue core

Comments

@enriquesanz-sqy
Copy link

Terraform version:
Terraform v1.1.7
on darwin_amd64

  • provider registry.terraform.io/hashicorp/aws v4.4.0
  • provider registry.terraform.io/hashicorp/template v2.2.0

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

Request cancelled: The plugin.(*GRPCProvider).GetProviderSchema request was cancelled.
goroutine 378 [running]:
runtime/debug.Stack()
/usr/local/go/src/runtime/debug/stack.go:24 +0x65
runtime/debug.PrintStack()
/usr/local/go/src/runtime/debug/stack.go:16 +0x19
github.com/hashicorp/terraform/internal/logging.PanicHandler()
/Users/distiller/project/project/internal/logging/panic.go:55 +0x154
panic({0x30c8580, 0xc002338810})
/usr/local/go/src/runtime/panic.go:1038 +0x215
github.com/hashicorp/terraform/internal/plugin.(*GRPCProvider).getSchema(0xc001de9700)
/Users/distiller/project/project/internal/plugin/grpc_provider.go:83 +0x2e6
github.com/hashicorp/terraform/internal/plugin.(*GRPCProvider).getResourceSchema(0xc00004e6c0, {0xc000218a20, 0x1b})
/Users/distiller/project/project/internal/plugin/grpc_provider.go:92 +0x3b
github.com/hashicorp/terraform/internal/plugin.(*GRPCProvider).UpgradeResourceState(0xc001de9700, {{0xc000218a20, 0x1b}, 0x0, {0xc001a3ac60, 0x83, 0x83}, 0x0})
/Users/distiller/project/project/internal/plugin/grpc_provider.go:255 +0xd7
github.com/hashicorp/terraform/internal/terraform.upgradeResourceState({{}, {0x0, 0x0, 0x0}, {{}, {{}, 0x4d, {0xc000218a20, 0x1b}, {0xc0002ddfd0, ...}}, ...}}, ...)
/Users/distiller/project/project/internal/terraform/upgrade_resource_state.go:87 +0x459
github.com/hashicorp/terraform/internal/terraform.(*NodeAbstractResource).readResourceInstanceState(0xc001bbd880, {0x37cabc0, 0xc0006e0fc0}, {{}, {0x0, 0x0, 0x0}, {{}, {{}, 0x4d, ...}, ...}})
/Users/distiller/project/project/internal/terraform/node_resource_abstract.go:372 +0x3b1
github.com/hashicorp/terraform/internal/terraform.(*NodePlanDestroyableResourceInstance).Execute(0xc0013bbba0, {0x37cabc0, 0xc0006e0fc0}, 0x0)
/Users/distiller/project/project/internal/terraform/node_resource_plan_destroy.go:48 +0x9e
github.com/hashicorp/terraform/internal/terraform.(*ContextGraphWalker).Execute(0xc0006e0d20, {0x37cabc0, 0xc0006e0fc0}, {0x301889b8, 0xc0013bbba0})
/Users/distiller/project/project/internal/terraform/graph_walk_context.go:133 +0xc2
github.com/hashicorp/terraform/internal/terraform.(*Graph).walk.func1({0x318cb60, 0xc0013bbba0})
/Users/distiller/project/project/internal/terraform/graph.go:74 +0x2f0
github.com/hashicorp/terraform/internal/dag.(*Walker).walkVertex(0xc00057dd40, {0x318cb60, 0xc0013bbba0}, 0xc002219d40)
/Users/distiller/project/project/internal/dag/walk.go:381 +0x2f1
created by github.com/hashicorp/terraform/internal/dag.(*Walker).Update
/Users/distiller/project/project/internal/dag/walk.go:304 +0xf85
-->

@enriquesanz-sqy enriquesanz-sqy added bug new new issue not yet triaged labels Mar 11, 2022
@jbardin
Copy link
Member

jbardin commented Mar 11, 2022

Hi @enriquesanz-sqy,

Thanks for filing the issue. We could probably handle that error a little better, but the current code expects that RPC call to only fail in very exceptional circumstances, however I think there may be a case where this could be interrupted now triggering a panic rather than erroring out gracefully. Is this something that you can reproduce?

@jbardin jbardin added waiting-response An issue/pull request is waiting for a response from the community waiting for reproduction unable to reproduce issue without further information labels Mar 11, 2022
@crw crw removed the new new issue not yet triaged label Mar 11, 2022
@enriquesanz-sqy
Copy link
Author

enriquesanz-sqy commented Mar 15, 2022 via email

@jbardin jbardin changed the title Crash trying to destroy context cancellation can happen in any call Mar 17, 2022
@jbardin jbardin added core and removed waiting-response An issue/pull request is waiting for a response from the community waiting for reproduction unable to reproduce issue without further information labels Mar 17, 2022
@jbardin jbardin self-assigned this Mar 17, 2022
@jbardin
Copy link
Member

jbardin commented Mar 17, 2022

Thanks @enriquesanz-sqy. There is some improvement to be made in that code which should avoid the problem. I'll use the issue to track making sure we handle cancellation on all grpc contexts.

@github-actions
Copy link

github-actions bot commented Jun 4, 2022

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 Jun 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug confirmed a Terraform Core team member has reproduced this issue core
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants