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

The terraform-provider-vsphere_v2.4.1_x5.exe plugin crashed! #1953

Closed
1 of 4 tasks
nprasadnurani opened this issue Jul 18, 2023 · 4 comments
Closed
1 of 4 tasks

The terraform-provider-vsphere_v2.4.1_x5.exe plugin crashed! #1953

nprasadnurani opened this issue Jul 18, 2023 · 4 comments
Labels
area/vm Area: Virtual Machines bug Type: Bug crash Impact: Crash

Comments

@nprasadnurani
Copy link

Community Guidelines

  • I have read and agree to the HashiCorp Community Guidelines .
  • Vote on this issue by adding a 👍 reaction to the original issue initial description to help the maintainers prioritize.
  • Do not leave "+1" or other comments that do not add relevant information or questions.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Terraform

Terraform v1.5.3

Terraform Provider

v2.4.1

VMware vSphere

7.0.3.01400

Description

while running terraform import to get the existing infrastruture details it crashed

Affected Resources or Data Sources

resource "vsphere_virtual_machine" "vm" {

name = <VM_NAME>

resource_pool_id = "${data.vsphere_resource_pool.pool.id}"
datastore_id = "${data.vsphere_datacenter.Awesome.id}"

num_cpus = 4
memory = 4096

network_interface {
network_id = data.vsphere_network.network.id

}

disk {
label = "Hard disk 1"
size = 232
thin_provisioned = true
}

}

Terraform Configuration

No resource pool or cluster defined so used the following vpshere_resource_pool to get resouce_id for vpshere_vitrual_machine

data "vsphere_resource_pool" "pool" {
name = "${vsphere_folder.parent.path}/Resources"
datacenter_id = "${data.vsphere_datacenter.Awesome.id}"
}

resource "vsphere_virtual_machine" "vm" {

name = <VM_NAME>

resource_pool_id = "${data.vsphere_resource_pool.pool.id}"
datastore_id = "${data.vsphere_datacenter.Awesome.id}"

num_cpus = 4
memory = 4096

network_interface {
network_id = data.vsphere_network.network.id

}

disk {
label = "Hard disk 1"
size = 232
thin_provisioned = true
}

Debug Output

https://gist.github.com/nprasadnurani/a7690368d7dddcb536a50ce409352a7b

Panic Output

No resource pool or cluster defined so used the following vpshere_resource_pool to get resouce_id for vpshere_vitrual_machine

data "vsphere_resource_pool" "pool" {
name = "${vsphere_folder.parent.path}/Resources"
datacenter_id = "${data.vsphere_datacenter.Awesome.id}"
}

resource "vsphere_virtual_machine" "vm" {

name = <VM_NAME>

resource_pool_id = "${data.vsphere_resource_pool.pool.id}"
datastore_id = "${data.vsphere_datacenter.Awesome.id}"

num_cpus = 4
memory = 4096

network_interface {
network_id = data.vsphere_network.network.id

}

disk {
label = "Hard disk 1"
size = 232
thin_provisioned = true
}

Crash trace

vsphere_virtual_machine.vm: Import prepared!
Prepared vsphere_virtual_machine for import
vsphere_virtual_machine.vm: Refreshing state... [id=4220dd3b-2f07-4d9a-3395-c0a806a81622]

│ Error: Plugin did not respond

│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ReadResource call. The plugin logs may contain more details.

Stack trace from the terraform-provider-vsphere_v2.4.1_x5.exe plugin:

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x8 pc=0x17b5274]

goroutine 88 [running]:
github.com/hashicorp/terraform-provider-vsphere/vsphere.resourceVSphereVirtualMachineRead(0x134e17c0, {0x19630a0, 0x136025b8})
github.com/hashicorp/terraform-provider-vsphere/vsphere/resource_vsphere_virtual_machine.go:450 +0x6b4
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0x13888850, {0x1d80500, 0x13602528}, 0x134e17c0, {0x19630a0, 0x136025b8})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.26.1/helper/schema/resource.go:712 +0x166
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).RefreshWithoutUpgrade(0x13888850, {0x1d80500, 0x13602528}, 0x135b96c0, {0x19630a0, 0x136025b8})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.26.1/helper/schema/resource.go:1015 +0x547
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadResource(0x1392a010, {0x1d80500, 0x136024c8}, 0x13a0cee0)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.26.1/helper/schema/grpc_provider.go:613 +0x4f4
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadResource(0x13930050, {0x1d80500, 0x1345ff38}, 0x13628630)
github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/tf5server/server.go:748 +0x4c5
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler({0x1b50ac0, 0x13930050}, {0x1d80500, 0x1345ff38}, 0x13752d40, 0x0)
github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:349 +0x18a
google.golang.org/grpc.(*Server).processUnaryRPC(0x13704360, {0x1d82188, 0x13704000}, 0x13a0a460, 0x13916138, 0x262d1e8, 0x0)
google.golang.org/grpc@v1.51.0/server.go:1340 +0xe22
google.golang.org/grpc.(*Server).handleStream(0x13704360, {0x1d82188, 0x13704000}, 0x13a0a460, 0x0)
google.golang.org/grpc@v1.51.0/server.go:1713 +0xa17
google.golang.org/grpc.(*Server).serveStreams.func1.2()
google.golang.org/grpc@v1.51.0/server.go:965 +0xb1
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/grpc@v1.51.0/server.go:963 +0x25f

Error: The terraform-provider-vsphere_v2.4.1_x5.exe plugin crashed!

Expected Behavior

import successful
should have imported the infrastructure details into tfstate

Actual Behavior

The terraform-provider-vsphere_v2.4.1_x5.exe plugin crashed!

Steps to Reproduce

run terraform import vsphere_virtual_machine.vm <VM_PATH>

Environment Details

windows

Screenshots

image

References

No response

@nprasadnurani nprasadnurani added bug Type: Bug needs-triage Status: Issue Needs Triage labels Jul 18, 2023
@github-actions
Copy link

Hello, nprasadnurani! 🖐

Thank you for submitting an issue for this provider. The issue will now enter into the issue lifecycle.

If you want to contribute to this project, please review the contributing guidelines and information on submitting pull requests.

@github-actions github-actions bot added the crash Impact: Crash label Jul 18, 2023
@tenthirtyam tenthirtyam added this to the Backlog milestone Aug 7, 2023
@tenthirtyam tenthirtyam added the area/vm Area: Virtual Machines label Aug 7, 2023
@ArashTheKID
Copy link

ArashTheKID commented Aug 8, 2023

Hi, I would like to check on the progress of this issue, got the same problem on my machine.
Case: Creating VM Module
Provider Version: 2.4.1
OS: Windows 11
Environment: WSL2 (no systemd)
Terraform Version: 1.5.2 (via tfenv)
Crash Report::

│ Error: Request cancelled
│
│ The plugin.(*GRPCProvider).ReadResource request was cancelled.
╵

Stack trace from the terraform-provider-vsphere_v2.4.1_x5 plugin:

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

Cheers,
A.

@ArashTheKID
Copy link

ArashTheKID commented Aug 8, 2023

Update: Problem solved. In my case, from provider version 2.4.x it is not compatible with vSphere version 6.x. anymore Provider downgrade to 2.3.1 solved the problem, no crashes.

@tenthirtyam tenthirtyam added vsphere/v8 vSphere 8.0 and removed vsphere/v8 vSphere 8.0 labels Sep 5, 2023
Copy link

github-actions bot commented Apr 7, 2024

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 7, 2024
@tenthirtyam tenthirtyam removed this from the Backlog milestone Apr 29, 2024
@tenthirtyam tenthirtyam removed the needs-triage Status: Issue Needs Triage label Apr 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/vm Area: Virtual Machines bug Type: Bug crash Impact: Crash
Projects
None yet
Development

No branches or pull requests

3 participants