Skip to content

Fix #243: Error when create or import cluster - panic: runtime error: invalid memory address or nil pointer dereference #245

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

Merged
merged 2 commits into from
Jun 18, 2020

Conversation

PacoDw
Copy link
Contributor

@PacoDw PacoDw commented Jun 15, 2020

Link to any related issue(s): #243

Type of change:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Documentation fix/enhancement

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the Terraform contribution guidelines
  • I have added tests that prove my fix is effective or that my feature works per HashiCorp requirments
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code

PacoDw added 2 commits June 15, 2020 14:08
change GetOk to GetOkExists to ensure the bool value
@ghost ghost added the size/M label Jun 15, 2020
Copy link
Contributor

@coderGo93 coderGo93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but could you restart job of travis or fix the errors if persists.

Copy link
Collaborator

@themantissa themantissa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - let's see if the reporter can test the branch before we merge. Also same comment as Edgar on travis. Thanks!

@PacoDw
Copy link
Contributor Author

PacoDw commented Jun 18, 2020

I will merge it even with the Travis error because that error is referring to use the.GetOkExist()` function part of Terraform so we need this function, Travis has a wrong lint that causes it.

@PacoDw PacoDw merged commit 07991aa into master Jun 18, 2020
@PacoDw PacoDw deleted the fix-#243 branch June 18, 2020 16:39
@WafflesMcDuff
Copy link

WafflesMcDuff commented Jun 29, 2020

We're still seeing this issue in 0.6.1

mongodbatlas_cluster.main: Modifying... [id=Y2x1c3Rlcl9pZA==:NWUyYTFhYjNmMmEzMGI1NjZhZTAyYzUz-cHJvamVjdF9pZA==:NWUyMGUyNjljNTZjOTgyM2VhNzRiOTAx-Y2x1c3Rlcl9uYW1l:dGVzdC0yMDYwMzAtY2FsbC1tZXRob2Qtc3Zj]

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



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


panic: runtime error: invalid memory address or nil pointer dereference
2020-06-29T17:42:00.384Z [DEBUG] plugin.terraform-provider-mongodbatlas_v0.6.1_x4: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xe0ca94]
2020-06-29T17:42:00.384Z [DEBUG] plugin.terraform-provider-mongodbatlas_v0.6.1_x4: 
2020-06-29T17:42:00.384Z [DEBUG] plugin.terraform-provider-mongodbatlas_v0.6.1_x4: goroutine 42 [running]:
2020-06-29T17:42:00.384Z [DEBUG] plugin.terraform-provider-mongodbatlas_v0.6.1_x4: github.com/terraform-providers/terraform-provider-mongodbatlas/mongodbatlas.resourceMongoDBAtlasClusterUpdate(0xc0001c21c0, 0xfbd740, 0xc0001b7400, 0x24, 0x1afc460)
2020-06-29T17:42:00.384Z [DEBUG] plugin.terraform-provider-mongodbatlas_v0.6.1_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-mongodbatlas/mongodbatlas/resource_mongodbatlas_cluster.go:791 +0x1c64
2020-06-29T17:42:00.384Z [DEBUG] plugin.terraform-provider-mongodbatlas_v0.6.1_x4: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).Apply(0xc000113950, 0xc00043e5f0, 0xc00023a780, 0xfbd740, 0xc0001b7400, 0xf4bc01, 0xc0006758a0, 0xc0001119b0)
2020-06-29T17:42:00.384Z [DEBUG] plugin.terraform-provider-mongodbatlas_v0.6.1_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-mongodbatlas/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/resource.go:316 +0x263
2020-06-29T17:42:00.384Z [DEBUG] plugin.terraform-provider-mongodbatlas_v0.6.1_x4: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Provider).Apply(0xc000102080, 0xc000675a20, 0xc00043e5f0, 0xc00023a780, 0xc00010ace8, 0xc00000e530, 0xf4d960)
2020-06-29T17:42:00.384Z [DEBUG] plugin.terraform-provider-mongodbatlas_v0.6.1_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-mongodbatlas/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/provider.go:294 +0x99
2020-06-29T17:42:00.385Z [DEBUG] plugin.terraform-provider-mongodbatlas_v0.6.1_x4: github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).ApplyResourceChange(0xc00009e868, 0x135b640, 0xc0003e0fc0, 0xc000248000, 0xc00009e868, 0xc0003e0fc0, 0xc000544b88)
2020-06-29T17:42:00.385Z [DEBUG] plugin.terraform-provider-mongodbatlas_v0.6.1_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-mongodbatlas/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin/grpc_provider.go:885 +0x8b4
2020-06-29T17:42:00.385Z [DEBUG] plugin.terraform-provider-mongodbatlas_v0.6.1_x4: github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x1068e00, 0xc00009e868, 0x135b640, 0xc0003e0fc0, 0xc0000a0f00, 0x0, 0x135b640, 0xc0003e0fc0, 0xc000662000, 0x1d7d)
2020-06-29T17:42:00.385Z [DEBUG] plugin.terraform-provider-mongodbatlas_v0.6.1_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-mongodbatlas/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5/tfplugin5.pb.go:3305 +0x217
2020-06-29T17:42:00.385Z [DEBUG] plugin.terraform-provider-mongodbatlas_v0.6.1_x4: google.golang.org/grpc.(*Server).processUnaryRPC(0xc0000a6000, 0x1366ae0, 0xc000001b00, 0xc0000f8600, 0xc000146c60, 0x1ac1ee0, 0x0, 0x0, 0x0)
2020-06-29T17:42:00.385Z [DEBUG] plugin.terraform-provider-mongodbatlas_v0.6.1_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-mongodbatlas/vendor/google.golang.org/grpc/server.go:1082 +0x50a
2020-06-29T17:42:00.385Z [DEBUG] plugin.terraform-provider-mongodbatlas_v0.6.1_x4: google.golang.org/grpc.(*Server).handleStream(0xc0000a6000, 0x1366ae0, 0xc000001b00, 0xc0000f8600, 0x0)
2020-06-29T17:42:00.385Z [DEBUG] plugin.terraform-provider-mongodbatlas_v0.6.1_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-mongodbatlas/vendor/google.golang.org/grpc/server.go:1405 +0xcc9
2020-06-29T17:42:00.385Z [DEBUG] plugin.terraform-provider-mongodbatlas_v0.6.1_x4: google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc000036220, 0xc0000a6000, 0x1366ae0, 0xc000001b00, 0xc0000f8600)
2020-06-29T17:42:00.385Z [DEBUG] plugin.terraform-provider-mongodbatlas_v0.6.1_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-mongodbatlas/vendor/google.golang.org/grpc/server.go:746 +0xa1
2020-06-29T17:42:00.385Z [DEBUG] plugin.terraform-provider-mongodbatlas_v0.6.1_x4: created by google.golang.org/grpc.(*Server).serveStreams.func1
2020-06-29T17:42:00.385Z [DEBUG] plugin.terraform-provider-mongodbatlas_v0.6.1_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-mongodbatlas/vendor/google.golang.org/grpc/server.go:744 +0xa1
2020-06-29T17:42:00.386Z [DEBUG] plugin: plugin process exited: path=/build/562782570169/global/test/mongodbatlas-cluster/.terragrunt-cache/Z69C3qz8i-NffRkNNdKvxOqfLes/jXFi4kSNbAoWvcOELYluHMN31w8/modules/mongodbatlas-cluster/.terraform/plugins/linux_amd64/terraform-provider-mongodbatlas_v0.6.1_x4 pid=285 error="exit status 2"
2020/06/29 17:42:00 [DEBUG] mongodbatlas_database_user.admin: apply errored, but we're indicating that via the Error pointer rather than returning it: rpc error: code = Unavailable desc = transport is closing
2020/06/29 17:42:00 [TRACE] <root>: eval: *terraform.EvalMaybeTainted
2020/06/29 17:42:00 [TRACE] <root>: eval: *terraform.EvalWriteState
2020/06/29 17:42:00 [TRACE] EvalWriteState: recording 0 dependencies for mongodbatlas_database_user.admin
2020/06/29 17:42:00 [TRACE] EvalWriteState: writing current state object for mongodbatlas_database_user.admin
2020/06/29 17:42:00 [TRACE] <root>: eval: *terraform.EvalApplyProvisioners
2020/06/29 17:42:00 [TRACE] EvalApplyProvisioners: mongodbatlas_database_user.admin is not freshly-created, so no provisioning is required
2020/06/29 17:42:00 [TRACE] <root>: eval: *terraform.EvalMaybeTainted
2020/06/29 17:42:00 [TRACE] <root>: eval: *terraform.EvalWriteState
2020/06/29 17:42:00 [TRACE] EvalWriteState: recording 0 dependencies for mongodbatlas_database_user.admin
2020/06/29 17:42:00 [TRACE] EvalWriteState: writing current state object for mongodbatlas_database_user.admin
2020/06/29 17:42:00 [TRACE] <root>: eval: *terraform.EvalIf
2020/06/29 17:42:00 [DEBUG] mongodbatlas_cluster.main: apply errored, but we're indicating that via the Error pointer rather than returning it: rpc error: code = Unavailable desc = transport is closing
2020/06/29 17:42:00 [TRACE] <root>: eval: *terraform.EvalMaybeTainted
2020/06/29 17:42:00 [TRACE] <root>: eval: *terraform.EvalWriteState
2020/06/29 17:42:00 [TRACE] EvalWriteState: recording 0 dependencies for mongodbatlas_cluster.main
2020/06/29 17:42:00 [TRACE] EvalWriteState: writing current state object for mongodbatlas_cluster.main
2020/06/29 17:42:00 [TRACE] <root>: eval: *terraform.EvalIf
2020/06/29 17:42:00 [TRACE] <root>: eval: *terraform.EvalWriteDiff
2020/06/29 17:42:00 [TRACE] <root>: eval: *terraform.EvalApplyPost
2020/06/29 17:42:00 [ERROR] <root>: eval: *terraform.EvalApplyPost, err: rpc error: code = Unavailable desc = transport is closing
2020/06/29 17:42:00 [ERROR] <root>: eval: *terraform.EvalSequence, err: rpc error: code = Unavailable desc = transport is closing
2020/06/29 17:42:00 [TRACE] [walkApply] Exiting eval tree: mongodbatlas_database_user.admin
2020/06/29 17:42:00 [TRACE] vertex "mongodbatlas_database_user.admin": visit complete
2020/06/29 17:42:00 [TRACE] <root>: eval: *terraform.EvalApplyProvisioners
2020/06/29 17:42:00 [TRACE] EvalApplyProvisioners: mongodbatlas_cluster.main is not freshly-created, so no provisioning is required
2020/06/29 17:42:00 [TRACE] <root>: eval: *terraform.EvalMaybeTainted
2020/06/29 17:42:00 [TRACE] <root>: eval: *terraform.EvalWriteState
2020/06/29 17:42:00 [TRACE] EvalWriteState: recording 0 dependencies for mongodbatlas_cluster.main
2020/06/29 17:42:00 [TRACE] EvalWriteState: writing current state object for mongodbatlas_cluster.main
2020/06/29 17:42:00 [TRACE] <root>: eval: *terraform.EvalIf
2020/06/29 17:42:00 [TRACE] <root>: eval: *terraform.EvalIf
2020/06/29 17:42:00 [TRACE] <root>: eval: *terraform.EvalWriteDiff
2020/06/29 17:42:00 [TRACE] <root>: eval: *terraform.EvalApplyPost
2020/06/29 17:42:00 [ERROR] <root>: eval: *terraform.EvalApplyPost, err: rpc error: code = Unavailable desc = transport is closing
2020/06/29 17:42:00 [ERROR] <root>: eval: *terraform.EvalSequence, err: rpc error: code = Unavailable desc = transport is closing
2020/06/29 17:42:00 [TRACE] [walkApply] Exiting eval tree: mongodbatlas_cluster.main
2020/06/29 17:42:00 [TRACE] vertex "mongodbatlas_cluster.main": visit complete
2020/06/29 17:42:00 [TRACE] dag/walk: upstream of "output.mongo_uri_with_options" errored, so skipping
2020/06/29 17:42:00 [TRACE] dag/walk: upstream of "output.mongo_db_version" errored, so skipping
2020/06/29 17:42:00 [TRACE] dag/walk: upstream of "provider.mongodbatlas (close)" errored, so skipping
2020/06/29 17:42:00 [TRACE] dag/walk: upstream of "output.mongo_uri_updated" errored, so skipping
2020/06/29 17:42:00 [TRACE] dag/walk: upstream of "output.cluster_id" errored, so skipping
2020/06/29 17:42:00 [TRACE] dag/walk: upstream of "output.state_name" errored, so skipping
2020/06/29 17:42:00 [TRACE] dag/walk: upstream of "output.mongo_uri" errored, so skipping
2020/06/29 17:42:00 [TRACE] dag/walk: upstream of "output.srv_address" errored, so skipping
2020/06/29 17:42:00 [TRACE] dag/walk: upstream of "output.paused" errored, so skipping
2020/06/29 17:42:00 [TRACE] dag/walk: upstream of "meta.count-boundary (EachMode fixup)" errored, so skipping
2020/06/29 17:42:00 [TRACE] dag/walk: upstream of "root" errored, so skipping
2020/06/29 17:42:00 [DEBUG] POST https://hal.zone/api/integrations/terraform/3270/state/562782570169.global.test.mongodbatlas-cluster?ID=57ce6e81-0867-0ef5-b37f-f00279d07549
2020/06/29 17:42:00 [DEBUG] UNLOCK https://hal.zone/api/integrations/terraform/3270/state/562782570169.global.test.mongodbatlas-cluster
2020-06-29T17:42:00.567Z [DEBUG] plugin: plugin exited



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

Terraform crashed! This is always indicative of a bug within Terraform.
A crash log has been placed at "crash.log" relative to your current
working directory. It would be immensely helpful if you could please
report the crash with Terraform[1] so that we can fix this.

When reporting bugs, please include your terraform version. That
information is available on the first line of crash.log. You can also
get it by running 'terraform --version' on the command line.

SECURITY WARNING: the "crash.log" file that was created may contain 
sensitive information that must be redacted before it is safe to share 
on the issue tracker.

[1]: https://github.com/hashicorp/terraform/issues

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!
[terragrunt] 2020/06/29 17:42:00 Detected 1 Hooks
[terragrunt] 2020/06/29 17:42:00 Hit multiple errors:

@themantissa
Copy link
Collaborator

@PacoDw fyi. @WafflesMcDuff can we get more details via an issue to aid in quickly tracing if this is the same issue? tf config, DEBUG logs, etc?

@WafflesMcDuff
Copy link

@PacoDw fyi. @WafflesMcDuff can we get more details via an issue to aid in quickly tracing if this is the same issue? tf config, DEBUG logs, etc?

@themantissa - I have posted my logs in #243 lmk if you need more info

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

Successfully merging this pull request may close these issues.

4 participants