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.42k stars 9.5k forks source link

spotinst_elastigroup_aws resource fails when change any value #20107

Closed caiounderscore closed 5 years ago

caiounderscore commented 5 years ago

Terraform Version

Terraform v0.11.11

Affected Resource(s)

spotinst_elastigroup_aws

Terraform Configuration Files

"provider" "spotinst" {
  "token" = "$[var.token]"
  "account" = "$[var.account]"
}

resource "spotinst_elastigroup_aws" "default-elastigroup" {
  name        = "default-elastigroup"
  description = "created by Terraform"
  product     = "Linux/UNIX"

  "desired_capacity" = 2

  "min_size" = 2

  "max_size" = 4

  "capacity_unit" = "instance"

  region     = "us-east-1"
  subnet_ids = ["$[var.subnets]"]

  image_id = "${var.ami]"

  #   iam_instance_profile = "iam-profile"
  key_name          = "${var.key]"
  security_groups   = "[${var.sg]"
  user_data         = "echo hello world"
  enable_monitoring = false
  ebs_optimized     = false
  placement_tenancy = "default"

  instance_types_ondemand = "t3.small"

  instance_types_spot = ["t2.small", "t3.small"]

  instance_types_preferred_spot = ["t3.small"]

  orientation          = "balanced"
  fallback_to_ondemand = false
  cpu_credits          = "unlimited"

  wait_for_capacity         = 2
  wait_for_capacity_timeout = 900

Debug Output

spotinst_elastigroup_aws.default-elastigroup: Refreshing state... (ID: sig-983162cc)

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  ~ spotinst_elastigroup_aws.default-elastigroup
      instance_types_ondemand: "t3.micro" => "t3.small"

Plan: 0 to add, 1 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

spotinst_elastigroup_aws.default-elastigroup: Modifying... (ID: sig-983162cc)
  instance_types_ondemand: "t3.micro" => "t3.small"

Error: Error applying plan:

1 error(s) occurred:

* spotinst_elastigroup_aws.default-elastigroup: 1 error(s) occurred:

* spotinst_elastigroup_aws.default-elastigroup: unexpected EOF

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.

panic: runtime error: invalid memory address or nil pointer dereference
2019-01-24T17:17:43.282-0200 [DEBUG] plugin.terraform-provider-spotinst_v1.6.0_x4: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xbca76e]
2019-01-24T17:17:43.282-0200 [DEBUG] plugin.terraform-provider-spotinst_v1.6.0_x4:
2019-01-24T17:17:43.282-0200 [DEBUG] plugin.terraform-provider-spotinst_v1.6.0_x4: goroutine 106 [running]:
2019-01-24T17:17:43.282-0200 [DEBUG] plugin.terraform-provider-spotinst_v1.6.0_x4: github.com/terraform-providers/terraform-provider-spotinst/spotinst.updateGroup(0xc0002d8000, 0xc0001e4230, 0xc3d840, 0xc0003ec3c0, 0x1, 0xc0002d8000)
2019-01-24T17:17:43.282-0200 [DEBUG] plugin.terraform-provider-spotinst_v1.6.0_x4:      /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-spotinst/spotinst/resource_spotinst_elastigroup_aws.go:306 +0x69e
2019-01-24T17:17:43.282-0200 [DEBUG] plugin.terraform-provider-spotinst_v1.6.0_x4: github.com/terraform-providers/terraform-provider-spotinst/spotinst.resourceSpotinstElastigroupAwsUpdate(0xc0001e4230, 0xc3d840, 0xc0003ec3c0, 0x24, 0x15f5860)
2019-01-24T17:17:43.282-0200 [DEBUG] plugin.terraform-provider-spotinst_v1.6.0_x4:      /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-spotinst/spotinst/resource_spotinst_elastigroup_aws.go:254 +0x306
2019-01-24T17:17:43.282-0200 [DEBUG] plugin.terraform-provider-spotinst_v1.6.0_x4: github.com/terraform-providers/terraform-provider-spotinst/vendor/github.com/hashicorp/terraform/helper/schema.(*Resource).Apply(0xc0006bee40, 0xc00050e050, 0xc0000bc480, 0xc3d840, 0xc0003ec3c0, 0x40b801, 0xc000458b80, 0x4c046c)
2019-01-24T17:17:43.282-0200 [DEBUG] plugin.terraform-provider-spotinst_v1.6.0_x4:      /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-spotinst/vendor/github.com/hashicorp/terraform/helper/schema/resource.go:199 +0x257
2019-01-24T17:17:43.282-0200 [DEBUG] plugin.terraform-provider-spotinst_v1.6.0_x4: github.com/terraform-providers/terraform-provider-spotinst/vendor/github.com/hashicorp/terraform/helper/schema.(*Provider).Apply(0xc000330770, 0xc00050e000, 0xc00050e050, 0xc0000bc480, 0xc000368e00, 0x18, 0x7f6c5c8996c0)
2019-01-24T17:17:43.282-0200 [DEBUG] plugin.terraform-provider-spotinst_v1.6.0_x4:      /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-spotinst/vendor/github.com/hashicorp/terraform/helper/schema/provider.go:259 +0x9c
2019-01-24T17:17:43.283-0200 [DEBUG] plugin.terraform-provider-spotinst_v1.6.0_x4: github.com/terraform-providers/terraform-provider-spotinst/vendor/github.com/hashicorp/terraform/plugin.(*ResourceProviderServer).Apply(0xc0003c0160, 0xc0000bc020, 0xc000490370, 0x0, 0x0)
2019-01-24T17:17:43.283-0200 [DEBUG] plugin.terraform-provider-spotinst_v1.6.0_x4:      /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-spotinst/vendor/github.com/hashicorp/terraform/plugin/resource_provider.go:488 +0x57
2019-01-24T17:17:43.283-0200 [DEBUG] plugin.terraform-provider-spotinst_v1.6.0_x4: reflect.Value.call(0xc000076720, 0xc000300000, 0x13, 0xde9674, 0x4, 0xc000458f18, 0x3, 0x3, 0xc000191740, 0x4131b7, ...)
2019-01-24T17:17:43.283-0200 [DEBUG] plugin.terraform-provider-spotinst_v1.6.0_x4:      /opt/goenv/versions/1.11.4/src/reflect/value.go:447 +0x454
2019-01-24T17:17:43.283-0200 [DEBUG] plugin.terraform-provider-spotinst_v1.6.0_x4: reflect.Value.Call(0xc000076720, 0xc000300000, 0x13, 0xc0002d0f18, 0x3, 0x3, 0x12a05f200, 0xc0002d0f10, 0xc0002d0fb8)
2019-01-24T17:17:43.283-0200 [DEBUG] plugin.terraform-provider-spotinst_v1.6.0_x4:      /opt/goenv/versions/1.11.4/src/reflect/value.go:308 +0xa4
2019-01-24T17:17:43.283-0200 [DEBUG] plugin.terraform-provider-spotinst_v1.6.0_x4: net/rpc.(*service).call(0xc0003ea000, 0xc0005f21e0, 0xc00057a050, 0xc00057a060, 0xc0002d8880, 0xc00057c5a0, 0xc40980, 0xc0000bc020, 0x16, 0xc409c0, ...)
2019-01-24T17:17:43.283-0200 [DEBUG] plugin.terraform-provider-spotinst_v1.6.0_x4:      /opt/goenv/versions/1.11.4/src/net/rpc/server.go:384 +0x14e
2019-01-24T17:17:43.283-0200 [DEBUG] plugin.terraform-provider-spotinst_v1.6.0_x4: created by net/rpc.(*Server).ServeCodec
2019-01-24T17:17:43.283-0200 [DEBUG] plugin.terraform-provider-spotinst_v1.6.0_x4:      /opt/goenv/versions/1.11.4/src/net/rpc/server.go:481 +0x47e
2019-01-24T17:17:43.285-0200 [DEBUG] plugin: plugin process exited: path=/home/caio/projects/spotinst-elastigroup-module/.terraform/plugins/linux_amd64/terraform-provider-spotinst_v1.6.0_x4
2019/01/24 17:17:43 [TRACE] root: eval: *terraform.EvalWriteState
2019/01/24 17:17:43 [TRACE] root: eval: *terraform.EvalApplyProvisioners
2019/01/24 17:17:43 [TRACE] root: eval: *terraform.EvalIf
2019/01/24 17:17:43 [TRACE] root: eval: *terraform.EvalWriteState
2019/01/24 17:17:43 [TRACE] root: eval: *terraform.EvalWriteDiff
2019/01/24 17:17:43 [TRACE] root: eval: *terraform.EvalApplyPost
2019/01/24 17:17:43 [ERROR] root: eval: *terraform.EvalApplyPost, err: 1 error(s) occurred:

* spotinst_elastigroup_aws.default-elastigroup: unexpected EOF
2019/01/24 17:17:43 [ERROR] root: eval: *terraform.EvalSequence, err: 1 error(s) occurred:

* spotinst_elastigroup_aws.default-elastigroup: unexpected EOF
2019/01/24 17:17:43 [TRACE] [walkApply] Exiting eval tree: spotinst_elastigroup_aws.default-elastigroup
2019/01/24 17:17:43 [TRACE] dag/walk: upstream errored, not walking "provider.spotinst (close)"
2019/01/24 17:17:43 [TRACE] dag/walk: upstream errored, not walking "meta.count-boundary (count boundary fixup)"
2019/01/24 17:17:43 [TRACE] dag/walk: upstream errored, not walking "root"
2019/01/24 17:17:43 [TRACE] Preserving existing state lineage "5d9f79d6-de40-6585-03da-7e273f4eb8dc"
2019/01/24 17:17:43 [TRACE] Preserving existing state lineage "5d9f79d6-de40-6585-03da-7e273f4eb8dc"
2019/01/24 17:17:43 [TRACE] Preserving existing state lineage "5d9f79d6-de40-6585-03da-7e273f4eb8dc"
2019/01/24 17:17:43 [TRACE] Preserving existing state lineage "5d9f79d6-de40-6585-03da-7e273f4eb8dc"
2019/01/24 17:17:43 [DEBUG] plugin: waiting for all plugin processes to complete...
2019-01-24T17:17:43.303-0200 [WARN ] plugin: error closing client during Kill: err="connection is shut down"

!!!!!!!!!!!!!!!!!!!!!!!!!!! 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.

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

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!-->

Expected Behavior

Create elastigroup and update new changes.

Actual Behavior

Creates elastigroup normally but, when i run terraform apply any change in resource, terraform will crash

Steps to Reproduce

Please list the full steps required to reproduce the issue, for example:

  1. terraform init
  2. terraform apply
  3. change any value
  4. terraform apply
ghost commented 5 years ago

This issue has been automatically migrated to terraform-providers/terraform-provider-spotinst#29 because it looks like an issue with that provider. If you believe this is not an issue with the provider, please reply to terraform-providers/terraform-provider-spotinst#29.

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.