josenk / terraform-provider-esxi

Terraform-provider-esxi plugin
GNU General Public License v3.0
538 stars 154 forks source link

Plugin did not respond #213

Open Chriskmob opened 9 months ago

Chriskmob commented 9 months ago

Hello, thank you for your plugin. it worked for me last week but now it doesn't working . i don't know why, because i didn't made any changes. I also tried with the version 1.10.2 of the plugin. if you have some ideas ..?

i tried with terraform 1.6.1 and 1.4.7 on two different machines with a very basic config file i checked the opened ports on the esxi 22 and 443 are open.

Thanks

my ESXi version : 7.0.2

my config file XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

provider "esxi" { esxi_hostname = var.esxi_hostname esxi_hostport = var.esxi_hostport esxi_hostssl = var.esxi_hostssl esxi_username = var.esxi_username esxi_password = var.esxi_password }

resource "esxi_guest" "ubuntu_vm" { guest_name = var.vm_hostname disk_store = var.disk_store

ovf_source = var.ovf_file

network_interfaces { virtual_network = var.virtual_network }

ovf_properties { key = "user-data" value = base64encode(file(var.script_deploy)) } }

The error XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

root@ubuntu-108:~/ubuntu-198# which tf147 /usr/local/bin/tf147 root@ubuntu-108:~/ubuntu-198# tf147 init

Initializing the backend...

Initializing provider plugins...

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see any changes that are required for your infrastructure. All Terraform commands should now work.

If you ever set or change modules or backend configuration for Terraform, rerun this command to reinitialize your working directory. If you forget, other commands will detect it and remind you to do so if necessary. root@ubuntu-108:~/ubuntu-198# tf147 apply

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:

Terraform will perform the following actions:

esxi_guest.ubuntu_vm will be created

Plan: 1 to add, 0 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

esxi_guest.ubuntu_vm: Creating... ╷ │ Error: Plugin did not respond │ │ with esxi_guest.ubuntu_vm, │ on u-198.tf line 9, in resource "esxi_guest" "ubuntu_vm": │ 9: resource "esxi_guest" "ubuntu_vm" { │ │ The plugin encountered an error, and failed to respond to the │ plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more │ details. ╵

Stack trace from the terraform-provider-esxi_v1.10.3 plugin:

panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0xcc3cce]

goroutine 45 [running]: github.com/josenk/terraform-provider-esxi/esxi.guestCREATE(0xc0004f50e0, 0xc0000356c0, 0xa, 0xc0000356a0, 0xa, 0xc0000cb1c0, 0x39, 0x1492fb8, 0x1, 0x0, ...) github.com/josenk/terraform-provider-esxi/esxi/guest-create.go:212 +0x1eae github.com/josenk/terraform-provider-esxi/esxi.resourceGUESTCreate(0xc00010d8f0, 0xd96900, 0xc0004f50e0, 0x2, 0x152de40) github.com/josenk/terraform-provider-esxi/esxi/resource_guest.go:403 +0x1ace github.com/hashicorp/terraform/helper/schema.(Resource).Apply(0xc000124b80, 0xc0003e4410, 0xc0004c9a80, 0xd96900, 0xc0004f50e0, 0xda4f01, 0xc0000a3378, 0xc0003e9200) github.com/hashicorp/terraform@v0.12.2/helper/schema/resource.go:286 +0x375 github.com/hashicorp/terraform/helper/schema.(Provider).Apply(0xc000124e80, 0xc00013b8d8, 0xc0003e4410, 0xc0004c9a80, 0xc0003ec2c8, 0xc00000eb20, 0xda6f20) github.com/hashicorp/terraform@v0.12.2/helper/schema/provider.go:285 +0x99 github.com/hashicorp/terraform/helper/plugin.(GRPCProviderServer).ApplyResourceChange(0xc000098a50, 0x101a2d0, 0xc0003e0a50, 0xc0003a29c0, 0xc000098a50, 0xc0003e0a50, 0xc00026aa50) github.com/hashicorp/terraform@v0.12.2/helper/plugin/grpc_provider.go:851 +0x88b github.com/hashicorp/terraform/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0xe7bc20, 0xc000098a50, 0x101a2d0, 0xc0003e0a50, 0xc0003e4140, 0x0, 0x101a2d0, 0xc0003e0a50, 0xc0003a5400, 0x3f2) github.com/hashicorp/terraform@v0.12.2/internal/tfplugin5/tfplugin5.pb.go:3217 +0x214 google.golang.org/grpc.(Server).processUnaryRPC(0xc000001680, 0x1021ed8, 0xc00009cf00, 0xc0003bd400, 0xc00007e330, 0x14ef2a0, 0x0, 0x0, 0x0) google.golang.org/grpc@v1.18.0/server.go:966 +0x486 google.golang.org/grpc.(Server).handleStream(0xc000001680, 0x1021ed8, 0xc00009cf00, 0xc0003bd400, 0x0) google.golang.org/grpc@v1.18.0/server.go:1245 +0xcbd google.golang.org/grpc.(Server).serveStreams.func1.1(0xc000412e10, 0xc000001680, 0x1021ed8, 0xc00009cf00, 0xc0003bd400) google.golang.org/grpc@v1.18.0/server.go:685 +0xab created by google.golang.org/grpc.(*Server).serveStreams.func1 google.golang.org/grpc@v1.18.0/server.go:683 +0xa5

Error: The terraform-provider-esxi_v1.10.3 plugin crashed!

This is always indicative of a bug within the plugin. It would be immensely helpful if you could report the crash with the plugin's maintainers so that it can be fixed. The output above should help diagnose the issue.

Melrieoi commented 5 months ago

Hi Chriskmob,

I am experiencing the same/very simmilair issue. Did you find a way to solve it?

Thanks.

josenk commented 5 months ago

Ensure ovftool is fully functional. You may need to reinstall it or update it to the latest version.

Melrieoi commented 5 months ago

Ensure ovftool is fully functional. You may need to reinstall it or update it to the latest version.

Well i was just writing the two outcomes i have which both fail. but i just tried running the apply command with a log attached. which is something i already tried before. and now, it just works. even when i remove the vm again and apply without the log it now just... works. when 15 minutes ago it did not... i hate technology.

Chriskmob commented 4 months ago

yes, for me the problem was here ovf_source = "http://192.168.137.1:7845/jammy-server-cloudimg-amd64.ova"

i have to make more tests but it seems that the plugin could not access to this http.

i workaround temporarly with local location of the ova