Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

panic with empty cdrom{} block #2341

Open
1 of 4 tasks
bjh21 opened this issue Feb 6, 2025 · 1 comment
Open
1 of 4 tasks

panic with empty cdrom{} block #2341

bjh21 opened this issue Feb 6, 2025 · 1 comment
Labels
bug Type: Bug crash Impact: Crash needs-triage Status: Issue Needs Triage

Comments

@bjh21
Copy link

bjh21 commented Feb 6, 2025

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

1.10.5

Terraform Provider

2.11.1

VMware vSphere

8.0.3.00400

Description

I provisioned a VM from an OVA in a Content Library (specifically, a copy of https://cloud-images.ubuntu.com/releases/24.04/release-20250115/ubuntu-24.04-server-cloudimg-amd64.ova) and then found that it needed a CD-ROM driver ("Error: this virtual machine requires a client CDROM device to deliver vApp properties"). So I added this to the VM's resource block:

  cdrom {
  }

Running terraform plan then caused a panic.

Affected Resources or Data Sources

resource/vsphere_virtual_machine

Terraform Configuration

https://gist.github.com/bjh21/faa3a0d90282ca34c30b7f02f14a7728

Debug Output

The phrase "debug output" doesn't return anything useful when searching the Terraform docs, so I don't know what's required here.

Panic Output

The phrase "crash.log" doesn't return anything when searching the Terraform docs, so I don't know where to find the crash.log file.

Expected Behavior

I expected a polite error message telling me that a completely empty cdrom block wasn't allowed.

Actual Behavior

Running terraform plan caused a panic:

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: Request cancelled
│
│   with vsphere_virtual_machine.moa-dev-patroni4,
│   on main.tf line 58, in resource "vsphere_virtual_machine" "moa-dev-patroni4":
│   58: resource "vsphere_virtual_machine" "moa-dev-patroni4" {
│
│ The plugin.(*GRPCProvider).PlanResourceChange request was cancelled.
╵

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

panic: interface conversion: interface {} is nil, not map[string]interface {}

goroutine 223 [running]:
github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/virtualdevice.VerifyVAppTransport(0x1008640?)
        github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/virtualdevice/virtual_machine_cdrom_subresource.go:599 +0x21d
github.com/hashicorp/terraform-provider-vsphere/vsphere.resourceVSphereVirtualMachineCustomizeDiff({0x14c5a20?, 0xc0007c8300?}, 0xc000783300, {0x103c1c0?, 0xc0006a44e0})
        github.com/hashicorp/terraform-provider-vsphere/vsphere/resource_vsphere_virtual_machine.go:1027 +0xd05
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.Diff(0xc000283a40, {0x14c5a20, 0xc0007c8300}, 0xc0008b40d0, 0xc00081b740, 0x1371c20, {0x103c1c0, 0xc0006a44e0}, 0x0)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.17.0/helper/schema/schema.go:677 +0x4b4
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).SimpleDiff(0x14c6190?, {0x14c5a20?, 0xc0007c8300?}, 0xc0008b40d0, 0x106e9c0?, {0x103c1c0?, 0xc0006a44e0?})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.17.0/helper/schema/resource.go:890 +0x6c
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).PlanResourceChange(0xc000127920, {0x14c5978?, 0xc0009f2000?}, 0xc00009c0f0)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.17.0/helper/schema/grpc_provider.go:741 +0x98c
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).PlanResourceChange(0xc000510460, {0x14c5a20?, 0xc000bd3740?}, 0xc0000d6460)
        github.com/hashicorp/terraform-plugin-go@v0.9.1/tfprotov5/tf5server/server.go:779 +0x515
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_PlanResourceChange_Handler({0x128f8e0?, 0xc000510460}, {0x14c5a20, 0xc000bd3740}, 0xc000747e60, 0x0)
        github.com/hashicorp/terraform-plugin-go@v0.9.1/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:367 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000140700, {0x14c8650, 0xc0006029c0}, 0xc0000c5b00, 0xc000274bd0, 0x1d662c8, 0x0)
        google.golang.org/grpc@v1.46.0/server.go:1283 +0xcfd
google.golang.org/grpc.(*Server).handleStream(0xc000140700, {0x14c8650, 0xc0006029c0}, 0xc0000c5b00, 0x0)
        google.golang.org/grpc@v1.46.0/server.go:1620 +0xa1b
google.golang.org/grpc.(*Server).serveStreams.func1.2()
        google.golang.org/grpc@v1.46.0/server.go:922 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
        google.golang.org/grpc@v1.46.0/server.go:920 +0x28a

Error: The terraform-provider-vsphere_v2.2.0_x5 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.

Steps to Reproduce

Unknown. Maybe if you've got a vSphere environment and a configuration similar to the one above, you can reproduce the problem.

Environment Details

No response

Screenshots

No response

References

No response

@bjh21 bjh21 added bug Type: Bug needs-triage Status: Issue Needs Triage labels Feb 6, 2025
@github-actions github-actions bot added the crash Impact: Crash label Feb 6, 2025
Copy link

github-actions bot commented Feb 6, 2025

Hello, bjh21! 🖐

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Type: Bug crash Impact: Crash needs-triage Status: Issue Needs Triage
Projects
None yet
Development

No branches or pull requests

1 participant