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.14k stars 9.47k forks source link

Terraform crash trying to apply plan. SIGSEGV: segmentation violation #25375

Closed rbsouthard closed 4 years ago

rbsouthard commented 4 years ago

Terraform Version

Terraform v0.12.24
+ provider.ibm v1.5.2

Terraform Configuration Files

...

Debug Output

Crash Output

crash.log file attached. Larger one had debug turned on.

Expected Behavior

Plan should have been applied.

Actual Behavior

Terraform crash. Crash.log attached

Steps to Reproduce

  1. terraform init crash.log

  2. terraform apply

Additional Context

Nothing out of the ordinary. Terraform is usually run from within Rundeck but can recreate using cli on server.

References

apparentlymart commented 4 years ago

Hi @rbsouthard! Thanks for reporting this.

I can see the following stack trace in the crash log you shared:

2020-06-24T16:19:27.465Z [DEBUG] plugin.terraform-provider-ibm_v1.5.2: panic: runtime error: invalid memory address or nil pointer dereference
2020-06-24T16:19:27.465Z [DEBUG] plugin.terraform-provider-ibm_v1.5.2: [signal SIGSEGV: segmentation violation code=0x1 addr=0xf8 pc=0x18f137a]
2020-06-24T16:19:27.465Z [DEBUG] plugin.terraform-provider-ibm_v1.5.2: 
2020-06-24T16:19:27.465Z [DEBUG] plugin.terraform-provider-ibm_v1.5.2: goroutine 188 [running]:
2020-06-24T16:19:27.465Z [DEBUG] plugin.terraform-provider-ibm_v1.5.2: github.com/IBM-Cloud/terraform-provider-ibm/ibm.setCommonBareMetalOrderOptions(0xc0003a8620, 0x2129ec0, 0xc000976a80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
2020-06-24T16:19:27.465Z [DEBUG] plugin.terraform-provider-ibm_v1.5.2:  /Users/hkantare/go/src/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_bare_metal.go:1298 +0x8fa
2020-06-24T16:19:27.465Z [DEBUG] plugin.terraform-provider-ibm_v1.5.2: github.com/IBM-Cloud/terraform-provider-ibm/ibm.resourceIBMComputeBareMetalCreate(0xc0003a8620, 0x2129ec0, 0xc000976a80, 0x2, 0x357af00)
2020-06-24T16:19:27.465Z [DEBUG] plugin.terraform-provider-ibm_v1.5.2:  /Users/hkantare/go/src/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_bare_metal.go:599 +0x658
2020-06-24T16:19:27.465Z [DEBUG] plugin.terraform-provider-ibm_v1.5.2: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).Apply(0xc000305300, 0xc0000cd8b0, 0xc000a437c0, 0x2129ec0, 0xc000976a80, 0xc000880501, 0xc00083b5c0, 0xc000880598)
2020-06-24T16:19:27.465Z [DEBUG] plugin.terraform-provider-ibm_v1.5.2:  /Users/hkantare/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.6.0/helper/schema/resource.go:305 +0x365
2020-06-24T16:19:27.465Z [DEBUG] plugin.terraform-provider-ibm_v1.5.2: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Provider).Apply(0xc000677880, 0xc00074b918, 0xc0000cd8b0, 0xc000a437c0, 0xc000831048, 0xc0000c6098, 0x1d9c8a0)
2020-06-24T16:19:27.465Z [DEBUG] plugin.terraform-provider-ibm_v1.5.2:  /Users/hkantare/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.6.0/helper/schema/provider.go:294 +0x99
2020-06-24T16:19:27.465Z [DEBUG] plugin.terraform-provider-ibm_v1.5.2: github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).ApplyResourceChange(0xc00000e900, 0x260f140, 0xc000c88240, 0xc000c961e0, 0xc00000e900, 0xc000c88240, 0xc000809a80)
2020-06-24T16:19:27.465Z [DEBUG] plugin.terraform-provider-ibm_v1.5.2:  /Users/hkantare/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.6.0/internal/helper/plugin/grpc_provider.go:885 +0x8b4
2020-06-24T16:19:27.465Z [DEBUG] plugin.terraform-provider-ibm_v1.5.2: github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x20a8280, 0xc00000e900, 0x260f140, 0xc000c88240, 0xc000c96180, 0x0, 0x260f140, 0xc000c88240, 0xc0007f0000, 0xe91)
2020-06-24T16:19:27.465Z [DEBUG] plugin.terraform-provider-ibm_v1.5.2:  /Users/hkantare/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.6.0/internal/tfplugin5/tfplugin5.pb.go:3189 +0x217
2020-06-24T16:19:27.465Z [DEBUG] plugin.terraform-provider-ibm_v1.5.2: google.golang.org/grpc.(*Server).processUnaryRPC(0xc0000ec160, 0x2623060, 0xc0004a5380, 0xc000ce0000, 0xc00017dbf0, 0x3530700, 0x0, 0x0, 0x0)
2020-06-24T16:19:27.465Z [DEBUG] plugin.terraform-provider-ibm_v1.5.2:  /Users/hkantare/go/pkg/mod/google.golang.org/grpc@v1.23.0/server.go:995 +0x460
2020-06-24T16:19:27.465Z [DEBUG] plugin.terraform-provider-ibm_v1.5.2: google.golang.org/grpc.(*Server).handleStream(0xc0000ec160, 0x2623060, 0xc0004a5380, 0xc000ce0000, 0x0)
2020-06-24T16:19:27.465Z [DEBUG] plugin.terraform-provider-ibm_v1.5.2:  /Users/hkantare/go/pkg/mod/google.golang.org/grpc@v1.23.0/server.go:1275 +0xd97
2020-06-24T16:19:27.465Z [DEBUG] plugin.terraform-provider-ibm_v1.5.2: google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc0000c3ef0, 0xc0000ec160, 0x2623060, 0xc0004a5380, 0xc000ce0000)
2020-06-24T16:19:27.465Z [DEBUG] plugin.terraform-provider-ibm_v1.5.2:  /Users/hkantare/go/pkg/mod/google.golang.org/grpc@v1.23.0/server.go:710 +0xbb
2020-06-24T16:19:27.465Z [DEBUG] plugin.terraform-provider-ibm_v1.5.2: created by google.golang.org/grpc.(*Server).serveStreams.func1
2020-06-24T16:19:27.466Z [DEBUG] plugin.terraform-provider-ibm_v1.5.2:  /Users/hkantare/go/pkg/mod/google.golang.org/grpc@v1.23.0/server.go:708 +0xa1

This indicates that this crash bug is in the IBM provider rather than in Terraform Core. This repository is for Terraform Core only, so there is no change we could make in this codebase to address that bug, so I'm going to close this issue.

I think the repository for this provider is IBM-Cloud/terraform-provider-ibm. I'm sure the IBM provider team would appreciate you opening an issue there to record this crash bug! Thanks.

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.