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: the provider panics when instance group creation times out #2247

Closed
syyang-in-cloud opened this issue Feb 10, 2021 · 2 comments
Closed

Comments

@syyang-in-cloud
Copy link
Member

Referring from the slack channel thread: https://ibmcloudlab.slack.com/archives/C53NF5MB4/p1612899925170500

Hi team, I’m getting the panic from plugin when a resource creation times out in staging. I’ll attach the log into the thread. Is that issue reported?

terraform-provider-ibm: v1.20.1
terraform : 0.12.29
TestInstanceGroup 2021-02-09T11:04:49Z logger.go:66: [0m[1mibm_is_instance_group.this: Still creating... [59m20s elapsed][0m[0m
TestInstanceGroup 2021-02-09T11:04:59Z logger.go:66: [0m[1mibm_is_instance_group.this: Still creating... [59m30s elapsed][0m[0m
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: [33m
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: [1m[33mWarning: [0m[0m[1mProvider source not supported in Terraform v0.12[0m
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: [0m  on versions.tf line 11, in terraform:
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66:   11:     ibm = [4m{[0m
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: [0m  12: [4m      source  = "ibm-cloud/ibm"[0m
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: [0m  13: [4m      version = ">=1.13.1"[0m
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: [0m  14: [4m    }[0m
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: [0m
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: A source was declared for provider ibm. Terraform v0.12 does not support the
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: provider source attribute. It will be ignored.
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: [31m
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: (and one more similar warning elsewhere)
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: [1m[31mError: [0m[0m[1mrpc error: code = Unavailable desc = transport is closing[0m
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: [0m[0m
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: [0m[0m[0m
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: panic: runtime error: invalid memory address or nil pointer dereference
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021-02-09T11:05:03.346Z [DEBUG] plugin.terraform-provider-ibm_v1.20.1: [signal SIGSEGV: segmentation violation code=0x1 addr=0x68 pc=0x1f95364]
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021-02-09T11:05:03.346Z [DEBUG] plugin.terraform-provider-ibm_v1.20.1: 
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021-02-09T11:05:03.346Z [DEBUG] plugin.terraform-provider-ibm_v1.20.1: goroutine 123 [running]:
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021-02-09T11:05:03.346Z [DEBUG] plugin.terraform-provider-ibm_v1.20.1: github.com/IBM-Cloud/terraform-provider-ibm/ibm.waitForHealthyInstanceGroup.func1(0xc00072ff40, 0xc00072fea0, 0x2, 0x1, 0x1, 0x0)
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021-02-09T11:05:03.346Z [DEBUG] plugin.terraform-provider-ibm_v1.20.1: 	/Users/harinireddy/go/src/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance_group.go:464 +0x84
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021-02-09T11:05:03.346Z [DEBUG] plugin.terraform-provider-ibm_v1.20.1: github.com/hashicorp/terraform-plugin-sdk/helper/resource.(*StateChangeConf).WaitForState.func1(0xc0009d20c0, 0xc000405500, 0xc000f523c0, 0xc000bbcfc0, 0xc000c22b20, 0xc000c22af8)
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021-02-09T11:05:03.346Z [DEBUG] plugin.terraform-provider-ibm_v1.20.1: 	/Users/harinireddy/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.6.0/helper/resource/state.go:103 +0x2a4
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021-02-09T11:05:03.346Z [DEBUG] plugin.terraform-provider-ibm_v1.20.1: created by github.com/hashicorp/terraform-plugin-sdk/helper/resource.(*StateChangeConf).WaitForState
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021-02-09T11:05:03.346Z [DEBUG] plugin.terraform-provider-ibm_v1.20.1: 	/Users/harinireddy/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.6.0/helper/resource/state.go:80 +0x1c5
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021-02-09T11:05:03.349Z [DEBUG] plugin: plugin process exited: path=/root/.terraform.d/plugins/terraform-provider-ibm_v1.20.1 pid=6543 error="exit status 2"
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021/02/09 11:05:03 [DEBUG] ibm_is_instance_group.this: apply errored, but we're indicating that via the Error pointer rather than returning it: rpc error: code = Unavailable desc = transport is closing
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021/02/09 11:05:03 [TRACE] <root>: eval: *terraform.EvalMaybeTainted
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021/02/09 11:05:03 [TRACE] EvalMaybeTainted: ibm_is_instance_group.this encountered an error during creation, so it is now marked as tainted
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021/02/09 11:05:03 [TRACE] <root>: eval: *terraform.EvalWriteState
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021-02-09T11:05:03.350Z [WARN]  plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021/02/09 11:05:03 [TRACE] EvalWriteState: removing state object for ibm_is_instance_group.this
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021/02/09 11:05:03 [TRACE] <root>: eval: *terraform.EvalApplyProvisioners
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021/02/09 11:05:03 [TRACE] EvalApplyProvisioners: ibm_is_instance_group.this has no state, so skipping provisioners
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021/02/09 11:05:03 [TRACE] <root>: eval: *terraform.EvalMaybeTainted
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021/02/09 11:05:03 [TRACE] EvalMaybeTainted: ibm_is_instance_group.this encountered an error during creation, so it is now marked as tainted
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021/02/09 11:05:03 [TRACE] <root>: eval: *terraform.EvalWriteState
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021/02/09 11:05:03 [TRACE] EvalWriteState: removing state object for ibm_is_instance_group.this
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021/02/09 11:05:03 [TRACE] <root>: eval: *terraform.EvalIf
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021/02/09 11:05:03 [TRACE] <root>: eval: *terraform.EvalIf
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021/02/09 11:05:03 [TRACE] <root>: eval: *terraform.EvalWriteDiff
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021/02/09 11:05:03 [TRACE] <root>: eval: *terraform.EvalApplyPost
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021/02/09 11:05:03 [ERROR] <root>: eval: *terraform.EvalApplyPost, err: rpc error: code = Unavailable desc = transport is closing
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021/02/09 11:05:03 [ERROR] <root>: eval: *terraform.EvalSequence, err: rpc error: code = Unavailable desc = transport is closing
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021/02/09 11:05:03 [TRACE] [walkApply] Exiting eval tree: ibm_is_instance_group.this
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021/02/09 11:05:03 [TRACE] vertex "ibm_is_instance_group.this": visit complete
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021/02/09 11:05:03 [TRACE] dag/walk: upstream of "provider.ibm (close)" errored, so skipping
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021/02/09 11:05:03 [TRACE] dag/walk: upstream of "meta.count-boundary (EachMode fixup)" errored, so skipping
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021/02/09 11:05:03 [TRACE] dag/walk: upstream of "root" errored, so skipping
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021/02/09 11:05:03 [TRACE] statemgr.Filesystem: no original state snapshot to back up
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021/02/09 11:05:03 [TRACE] statemgr.Filesystem: state has changed since last snapshot, so incrementing serial to 4
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021/02/09 11:05:03 [TRACE] statemgr.Filesystem: writing snapshot at terraform.tfstate
TestInstanceGroup 2021-02-09T11:05:03Z logger.go:66: 2021-02-09T11:05:03.357Z [DEBUG] plugin: plugin exited

The cause of panic when the instance group returns nil, the log.Println panics:

Harini Reddy:
@seungyeop.yang No one reported but we found the issue we will fix the error to remove this panic..
https://github.com/IBM-Cloud/terraform-provider-ibm/blob/85afbc050a8508a197b19bf21558c0cf9b12544a/ibm/resource_ibm_is_instance_group.go#L464
ibm/resource_ibm_is_instance_group.go:464
            log.Println("Status : ", *instanceGroup.Status)
@kavya498
Copy link
Collaborator

Fixed in 11408c8

@kavya498
Copy link
Collaborator

Available in latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants