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 plugin.(*GRPCProvider).ReadResource request was cancelled #2308

Open
4 tasks done
joshix3m opened this issue Dec 12, 2024 · 1 comment
Open
4 tasks done

The plugin.(*GRPCProvider).ReadResource request was cancelled #2308

joshix3m opened this issue Dec 12, 2024 · 1 comment
Labels
bug Type: Bug crash Impact: Crash needs-triage Status: Issue Needs Triage

Comments

@joshix3m
Copy link

joshix3m commented Dec 12, 2024

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

v1.9.8

Terraform Provider

2.10.0

VMware vSphere

VMWare 8.0.2

Description

After deploying Virtual_switches with Terraform, then adding an Uplink manually, and migrating a bunch of VM's to this new Switch from a DistributedSwitch. "Terraform plan" crashes stating that it is a bug. Plz report it.

If you delete the virtualSwitches from the state-file. You can run Terraform plan and you will get "adds" to all the virtual switches you have added.

If you try to import the virtual switches you will get the same error

Affected Resources or Data Sources

resource/vsphere_host_virtual_switch

Terraform Configuration

resource "vsphere_host_virtual_switch" "vSwitchProd" {

for_each = local.FridHosts
name            = "vSwitchProd"
host_system_id  = (each.value).id

network_adapters = []
active_nics = []

allow_promiscuous = false
allow_forged_transmits = false
allow_mac_changes = false

    lifecycle {
    ignore_changes = [ network_adapters, active_nics ] 
    }

}

Debug Output

vsphere_host_virtual_switch.vSwitchProd["fridhostesxi01"]: Import prepared!
Prepared vsphere_host_virtual_switch for import
vsphere_host_virtual_switch.vSwitchProd["fridhostesxi01"]: Refreshing state... [id=tf-HostVirtualSwitch:host-179482:vSwitchProd]

│ Error: Request cancelled

│ The plugin.(*GRPCProvider).ReadResource request was cancelled.

Panic Output

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

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

goroutine 1444 [running]:
github.com/hashicorp/terraform-provider-vsphere/vsphere.flattenLinkDiscoveryProtocolConfig(0xc000b9d280, 0x0)
github.com/hashicorp/terraform-provider-vsphere/vsphere/host_virtual_switch_structure.go:98 +0x1c
github.com/hashicorp/terraform-provider-vsphere/vsphere.flattenHostVirtualSwitchBondBridge(0xc000b9d280, 0xc00088a090)
github.com/hashicorp/terraform-provider-vsphere/vsphere/host_virtual_switch_structure.go:121 +0x185
github.com/hashicorp/terraform-provider-vsphere/vsphere.flattenHostVirtualSwitchSpec(0xc000b9d280, 0xc0004e12f0)
github.com/hashicorp/terraform-provider-vsphere/vsphere/host_virtual_switch_structure.go:172 +0x9f
github.com/hashicorp/terraform-provider-vsphere/vsphere.resourceVSphereHostVirtualSwitchRead(0xc000b9d280, {0x10d78c0?, 0xc00054a000?})
github.com/hashicorp/terraform-provider-vsphere/vsphere/resource_vsphere_host_virtual_switch.go:98 +0x10f
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0x1639a88?, {0x1639a88?, 0xc0007029f0?}, 0xd?, {0x10d78c0?, 0xc00054a000?})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:811 +0x15f
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc000086e00, {0x1639a88, 0xc0007029f0}, 0xc000047110, {0x10d78c0, 0xc00054a000})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:1117 +0x529
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadResource(0xc00025fd70, {0x1639a88?, 0xc000702930?}, 0xc0000b2280)
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:708 +0x6c5
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadResource(0xc0003b2460, {0x1639a88?, 0xc00077bec0?}, 0xc00020e000)
github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:783 +0x309
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler({0x13d2760, 0xc0003b2460}, {0x1639a88, 0xc00077bec0}, 0xc000b9c000, 0x0)
github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:482 +0x1a6
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000193000, {0x1639a88, 0xc00077be30}, {0x163ea00, 0xc000214600}, 0xc000786000, 0xc0002af890, 0x2102608, 0x0)
google.golang.org/[email protected]/server.go:1369 +0xdf8
google.golang.org/grpc.(*Server).handleStream(0xc000193000, {0x163ea00, 0xc000214600}, 0xc000786000)
google.golang.org/[email protected]/server.go:1780 +0xe8b
google.golang.org/grpc.(*Server).serveStreams.func2.1()
google.golang.org/[email protected]/server.go:1019 +0x8b
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 29
google.golang.org/[email protected]/server.go:1030 +0x125

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

Expected Behavior

Expected to get the Switch imported

Actual Behavior

It fails with nothing imported to the state

Steps to Reproduce

Add a Virtual switch, add an uplink and migrate a VM to it. Run a new Terraform Plan

Environment Details

No response

Screenshots

No response

References

No response

@joshix3m joshix3m added bug Type: Bug needs-triage Status: Issue Needs Triage labels Dec 12, 2024
@github-actions github-actions bot added the crash Impact: Crash label Dec 12, 2024
Copy link

Hello, joshix3m! 🖐

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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