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

Terraform refresh is not getting remote state ? #113

Closed
VAdamec opened this issue May 19, 2017 · 15 comments
Closed

Terraform refresh is not getting remote state ? #113

VAdamec opened this issue May 19, 2017 · 15 comments
Assignees
Labels

Comments

@VAdamec
Copy link

VAdamec commented May 19, 2017

Description of the bug:

I'm creating full VCP stack and some test instances. If I remove VM instance via API/UI terraform doesn't catch this (other items like IPSec works).

terraform apply

baremetal_core_instance.TFInstance3: Refreshing state... (ID: ocid1.instance.oc1.phx.abyhqljsgqgxzl6o...3tu326kvuatk5bwbzsmhoeiodlazkmph2fc4gq)
No changes. Infrastructure is up-to-date.

this OCID is terminated instance.

@VAdamec
Copy link
Author

VAdamec commented May 22, 2017

Hm, when I try it now (instance is not exists in BMC) I got even strange error:

baremetal_core_instance.TFInstance3: Refreshing state... (ID: ocid1.instance.oc1.phx.abyhqljsgqgxzl6o...3tu326kvuatk5bwbzsmhoeiodlazkmph2fc4gq)
Error refreshing state: 1 error(s) occurred:
* baremetal_core_instance.TFInstance3: baremetal_core_instance.TFInstance3: Code: NotAuthorizedOrNotFound; OPC Request ID: /1500F1C3881B425AA8F725A7E380588C/4A01A7E3A9D04211A3FF3380671ACE07; Message: instance ocid1.instance.oc1.phx.abyhqljsgqgxzl6ovyvkus3tu326kvuatk5bwbzsmhoeiodlazkmph2fc4gq not found

removing given resource from state file and run it again is now only option.

@VAdamec
Copy link
Author

VAdamec commented May 22, 2017

In tftstate after refresh you can see this:

baremetal_core_instance ....
                            "state": "TERMINATED",
...

so it simple accept terminated as ok state. Validation of state (RUNNING) missing ?

@mikejihbe
Copy link
Contributor

I'll pick this up.

@craigcarl-oracle
Copy link
Contributor

@mikejihbe is working this, fix may not come in this week.

@josephholsten
Copy link
Contributor

I'm working on making repro steps into an acceptance test now.

@josephholsten
Copy link
Contributor

I've got a reproduction for this issue, but that also uncovered a similar problem with certain subnet edge cases. PR for that (#151) is up, working on the fixes for this now.

@josephholsten
Copy link
Contributor

ok, fixes are in #159. I'd love you to verify that it resolves your issue, I'll let you know when it's in the latest release. Or I can help you build from source if you're eager!

@VAdamec
Copy link
Author

VAdamec commented Jun 30, 2017

My test procedure (let me know if it's not ok). Terminated instance state seems to be correctly detected, but I was forced to also need to add 'dhcp_options_id' to all my subnets definition (now mandatory parameter) which quite complicate my testing (need full reprovision of some instances and subnets).

Compilation

# golang 1.8.3
mkdir /workspace/gopath
export GOPATH="/workspace/gopath"

git clone https://github.com/hashicorp/terraform $GOPATH/src/github.com/hashicorp/terraform

git clone https://github.com/oracle/terraform-provider-baremetal $GOPATH/src/github.com/oracle/terraform-provider-baremetal

cd $GOPATH/src/github.com/oracle/terraform-provider-baremetal
git fetch origin pull/159/head:acc-test-instance
git checkout acc-test-instance

make
cp terraform-provider-baremetal /usr/local/bin/terraform-provider-baremetal

Terraform test, kill one instance via OBMC UI

export TF_LOG=DEBUG

terraform refresh

# terminated server was not save in tfstate in Consul
terraform plan
...
+ module.hosts.baremetal_core_instance.hosts.2
...

# so far so good

Let you know when I made full reprovision ;-)

@VAdamec
Copy link
Author

VAdamec commented Jun 30, 2017

Well seems that it looping/wait for output from module on removed instance, than crashed (without change of state, means terraform still think that instance is running).

1. stable state

terraform refresh
terraform plan
  • no changes

2. Remove one instance (mysql) via BMCS UI

terraform refresh

2017/06/30 07:28:54 [DEBUG] dag/walk: vertex "root", waiting for: "module.mysql.baremetal_core_instance.mysql[0]"
2017/06/30 07:28:54 [DEBUG] dag/walk: vertex "output.MYSQLprivateIP", waiting for: "module.mysql.output.MYSQLprivateIP"
2017/06/30 07:28:54 [DEBUG] dag/walk: vertex "module.mysql.output.MYSQLprivateIP", waiting for: "module.mysql.baremetal_core_instance.mysql"
2017/06/30 07:28:55 [DEBUG] dag/walk: vertex "root", waiting for: "output.MYSQLprivateIP"
2017/06/30 07:28:56 [DEBUG] dag/walk: vertex "provider.baremetal (close)", waiting for: "module.mysql.baremetal_core_instance.mysql"
2017/06/30 07:28:59 [DEBUG] dag/walk: vertex "root", waiting for: "module.mysql.baremetal_core_instance.mysql[0]"
2017/06/30 07:28:59 [DEBUG] dag/walk: vertex "output.MYSQLprivateIP", waiting for: "module.mysql.output.MYSQLprivateIP"
2017/06/30 07:28:59 [DEBUG] dag/walk: vertex "module.mysql.output.MYSQLprivateIP", waiting for: "module.mysql.baremetal_core_instance.mysql"
2017/06/30 07:29:00 [DEBUG] dag/walk: vertex "root", waiting for: "output.MYSQLprivateIP"
2017/06/30 07:29:01 [DEBUG] dag/walk: vertex "provider.baremetal (close)", waiting for: "module.mysql.baremetal_core_instance.mysql"
2017/06/30 07:29:02 [DEBUG] plugin: terraform-provider-baremetal: 2017/06/30 07:29:02 [DEBUG] no vnic yet, skipping
2017/06/30 07:29:02 [DEBUG] plugin: terraform-provider-baremetal: Releasing state lock. This may take a few moments...
panic: runtime error: invalid memory address or nil pointer dereference
2017/06/30 07:29:02 [DEBUG] plugin: terraform-provider-baremetal: [signal SIGSEGV: segmentation violation code=0x1 addr=0x98 pc=0x9da516]
2017/06/30 07:29:02 [DEBUG] plugin: terraform-provider-baremetal:
2017/06/30 07:29:02 [DEBUG] plugin: terraform-provider-baremetal: goroutine 320 [running]:
2017/06/30 07:29:02 [DEBUG] plugin: terraform-provider-baremetal: main.(*InstanceResourceCrud).SetData(0xc42067c7d0)
2017/06/30 07:29:02 [DEBUG] plugin: terraform-provider-baremetal: 	/workspace/gopath/src/github.com/oracle/terraform-provider-baremetal/resource_obmcs_core_instance.go:335 +0x4b6
2017/06/30 07:29:02 [DEBUG] plugin: terraform-provider-baremetal: github.com/oracle/terraform-provider-baremetal/crud.ReadResource(0xf3b2e0, 0xc42067c7d0, 0x0, 0x0)
2017/06/30 07:29:02 [DEBUG] plugin: terraform-provider-baremetal: 	/workspace/gopath/src/github.com/oracle/terraform-provider-baremetal/crud/helpers.go:203 +0x164
2017/06/30 07:29:02 [DEBUG] plugin: terraform-provider-baremetal: main.readInstance(0xc421050690, 0xb8df40, 0xc4202ad880, 0x0, 0xc420fc53a8)
2017/06/30 07:29:02 [DEBUG] plugin: terraform-provider-baremetal: 	/workspace/gopath/src/github.com/oracle/terraform-provider-baremetal/resource_obmcs_core_instance.go:161 +0xaf
2017/06/30 07:29:02 [DEBUG] plugin: terraform-provider-baremetal: github.com/oracle/terraform-provider-baremetal/vendor/github.com/hashicorp/terraform/helper/schema.(*Resource).Refresh(0xc42072f3e0, 0xc420845e50, 0xb8df40, 0xc4202ad880, 0xc4205f06d0, 0xc420833e01, 0x0)
2017/06/30 07:29:02 [DEBUG] plugin: terraform-provider-baremetal: 	/workspace/gopath/src/github.com/oracle/terraform-provider-baremetal/vendor/github.com/hashicorp/terraform/helper/schema/resource.go:314 +0x21d
2017/06/30 07:29:02 [DEBUG] plugin: terraform-provider-baremetal: github.com/oracle/terraform-provider-baremetal/vendor/github.com/hashicorp/terraform/helper/schema.(*Provider).Refresh(0xc4200f7340, 0xc420845e00, 0xc420845e50, 0x7f3787b10000, 0x0, 0xc420d6b2f0)
2017/06/30 07:29:02 [DEBUG] plugin: terraform-provider-baremetal: 	/workspace/gopath/src/github.com/oracle/terraform-provider-baremetal/vendor/github.com/hashicorp/terraform/helper/schema/provider.go:267 +0x91
2017/06/30 07:29:02 [DEBUG] plugin: terraform-provider-baremetal: github.com/oracle/terraform-provider-baremetal/vendor/github.com/hashicorp/terraform/plugin.(*ResourceProviderServer).Refresh(0xc4206088a0, 0xc420aaa900, 0xc420aaaf20, 0x0, 0x0)
2017/06/30 07:29:02 [DEBUG] plugin: terraform-provider-baremetal: 	/workspace/gopath/src/github.com/oracle/terraform-provider-baremetal/vendor/github.com/hashicorp/terraform/plugin/resource_provider.go:510 +0x4e
2017/06/30 07:29:02 [DEBUG] plugin: terraform-provider-baremetal: reflect.Value.call(0xc42001f8c0, 0xc4202cd2a8, 0x13, 0xb8f3c2, 0x4, 0xc420c7af20, 0x3, 0x3, 0x20000, 0xc4208b57d0, ...)
2017/06/30 07:29:02 [DEBUG] plugin: terraform-provider-baremetal: 	/usr/lib/golang/src/reflect/value.go:434 +0x91f
2017/06/30 07:29:02 [DEBUG] plugin: terraform-provider-baremetal: reflect.Value.Call(0xc42001f8c0, 0xc4202cd2a8, 0x13, 0xc42002d720, 0x3, 0x3, 0xc420cc2060, 0x180001, 0x0)
2017/06/30 07:29:02 [DEBUG] plugin: terraform-provider-baremetal: 	/usr/lib/golang/src/reflect/value.go:302 +0xa4
2017/06/30 07:29:02 [DEBUG] plugin: terraform-provider-baremetal: net/rpc.(*service).call(0xc4205fae80, 0xc4205fae40, 0xc4205584b0, 0xc4202ad200, 0xc420608980, 0xa66b80, 0xc420aaa900, 0x16, 0xa66bc0, 0xc420aaaf20, ...)
2017/06/30 07:29:02 [DEBUG] plugin: terraform-provider-baremetal: 	/usr/lib/golang/src/net/rpc/server.go:387 +0x144
2017/06/30 07:29:02 [DEBUG] plugin: terraform-provider-baremetal: created by net/rpc.(*Server).ServeCodec
2017/06/30 07:29:02 [DEBUG] plugin: terraform-provider-baremetal: 	/usr/lib/golang/src/net/rpc/server.go:481 +0x404
2017/06/30 07:29:02 [ERROR] root.mysql: eval: *terraform.EvalRefresh, err: baremetal_core_instance.mysql.0: unexpected EOF
2017/06/30 07:29:02 [ERROR] root.mysql: eval: *terraform.EvalSequence, err: baremetal_core_instance.mysql.0: unexpected EOF
2017/06/30 07:29:02 [TRACE] [walkRefresh] Exiting eval tree: module.mysql.baremetal_core_instance.mysql[0]
  • didn't change tftstate

terraform plan

2017/06/30 07:26:28 [DEBUG] dag/walk: vertex "root", waiting for: "output.MYSQLprivateIP"
2017/06/30 07:26:29 [DEBUG] dag/walk: vertex "root", waiting for: "module.mysql.baremetal_core_instance.mysql[0]"
2017/06/30 07:26:33 [DEBUG] dag/walk: vertex "output.MYSQLprivateIP", waiting for: "module.mysql.output.MYSQLprivateIP"
2017/06/30 07:26:33 [DEBUG] dag/walk: vertex "module.mysql.output.MYSQLprivateIP", waiting for: "module.mysql.baremetal_core_instance.mysql"
2017/06/30 07:26:33 [DEBUG] dag/walk: vertex "provider.baremetal (close)", waiting for: "module.mysql.baremetal_core_instance.mysql"
2017/06/30 07:26:33 [DEBUG] dag/walk: vertex "root", waiting for: "output.MYSQLprivateIP"
2017/06/30 07:26:34 [DEBUG] dag/walk: vertex "root", waiting for: "module.mysql.baremetal_core_instance.mysql[0]"
2017/06/30 07:26:35 [DEBUG] plugin: terraform-provider-baremetal: 2017/06/30 07:26:35 [DEBUG] no vnic yet, skipping
2017/06/30 07:26:35 [DEBUG] plugin: terraform-provider-baremetal: Releasing state lock. This may take a few moments...
panic:Error refreshing state: 1 error(s) occurred:

 runtime error: invalid memory address or nil pointer dereference
2017/06/30 07:26:35 [DEBUG] plugin: terraform-provider-baremetal: [signal SIGSEGV: segmentation violation code=0x1 addr=0x98 pc=0x9da516]
2017/06/30 07:26:35 [DEBUG] plugin: terraform-provider-baremetal:
2017/06/30 07:26:35 [DEBUG] plugin: terraform-provider-baremetal: goroutine 374 [running]:
2017/06/30 07:26:35 [DEBUG] plugin: terraform-provider-baremetal: main.(*InstanceResourceCrud).SetData(0xc420a14e60)
2017/06/30 07:26:35 [DEBUG] plugin: terraform-provider-baremetal: 	/workspace/gopath/src/github.com/oracle/terraform-provider-baremetal/resource_obmcs_core_instance.go:335 +0x4b6
2017/06/30 07:26:35 [DEBUG] plugin: terraform-provider-baremetal: github.com/oracle/terraform-provider-baremetal/crud.ReadResource(0xf3b2e0, 0xc420a14e60, 0x0, 0x0)
2017/06/30 07:26:35 [DEBUG] plugin: terraform-provider-baremetal: 	/workspace/gopath/src/github.com/oracle/terraform-provider-baremetal/crud/helpers.go:203 +0x164
2017/06/30 07:26:35 [DEBUG] plugin: terraform-provider-baremetal: main.readInstance(0xc4210e6930, 0xb8df40, 0xc4204e1280, 0x0, 0xc420daabc8)
2017/06/30 07:26:35 [DEBUG] plugin: terraform-provider-baremetal: 	/workspace/gopath/src/github.com/oracle/terraform-provider-baremetal/resource_obmcs_core_instance.go:161 +0xaf
2017/06/30 07:26:35 [DEBUG] plugin: terraform-provider-baremetal: github.com/oracle/terraform-provider-baremetal/vendor/github.com/hashicorp/terraform/helper/schema.(*Resource).Refresh(0xc4206a7980, 0xc420a14dc0, 0xb8df40, 0xc4204e1280, 0xc42046e388, 0xc420888201, 0x0)
2017/06/30 07:26:35 [DEBUG] plugin: terraform-provider-baremetal: 	/workspace/gopath/src/github.com/oracle/terraform-provider-baremetal/vendor/github.com/hashicorp/terraform/helper/schema/resource.go:314 +0x21d
2017/06/30 07:26:35 [DEBUG] plugin: terraform-provider-baremetal: github.com/oracle/terraform-provider-baremetal/vendor/github.com/hashicorp/terraform/helper/schema.(*Provider).Refresh(0xc4200f72d0, 0xc420a14d70, 0xc420a14dc0, 0x7f1c13946960, 0x0, 0xc42105d350)
2017/06/30 07:26:35 [DEBUG] plugin: terraform-provider-baremetal: 	/workspace/gopath/src/github.com/oracle/terraform-provider-baremetal/vendor/github.com/hashicorp/terraform/helper/schema/provider.go:267 +0x91
2017/06/30 07:26:35 [DEBUG] plugin: terraform-provider-baremetal: github.com/oracle/terraform-provider-baremetal/vendor/github.com/hashicorp/terraform/plugin.(*ResourceProviderServer).Refresh(0xc42065b260, 0xc420b9ee90, 0xc420b9f480, 0x0, 0x0)
2017/06/30 07:26:35 [DEBUG] plugin: terraform-provider-baremetal: 	/workspace/gopath/src/github.com/oracle/terraform-provider-baremetal/vendor/github.com/hashicorp/terraform/plugin/resource_provider.go:510 +0x4e
2017/06/30 07:26:35 [DEBUG] plugin: terraform-provider-baremetal: reflect.Value.call(0xc4202a2960, 0xc4201cedb8, 0x13, 0xb8f3c2, 0x4, 0xc420d11f20, 0x3, 0x3, 0x0, 0x0, ...)
2017/06/30 07:26:35 [DEBUG] plugin: terraform-provider-baremetal: 	/usr/lib/golang/src/reflect/value.go:434 +0x91f
2017/06/30 07:26:35 [DEBUG] plugin: terraform-provider-baremetal: reflect.Value.Call(0xc4202a2960, 0xc4201cedb8, 0x13, 0xc420c72f20, 0x3, 0x3, 0x0, 0x8, 0x0)
2017/06/30 07:26:35 [DEBUG] plugin: terraform-provider-baremetal: 	/usr/lib/golang/src/reflect/value.go:302 +0xa4
2017/06/30 07:26:35 [DEBUG] plugin: terraform-provider-baremetal: net/rpc.(*service).call(0xc420682f00, 0xc420682ec0, 0xc420684ed8, 0xc4204e0b80, 0xc42065b340, 0xa66b80, 0xc420b9ee90, 0x16, 0xa66bc0, 0xc420b9f480, ...)
2017/06/30 07:26:35 [DEBUG] plugin: terraform-provider-baremetal: 	/usr/lib/golang/src/net/rpc/server.go:387 +0x144
2017/06/30 07:26:35 [DEBUG] plugin: terraform-provider-baremetal: created by net/rpc.(*Server).ServeCodec
2017/06/30 07:26:35 [DEBUG] plugin: terraform-provider-baremetal: 	/usr/lib/golang/src/net/rpc/server.go:481 +0x404
2017/06/30 07:26:35 [ERROR] root.mysql: eval: *terraform.EvalRefresh, err: baremetal_core_instance.mysql.0: unexpected EOF
2017/06/30 07:26:35 [ERROR] root.mysql: eval: *terraform.EvalSequence, err: baremetal_core_instance.mysql.0: unexpected EOF
2017/06/30 07:26:35 [TRACE] [walkRefresh] Exiting eval tree: module.mysql.baremetal_core_instance.mysql[0]
2017/06/30 07:26:35 [DEBUG] dag/walk: upstream errored, not walking "root"
2017/06/30 07:26:35 [DEBUG] dag/walk: upstream errored, not walking "module.mysql.output.MYSQLprivateIP"
2017/06/30 07:26:35 [DEBUG] dag/walk: upstream errored, not walking "output.MYSQLprivateIP"
2017/06/30 07:26:35 [DEBUG] dag/walk: upstream errored, not walking "provider.baremetal (close)"
2017/06/30 07:26:35 [DEBUG] dag/walk: upstream errored, not walking "root"

terraform apply

2017/06/30 07:32:47 [DEBUG] dag/walk: vertex "output.MYSQLprivateIP", waiting for: "module.mysql.output.MYSQLprivateIP"
2017/06/30 07:32:51 [DEBUG] dag/walk: vertex "root", waiting for: "provider.baremetal (close)"
2017/06/30 07:32:52 [DEBUG] dag/walk: vertex "provider.baremetal (close)", waiting for: "module.mysql.baremetal_core_instance.mysql"
2017/06/30 07:32:52 [DEBUG] dag/walk: vertex "root", waiting for: "module.mysql.baremetal_core_instance.mysql[0]"
2017/06/30 07:32:52 [DEBUG] dag/walk: vertex "module.mysql.output.MYSQLprivateIP", waiting for: "module.mysql.baremetal_core_instance.mysql"
2017/06/30 07:32:52 [DEBUG] dag/walk: vertex "output.MYSQLprivateIP", waiting for: "module.mysql.output.MYSQLprivateIP"
2017/06/30 07:32:53 [DEBUG] plugin: terraform-provider-baremetal: 2017/06/30 07:32:53 [DEBUG] no vnic yet, skipping
2017/06/30 07:32:53 [DEBUG] plugin: terraform-provider-baremetal: Releasing state lock. This may take a few moments...
panic:
 runtime error: invalid memory address or nil pointer dereference
2017/06/30 07:32:53 [DEBUG] plugin: terraform-provider-baremetal: [signal SIGSEGV: segmentation violation code=0x1 addr=0x98 pc=0x9da516]
2017/06/30 07:32:53 [DEBUG] plugin: terraform-provider-baremetal:
2017/06/30 07:32:53 [DEBUG] plugin: terraform-provider-baremetal: goroutine 386 [running]:
2017/06/30 07:32:53 [DEBUG] plugin: terraform-provider-baremetal: main.(*InstanceResourceCrud).SetData(0xc4208e4320)
2017/06/30 07:32:53 [DEBUG] plugin: terraform-provider-baremetal: 	/workspace/gopath/src/github.com/oracle/terraform-provider-baremetal/resource_obmcs_core_instance.go:335 +0x4b6
2017/06/30 07:32:53 [DEBUG] plugin: terraform-provider-baremetal: github.com/oracle/terraform-provider-baremetal/crud.ReadResource(0xf3b2e0, 0xc4208e4320, 0x0, 0x0)
2017/06/30 07:32:53 [DEBUG] plugin: terraform-provider-baremetal: 	/workspace/gopath/src/github.com/oracle/terraform-provider-baremetal/crud/helpers.go:203 +0x164
2017/06/30 07:32:53 [DEBUG] plugin: terraform-provider-baremetal: main.readInstance(0xc42106c690, 0xb8df40, 0xc420560300, 0x0, 0xc4209bf948)
2017/06/30 07:32:53 [DEBUG] plugin: terraform-provider-baremetal: 	/workspace/gopath/src/github.com/oracle/terraform-provider-baremetal/resource_obmcs_core_instance.go:161 +0xaf
2017/06/30 07:32:53 [DEBUG] plugin: terraform-provider-baremetal: github.com/oracle/terraform-provider-baremetal/vendor/github.com/hashicorp/terraform/helper/schema.(*Resource).Refresh(0xc4207022a0, 0xc4208e4280, 0xb8df40, 0xc420560300, 0xc420022c28, 0xc42088d901, 0x1)
2017/06/30 07:32:53 [DEBUG] plugin: terraform-provider-baremetal: 	/workspace/gopath/src/github.com/oracle/terraform-provider-baremetal/vendor/github.com/hashicorp/terraform/helper/schema/resource.go:314 +0x21d
2017/06/30 07:32:53 [DEBUG] plugin: terraform-provider-baremetal: github.com/oracle/terraform-provider-baremetal/vendor/github.com/hashicorp/terraform/helper/schema.(*Provider).Refresh(0xc420015110, 0xc4208e4230, 0xc4208e4280, 0x7f3291123000, 0x0, 0xc420bcad48)
2017/06/30 07:32:53 [DEBUG] plugin: terraform-provider-baremetal: 	/workspace/gopath/src/github.com/oracle/terraform-provider-baremetal/vendor/github.com/hashicorp/terraform/helper/schema/provider.go:267 +0x91
2017/06/30 07:32:53 [DEBUG] plugin: terraform-provider-baremetal: github.com/oracle/terraform-provider-baremetal/vendor/github.com/hashicorp/terraform/plugin.(*ResourceProviderServer).Refresh(0xc420616560, 0xc420bcada0, 0xc420bcb290, 0x0, 0x0)
2017/06/30 07:32:53 [DEBUG] plugin: terraform-provider-baremetal: 	/workspace/gopath/src/github.com/oracle/terraform-provider-baremetal/vendor/github.com/hashicorp/terraform/plugin/resource_provider.go:510 +0x4e
2017/06/30 07:32:53 [DEBUG] plugin: terraform-provider-baremetal: reflect.Value.call(0xc4202a0840, 0xc4202286a0, 0x13, 0xb8f3c2, 0x4, 0xc420d7df20, 0x3, 0x3, 0xf, 0x0, ...)
2017/06/30 07:32:53 [DEBUG] plugin: terraform-provider-baremetal: 	/usr/lib/golang/src/reflect/value.go:434 +0x91f
2017/06/30 07:32:53 [DEBUG] plugin: terraform-provider-baremetal: reflect.Value.Call(0xc4202a0840, 0xc4202286a0, 0x13, 0xc4201fe720, 0x3, 0x3, 0x588650, 0xf3cf60, 0xc4200103f0)
2017/06/30 07:32:53 [DEBUG] plugin: terraform-provider-baremetal: 	/usr/lib/golang/src/reflect/value.go:302 +0xa4
2017/06/30 07:32:53 [DEBUG] plugin: terraform-provider-baremetal: net/rpc.(*service).call(0xc420564940, 0xc420564900, 0xc420566688, 0xc420489680, 0xc42061ff20, 0xa66b80, 0xc420bcada0, 0x16, 0xa66bc0, 0xc420bcb290, ...)
2017/06/30 07:32:53 [DEBUG] plugin: terraform-provider-baremetal: 	/usr/lib/golang/src/net/rpc/server.go:387 +0x144
2017/06/30 07:32:53 [DEBUG] plugin: terraform-provider-baremetal: created by net/rpc.(*Server).ServeCodec
2017/06/30 07:32:53 [DEBUG] plugin: terraform-provider-baremetal: 	/usr/lib/golang/src/net/rpc/server.go:481 +0x404
2017/06/30 07:32:53 [DEBUG] plugin: /usr/local/bin/terraform-provider-baremetal: plugin process exited
2017/06/30 07:32:53 [ERROR] root.mysql: eval: *terraform.EvalRefresh, err: baremetal_core_instance.mysql.0: unexpected EOF
2017/06/30 07:32:53 [ERROR] root.mysql: eval: *terraform.EvalSequence, err: baremetal_core_instance.mysql.0: unexpected EOF
2017/06/30 07:32:53 [TRACE] [walkRefresh] Exiting eval tree: module.mysql.baremetal_core_instance.mysql[0]
2017/06/30 07:32:53 [DEBUG] dag/walk: upstream errored, not walking "root"
2017/06/30 07:32:53 [DEBUG] dag/walk: upstream errored, not walking "provider.baremetal (close)"
2017/06/30 07:32:53 [DEBUG] dag/walk: upstream errored, not walking "module.mysql.output.MYSQLprivateIP"
2017/06/30 07:32:53 [DEBUG] dag/walk: upstream errored, not walking "output.MYSQLprivateIP"
2017/06/30 07:32:53 [DEBUG] dag/walk: upstream errored, not walking "root"

TFState content

"resources": {
                "baremetal_core_instance.mysql.0": {
                    "type": "baremetal_core_instance",
                    "depends_on": [
                        "data.baremetal_identity_availability_domains.ADs",
                        "data.template_file.cloudinit"
                    ],
                    "primary": {
                        "id": "ocid1.instance.oc1.phx.xxxxxxx",
                        "attributes": {
                            "availability_domain": "HUYg:PHX-AD-1",
                            "compartment_id": "ocid1.compartment.oc1..xxxxxxx",
                            "create_vnic_details.#": "1",
                            "create_vnic_details.0.assign_public_ip": "false",
                            "create_vnic_details.0.display_name": "vnic-mysql-001.HUYg:PHX-AD-1",
                            "create_vnic_details.0.hostname_label": "",
                            "create_vnic_details.0.private_ip": "10.0.0.100",
                            "create_vnic_details.0.public_ip": "",
                            "create_vnic_details.0.subnet_id": "ocid1.subnet.oc1.phx.xxxxxxx",
                            "display_name": "mysql-001.HUYg:PHX-AD-1",
                            "hostname_label": "",
                            "id": "ocid1.instance.oc1.phx.xxxxxxx",
                            "image": "ocid1.image.oc1.phx.xxxxxxx",
                            "ipxe_script": "",
                            "metadata.%": "2",
                            "metadata.ssh_authorized_keys": "",
                            "metadata.user_data": "",
                            "private_ip": "10.0.0.100",
                            "public_ip": "",
                            "region": "phx",
                            "shape": "BM.DenseIO1.36",
                            "state": "RUNNING",
                            "subnet_id": "ocid1.subnet.oc1.phx.xxxxx",
                            "time_created": "2017-06-30 06:37:13.14 +0000 UTC"
                        },
                        "meta": {
                            "xxx-xxx-xxx-xxx-xxx": {
                                "create": 360000000000,
                                "delete": 7200000000000,
                                "update": 7200000000000
                            }
                        },
                        "tainted": false
                    },
                    "deposed": [],
                    "provider": ""
                },

@VAdamec
Copy link
Author

VAdamec commented Jul 25, 2017

@josephholsten let me know if there is anything I can do to help you

@rcohenma rcohenma self-assigned this Sep 16, 2017
@rcohenma
Copy link
Contributor

is this still a problem? if so can you attach your tf files?

I've tried creating an instance using terraform
I terminate the instance using the UI
Run terraform refresh
state of instance resource in the tfstate is correctly set to TERMINATED

@VAdamec
Copy link
Author

VAdamec commented Sep 16, 2017 via email

@rcohenma
Copy link
Contributor

ok, i'm working on fix so that resources would be recreated on further applies if they are terminated.

I can't reproduce the other issue:
I create an instance with terraform
terminate it from the UI
wait for ttl to expire so that i get a Not Found error on get
terraform plan shows a new instance would be created
terraform apply works fine without error

@rcohenma
Copy link
Contributor

This was fixed in v2.0.1

@VAdamec
Copy link
Author

VAdamec commented Oct 2, 2017

Perfect, thanks a lot

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 a pull request may close this issue.

5 participants