timohirt / terraform-provider-hetznerdns

Terraform provider for Hetzner DNS
Mozilla Public License 2.0
106 stars 21 forks source link

changing an existing resource results in a crash #16

Closed c33s closed 4 years ago

c33s commented 4 years ago
resource "hetznerdns_zone" "example_at" {
    name = "example.at"
    ttl = 3600
}

data "hetznerdns_zone" "example_at" {
    name = "example_at"
}

resource "hetznerdns_record" "mx1_example_at" {
    zone_id = "${hetznerdns_zone.example_at.id}"
    name = "www"
    value = "example.at."
    type = "CNAME"
    ttl= 3600
}
hetznerdns_zone.example_at: Refreshing state... (ID: Fm3kcKJT8ZWDiVy3458xD4)
data.hetznerdns_zone.example_at: Refreshing state...
hetznerdns_record.example_at: Refreshing state... (ID: 1f58249e1e293868678d40e0d40f97d7)

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:

  ~ hetznerdns_record.example_at
      name: "@" => "www"

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

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

  Enter a value: yes

hetznerdns_record.example_at: Modifying... (ID: 1f58249e1e293868678d40e0d40f97d7)
  name: "@" => "www"

Error: Error applying plan:

1 error occurred:
        * hetznerdns_record.example_at: 1 error occurred:
        * hetznerdns_record.example_at: 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: interface conversion: interface {} is int, not *int
2020-09-07T10:37:08.045+0200 [DEBUG] plugin.terraform-provider-hetznerdns_v1.1.0.exe:
2020-09-07T10:37:08.045+0200 [DEBUG] plugin.terraform-provider-hetznerdns_v1.1.0.exe: goroutine 107 [running]:
2020-09-07T10:37:08.045+0200 [DEBUG] plugin.terraform-provider-hetznerdns_v1.1.0.exe: github.com/timohirt/terraform-provider-hetznerdns/hetznerdns.resourceRecordUpdate(0xc0003a45b0, 0xf444e0, 0xc000209020, 0x24, 0x18dbb40)
2020-09-07T10:37:08.045+0200 [DEBUG] plugin.terraform-provider-hetznerdns_v1.1.0.exe:   /home/runner/work/terraform-provider-hetznerdns/terraform-provider-hetznerdns/hetznerdns/resource_record.go:147 +0x74b
2020-09-07T10:37:08.045+0200 [DEBUG] plugin.terraform-provider-hetznerdns_v1.1.0.exe: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).Apply(0xc000458e10, 0xc00025d220, 0xc000666ac0, 0xf444e0, 0xc000209020, 0xc00060ba01, 0xc00026dbd0, 0x40cb20)
2020-09-07T10:37:08.045+0200 [DEBUG] plugin.terraform-provider-hetznerdns_v1.1.0.exe:   /home/runner/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.12.0/helper/schema/resource.go:316 +0x26a
2020-09-07T10:37:08.045+0200 [DEBUG] plugin.terraform-provider-hetznerdns_v1.1.0.exe: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Provider).Apply(0xc000096f00, 0xc000669080, 0xc00025d220, 0xc000666ac0, 0xc000665020, 0xc0006643c0, 0x18)
2020-09-07T10:37:08.045+0200 [DEBUG] plugin.terraform-provider-hetznerdns_v1.1.0.exe:   /home/runner/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.12.0/helper/schema/provider.go:294 +0xa0
2020-09-07T10:37:08.045+0200 [DEBUG] plugin.terraform-provider-hetznerdns_v1.1.0.exe: github.com/hashicorp/terraform-plugin-sdk/plugin.(*ResourceProviderServer).Apply(0xc0002089a0, 0xc0006666a0, 0xc0006703b0, 0x0, 0x0)
2020-09-07T10:37:08.045+0200 [DEBUG] plugin.terraform-provider-hetznerdns_v1.1.0.exe:   /home/runner/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.12.0/plugin/resource_provider.go:530 +0x5e
2020-09-07T10:37:08.045+0200 [DEBUG] plugin.terraform-provider-hetznerdns_v1.1.0.exe: reflect.Value.call(0xc000086240, 0xc000006c48, 0x13, 0xf8917f, 0x4, 0xc00026df08, 0x3, 0x3, 0xc00026df34, 0x497ca5faa80, ...)
2020-09-07T10:37:08.045+0200 [DEBUG] plugin.terraform-provider-hetznerdns_v1.1.0.exe:   /opt/hostedtoolcache/go/1.14.7/x64/src/reflect/value.go:460 +0x8b2
2020-09-07T10:37:08.045+0200 [DEBUG] plugin.terraform-provider-hetznerdns_v1.1.0.exe: reflect.Value.Call(0xc000086240, 0xc000006c48, 0x13, 0xc00026df08, 0x3, 0x3, 0x497ca5faa80, 0xc00078c000, 0xc00078c000)
2020-09-07T10:37:08.045+0200 [DEBUG] plugin.terraform-provider-hetznerdns_v1.1.0.exe:   /opt/hostedtoolcache/go/1.14.7/x64/src/reflect/value.go:321 +0xbb
2020-09-07T10:37:08.045+0200 [DEBUG] plugin.terraform-provider-hetznerdns_v1.1.0.exe: net/rpc.(*service).call(0xc00027e740, 0xc000076960, 0xc00008a8c0, 0xc00008a8d0, 0xc000096f80, 0xc000208ee0, 0xdb8220, 0xc0006666a0, 0x16, 0xdb8260, ...)

2020-09-07T10:37:08.045+0200 [DEBUG] plugin.terraform-provider-hetznerdns_v1.1.0.exe:   /opt/hostedtoolcache/go/1.14.7/x64/src/net/rpc/server.go:377 +0x186
2020-09-07T10:37:08.045+0200 [DEBUG] plugin.terraform-provider-hetznerdns_v1.1.0.exe: created by net/rpc.(*Server).ServeCodec
2020-09-07T10:37:08.045+0200 [DEBUG] plugin.terraform-provider-hetznerdns_v1.1.0.exe:   /opt/hostedtoolcache/go/1.14.7/x64/src/net/rpc/server.go:474 +0x432
2020/09/07 10:37:08 [TRACE] root: eval: *terraform.EvalWriteState
2020/09/07 10:37:08 [TRACE] root: eval: *terraform.EvalApplyProvisioners
2020/09/07 10:37:08 [TRACE] root: eval: *terraform.EvalIf
2020/09/07 10:37:08 [TRACE] root: eval: *terraform.EvalWriteState
2020/09/07 10:37:08 [TRACE] root: eval: *terraform.EvalWriteDiff
2020/09/07 10:37:08 [TRACE] root: eval: *terraform.EvalApplyPost
2020/09/07 10:37:08 [ERROR] root: eval: *terraform.EvalApplyPost, err: 1 error occurred:
        * hetznerdns_record.example_at: unexpected EOF

2020/09/07 10:37:08 [ERROR] root: eval: *terraform.EvalSequence, err: 1 error occurred:
        * hetznerdns_record.example_at: unexpected EOF

2020/09/07 10:37:08 [TRACE] [walkApply] Exiting eval tree: hetznerdns_record.example_at
2020/09/07 10:37:08 [TRACE] dag/walk: upstream errored, not walking "provider.hetznerdns (close)"
2020/09/07 10:37:08 [TRACE] dag/walk: upstream errored, not walking "meta.count-boundary (count boundary fixup)"
2020/09/07 10:37:08 [TRACE] dag/walk: upstream errored, not walking "root"
2020/09/07 10:37:08 [TRACE] Preserving existing state lineage "0a04f514-e78a-bfa4-d095-760033b00edb"
2020/09/07 10:37:08 [TRACE] Preserving existing state lineage "0a04f514-e78a-bfa4-d095-760033b00edb"
2020/09/07 10:37:08 [TRACE] Preserving existing state lineage "0a04f514-e78a-bfa4-d095-760033b00edb"
2020/09/07 10:37:08 [TRACE] Preserving existing state lineage "0a04f514-e78a-bfa4-d095-760033b00edb"
2020/09/07 10:37:08 [DEBUG] plugin: waiting for all plugin processes to complete...
2020-09-07T10:37:08.054+0200 [WARN ] plugin: error closing client during Kill: err="connection is shut down"
timohirt commented 4 years ago

This bug is already fixed: https://github.com/timohirt/terraform-provider-hetznerdns/commit/31efb57fcae360f3c37dfbc6c84b853e964e85e4

I'll add the fix to the next release.

timohirt commented 4 years ago

https://github.com/timohirt/terraform-provider-hetznerdns/releases/tag/v1.1.1