cloudamqp / terraform-provider-cloudamqp

Terraform Provider for CloudAMQP
https://registry.terraform.io/providers/cloudamqp/cloudamqp
Mozilla Public License 2.0
35 stars 39 forks source link

Problem with creating instances in Azure #12

Closed nemetht closed 4 years ago

nemetht commented 5 years ago

I cant figure out how to create a CloudAMQP instance in Azure.

Using the following terraform template: `resource "cloudamqp_instance" "rmq_bunny" { name = "terraform-provider-test" plan = "bunny" region = "azure::eastus" }

output "rmq_url" { value = "${cloudamqp_instance.rmq_bunny.url}" }`

I've used an api key from over here: customer.cloudamqp.com/apikeys

I get the following error output: `cloudamqp_instance.rmq_bunny: Creating... apikey: "" => "" name: "" => "terraform-provider-test" nodes: "" => "1" plan: "" => "bunny" region: "" => "azure::eastus" url: "" => ""

Error: Error applying plan:

1 error(s) occurred:

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 nil, not float64 2019-04-24T11:52:51.592+0200 [DEBUG] plugin.terraform-provider-cloudamqp.exe: 2019-04-24T11:52:51.592+0200 [DEBUG] plugin.terraform-provider-cloudamqp.exe: goroutine 45 [running]: 2019-04-24T11:52:51.592+0200 [DEBUG] plugin.terraform-provider-cloudamqp.exe: github.com/cloudamqp/terraform-provider/vendor/github.com/84codes/go-api/api.(API).Create(0xc000526d28, 0xc0003fede0, 0xfe71aa, 0x5, 0xc000177858) 2019-04-24T11:52:51.592+0200 [DEBUG] plugin.terraform-provider-cloudamqp.exe: C:/playground/GoWorkspace/src/github.com/cloudamqp/terraform-provider/vendor/github.com/84codes/go-api/api/api.go:45 +0x270 2019-04-24T11:52:51.592+0200 [DEBUG] plugin.terraform-provider-cloudamqp.exe: main.resourceCreate(0xc0001e52d0, 0xf08ea0, 0xc000526d28, 0x24, 0x1a78e00) 2019-04-24T11:52:51.592+0200 [DEBUG] plugin.terraform-provider-cloudamqp.exe: C:/playground/GoWorkspace/src/github.com/cloudamqp/terraform-provider/resource_instance.go:72 +0x120 2019-04-24T11:52:51.592+0200 [DEBUG] plugin.terraform-provider-cloudamqp.exe: github.com/cloudamqp/terraform-provider/vendor/github.com/hashicorp/terraform/helper/schema.(Resource).Apply(0xc000193b20, 0xc00047e320, 0xc000005900, 0xf08ea0, 0xc000526d28, 0xd7bc01, 0xc0003bbd70, 0x0) 2019-04-24T11:52:51.592+0200 [DEBUG] plugin.terraform-provider-cloudamqp.exe: C:/playground/GoWorkspace/src/github.com/cloudamqp/terraform-provider/vendor/github.com/hashicorp/terraform/helper/schema/resource.go:225 +0x3a9 2019-04-24T11:52:51.592+0200 [DEBUG] plugin.terraform-provider-cloudamqp.exe: github.com/cloudamqp/terraform-provider/vendor/github.com/hashicorp/terraform/helper/schema.(Provider).Apply(0xc000193b90, 0xc00047e2d0, 0xc00047e320, 0xc000005900, 0xc0003fed80, 0xc000139530, 0x18) 2019-04-24T11:52:51.592+0200 [DEBUG] plugin.terraform-provider-cloudamqp.exe: C:/playground/GoWorkspace/src/github.com/cloudamqp/terraform-provider/vendor/github.com/hashicorp/terraform/helper/schema/provider.go:283 +0x196 2019-04-24T11:52:51.592+0200 [DEBUG] plugin.terraform-provider-cloudamqp.exe: github.com/cloudamqp/terraform-provider/vendor/github.com/hashicorp/terraform/plugin.(ResourceProviderServer).Apply(0xc000523f80, 0xc0000054e0, 0xc0001aef30, 0x0, 0x0) 2019-04-24T11:52:51.592+0200 [DEBUG] plugin.terraform-provider-cloudamqp.exe: C:/playground/GoWorkspace/src/github.com/cloudamqp/terraform-provider/vendor/github.com/hashicorp/terraform/plugin/resource_provider.go:527 +0x5e 2019-04-24T11:52:51.592+0200 [DEBUG] plugin.terraform-provider-cloudamqp.exe: reflect.Value.call(0xc0004b2420, 0xc000526ac8, 0x13, 0xfe6012, 0x4, 0xc000137f18, 0x3, 0x3, 0xc00013a240, 0xc000520028, ...) 2019-04-24T11:52:51.592+0200 [DEBUG] plugin.terraform-provider-cloudamqp.exe: C:/Go/src/reflect/value.go:447 +0x468 2019-04-24T11:52:51.592+0200 [DEBUG] plugin.terraform-provider-cloudamqp.exe: reflect.Value.Call(0xc0004b2420, 0xc000526ac8, 0x13, 0xc000137f18, 0x3, 0x3, 0xc000520000, 0xc000137f10, 0xc000137fb8) 2019-04-24T11:52:51.592+0200 [DEBUG] plugin.terraform-provider-cloudamqp.exe: C:/Go/src/reflect/value.go:308 +0xab 2019-04-24T11:52:51.592+0200 [DEBUG] plugin.terraform-provider-cloudamqp.exe: net/rpc.(service).call(0xc000460b00, 0xc000524730, 0xc000536bf0, 0xc000536c00, 0xc000497300, 0xc0003a84a0, 0xe0dfa0, 0xc0000054e0, 0x16, 0xe0dfe0, ...) 2019-04-24T11:52:51.592+0200 [DEBUG] plugin.terraform-provider-cloudamqp.exe: C:/Go/src/net/rpc/server.go:384 +0x155 2019-04-24T11:52:51.592+0200 [DEBUG] plugin.terraform-provider-cloudamqp.exe: created by net/rpc.(Server).ServeCodec 2019-04-24T11:52:51.592+0200 [DEBUG] plugin.terraform-provider-cloudamqp.exe: C:/Go/src/net/rpc/server.go:481 +0x432 2019/04/24 11:52:51 [TRACE] root: eval: terraform.EvalWriteState 2019/04/24 11:52:51 [TRACE] root: eval: terraform.EvalApplyProvisioners 2019/04/24 11:52:51 [TRACE] root: eval: terraform.EvalIf 2019/04/24 11:52:51 [TRACE] root: eval: terraform.EvalWriteState 2019/04/24 11:52:51 [TRACE] root: eval: terraform.EvalWriteDiff 2019/04/24 11:52:51 [TRACE] root: eval: terraform.EvalApplyPost 2019/04/24 11:52:51 [ERROR] root: eval: *terraform.EvalApplyPost, err: 1 error(s) occurred:

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

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!`

snichme commented 5 years ago

Hi,

Thanks for reporting this.

The error is due to poor error handling in our terraform provider and we will look into this.

The error occurs because of wrong region name, you should be using azure-arm::eastus and not azure::eastus The provider should handle these cases and not crash, but try with the other region name and you should get your instance up and running.

nemetht commented 5 years ago

Using azure-arm::eastus or azure-arm::westeurope brings a similar error...

nemetht commented 5 years ago

It seems that this unexpected EOF is just always printed, if there are any kinds of problems during the creation, just like missing baseurl from the cloudamqp provider configuration or even using the wrong region, where no clusters are available. Trying to create instances via curl shows the error messages I had along the way: {"error":"No cluster available in azure::west-europe yet"} or {"error":"Invalid region name"}

So the request here is more to have a better logging of error messages.

tbroden84 commented 4 years ago

Closing this issue. Due to much older version and overall better error handling was implemented a while back. Missed to refer to this issue when it was indirectly solved.