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

MP Resource import runs into endless loop #1481

Open
martinrohrbach opened this issue Dec 11, 2024 · 1 comment
Open

MP Resource import runs into endless loop #1481

martinrohrbach opened this issue Dec 11, 2024 · 1 comment
Assignees
Labels
bug Bug
Milestone

Comments

@martinrohrbach
Copy link
Contributor

Describe the bug

We're trying to specifically import a nsxt_logical_tier1_router resource with
NSX-T: 4.1.2.5
Provider: 3.7.1

But the import runs into an endless loop and never comes back. Note that the import works with provider version 3.7.0 so it must be a recent change.

I can see the resource just fine using this code here so communication and authentication works fine and the resource exists:

data "nsxt_logical_tier1_router" "trf-test" {
  display_name = "import-test-delete-me-if-seen-in-2025"
}

$ terraform plan
data.nsxt_logical_tier1_router.trf-test: Reading...
data.nsxt_logical_tier1_router.trf-test: Read complete after 0s [id=7790f680-bf9c-4835-9f35-eda70573fc42]

No changes. Your infrastructure matches the configuration.

But when I try to import the resource, the plan never comes back:

import {
  to = nsxt_logical_tier1_router.trf-test
  id = "7790f680-bf9c-4835-9f35-eda70573fc42"
}

resource "nsxt_logical_tier1_router" "trf-test" {
  description     = "trf-test"
  display_name    = "trf-test"
}

$ terraform plan
nsxt_logical_tier1_router.trf-test: Preparing import... [id=7790f680-bf9c-4835-9f35-eda70573fc42]
(hangs forever)

With TF_LOG=TRACE, we get the following:

$ TF_DEBUG="TRACE" terraform plan
... skipping to the actual import ...
nsxt_logical_tier1_router.trf-test: Preparing import... [id=7790f680-bf9c-4835-9f35-eda70573fc42]
2024-12-11T11:10:05.863+0100 [TRACE] GRPCProvider: ImportResourceState
2024-12-11T11:10:05.863+0100 [TRACE] GRPCProvider: GetProviderSchema
2024-12-11T11:10:05.863+0100 [TRACE] GRPCProvider: returning cached schema: EXTRA_VALUE_AT_END=[registry.terraform.io/vmware/nsxt](http://registry.terraform.io/vmware/nsxt)
2024-12-11T11:10:05.864+0100 [TRACE] provider.terraform-provider-nsxt_v3.7.1: Received request: tf_req_id=47f69b20-42f9-1ac8-ec7f-8777eb194b04 tf_resource_type=nsxt_logical_tier1_router tf_rpc=ImportResourceState @module=sdk.proto tf_proto_version=5.4 tf_provider_addr=provider @caller=[github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:881](http://github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:881) timestamp="2024-12-11T11:10:05.863+0100"
2024-12-11T11:10:05.864+0100 [TRACE] provider.terraform-provider-nsxt_v3.7.1: Sending request downstream: @module=sdk.proto tf_proto_version=5.4 tf_provider_addr=provider tf_resource_type=nsxt_logical_tier1_router @caller=[github.com/hashicorp/[email protected]/tfprotov5/internal/tf5serverlogging/downstream_request.go:20](http://github.com/hashicorp/[email protected]/tfprotov5/internal/tf5serverlogging/downstream_request.go:20) tf_req_id=47f69b20-42f9-1ac8-ec7f-8777eb194b04 tf_rpc=ImportResourceState timestamp="2024-12-11T11:10:05.864+0100"
2024-12-11T11:10:05.864+0100 [TRACE] provider.terraform-provider-nsxt_v3.7.1: Calling downstream: @module=sdk.helper_schema tf_req_id=47f69b20-42f9-1ac8-ec7f-8777eb194b04 tf_resource_type=nsxt_logical_tier1_router tf_rpc=ImportResourceState @caller=[github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/provider.go:385](http://github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/provider.go:385) tf_provider_addr=provider timestamp="2024-12-11T11:10:05.864+0100"
2024-12-11T11:10:05.873+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:05 Invoking action: "GET" and url: "https://nsx/api/v1/node/version": timestamp="2024-12-11T11:10:05.873+0100"
2024-12-11T11:10:06.228+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:06 [DEBUG] NSX version is 4.1.2.5.0.24150847: timestamp="2024-12-11T11:10:06.228+0100"
2024-12-11T11:10:06.232+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:06 Invoking action: "GET" and url: "https://nsx/api/v1/node/version": timestamp="2024-12-11T11:10:06.232+0100"
2024-12-11T11:10:06.627+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:06 [DEBUG] NSX version is 4.1.2.5.0.24150847: timestamp="2024-12-11T11:10:06.627+0100"
2024-12-11T11:10:06.627+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:06 Invoking action: "GET" and url: "https://nsx/api/v1/node/version": timestamp="2024-12-11T11:10:06.627+0100"
2024-12-11T11:10:06.979+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:06 [DEBUG] NSX version is 4.1.2.5.0.24150847: timestamp="2024-12-11T11:10:06.979+0100"
2024-12-11T11:10:06.979+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:06 Invoking action: "GET" and url: "https://nsx/api/v1/node/version": timestamp="2024-12-11T11:10:06.979+0100"
2024-12-11T11:10:07.339+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:07 [DEBUG] NSX version is 4.1.2.5.0.24150847: timestamp="2024-12-11T11:10:07.339+0100"
2024-12-11T11:10:07.339+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:07 Invoking action: "GET" and url: "https://nsx/api/v1/node/version": timestamp="2024-12-11T11:10:07.339+0100"
2024-12-11T11:10:07.719+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:07 [DEBUG] NSX version is 4.1.2.5.0.24150847: timestamp="2024-12-11T11:10:07.719+0100"
2024-12-11T11:10:07.719+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:07 Invoking action: "GET" and url: "https://nsx/api/v1/node/version": timestamp="2024-12-11T11:10:07.719+0100"
2024-12-11T11:10:08.071+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:08 [DEBUG] NSX version is 4.1.2.5.0.24150847: timestamp="2024-12-11T11:10:08.071+0100"
2024-12-11T11:10:08.072+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:08 Invoking action: "GET" and url: "https://nsx/api/v1/node/version": timestamp="2024-12-11T11:10:08.071+0100"
2024-12-11T11:10:08.479+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:08 [DEBUG] NSX version is 4.1.2.5.0.24150847: timestamp="2024-12-11T11:10:08.479+0100"
2024-12-11T11:10:08.479+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:08 Invoking action: "GET" and url: "https://nsx/api/v1/node/version": timestamp="2024-12-11T11:10:08.479+0100"
2024-12-11T11:10:08.807+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:08 [DEBUG] NSX version is 4.1.2.5.0.24150847: timestamp="2024-12-11T11:10:08.807+0100"
2024-12-11T11:10:08.807+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:08 Invoking action: "GET" and url: "https://nsx/api/v1/node/version": timestamp="2024-12-11T11:10:08.807+0100"
2024-12-11T11:10:09.147+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:09 [DEBUG] NSX version is 4.1.2.5.0.24150847: timestamp="2024-12-11T11:10:09.147+0100"
2024-12-11T11:10:09.147+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:09 Invoking action: "GET" and url: "https://nsx/api/v1/node/version": timestamp="2024-12-11T11:10:09.147+0100"
2024-12-11T11:10:09.548+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:09 [DEBUG] NSX version is 4.1.2.5.0.24150847: timestamp="2024-12-11T11:10:09.548+0100"
2024-12-11T11:10:09.549+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:09 Invoking action: "GET" and url: "https://nsx/api/v1/node/version": timestamp="2024-12-11T11:10:09.548+0100"
2024-12-11T11:10:09.847+0100 [TRACE] dag/walk: vertex "root" is waiting for "provider[\"[registry.terraform.io/vmware/nsxt\](http://registry.terraform.io/vmware/nsxt%5C)"] (close)"
2024-12-11T11:10:09.847+0100 [TRACE] dag/walk: vertex "provider[\"[registry.terraform.io/vmware/nsxt\](http://registry.terraform.io/vmware/nsxt%5C)"] (close)" is waiting for "nsxt_logical_tier1_router.trf-test (expand)"
2024-12-11T11:10:09.927+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:09 [DEBUG] NSX version is 4.1.2.5.0.24150847: timestamp="2024-12-11T11:10:09.927+0100"
2024-12-11T11:10:09.927+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:09 Invoking action: "GET" and url: "https://nsx/api/v1/node/version": timestamp="2024-12-11T11:10:09.927+0100"
2024-12-11T11:10:10.283+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:10 [DEBUG] NSX version is 4.1.2.5.0.24150847: timestamp="2024-12-11T11:10:10.283+0100"
2024-12-11T11:10:10.283+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:10 Invoking action: "GET" and url: "https://nsx/api/v1/node/version": timestamp="2024-12-11T11:10:10.283+0100"
2024-12-11T11:10:10.619+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:10 [DEBUG] NSX version is 4.1.2.5.0.24150847: timestamp="2024-12-11T11:10:10.619+0100"
2024-12-11T11:10:10.619+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:10 Invoking action: "GET" and url: "https://nsx/api/v1/node/version": timestamp="2024-12-11T11:10:10.619+0100"
2024-12-11T11:10:10.864+0100 [TRACE] dag/walk: vertex "root" is waiting for "nsxt_logical_tier1_router.trf-test"
2024-12-11T11:10:10.967+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:10 [DEBUG] NSX version is 4.1.2.5.0.24150847: timestamp="2024-12-11T11:10:10.967+0100"
2024-12-11T11:10:10.967+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:10 Invoking action: "GET" and url: "https://nsx/api/v1/node/version": timestamp="2024-12-11T11:10:10.967+0100"
2024-12-11T11:10:11.303+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:11 [DEBUG] NSX version is 4.1.2.5.0.24150847: timestamp="2024-12-11T11:10:11.303+0100"
2024-12-11T11:10:11.303+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:11 Invoking action: "GET" and url: "https://nsx/api/v1/node/version": timestamp="2024-12-11T11:10:11.303+0100"
2024-12-11T11:10:11.700+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:11 [DEBUG] NSX version is 4.1.2.5.0.24150847: timestamp="2024-12-11T11:10:11.699+0100"
2024-12-11T11:10:11.700+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:11 Invoking action: "GET" and url: "https://nsx/api/v1/node/version": timestamp="2024-12-11T11:10:11.700+0100"
2024-12-11T11:10:12.072+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:12 [DEBUG] NSX version is 4.1.2.5.0.24150847: timestamp="2024-12-11T11:10:12.071+0100"
2024-12-11T11:10:12.072+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:12 Invoking action: "GET" and url: "https://nsx/api/v1/node/version": timestamp="2024-12-11T11:10:12.072+0100"
2024-12-11T11:10:12.423+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:12 [DEBUG] NSX version is 4.1.2.5.0.24150847: timestamp="2024-12-11T11:10:12.423+0100"
2024-12-11T11:10:12.423+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:12 Invoking action: "GET" and url: "https://nsx/api/v1/node/version": timestamp="2024-12-11T11:10:12.423+0100"
2024-12-11T11:10:12.803+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:12 [DEBUG] NSX version is 4.1.2.5.0.24150847: timestamp="2024-12-11T11:10:12.803+0100"
2024-12-11T11:10:12.803+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:12 Invoking action: "GET" and url: "https://nsx/api/v1/node/version": timestamp="2024-12-11T11:10:12.803+0100"
2024-12-11T11:10:13.159+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:13 [DEBUG] NSX version is 4.1.2.5.0.24150847: timestamp="2024-12-11T11:10:13.159+0100"
2024-12-11T11:10:13.159+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:13 Invoking action: "GET" and url: "https://nsx/api/v1/node/version": timestamp="2024-12-11T11:10:13.159+0100"
2024-12-11T11:10:13.523+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:13 [DEBUG] NSX version is 4.1.2.5.0.24150847: timestamp="2024-12-11T11:10:13.523+0100"
2024-12-11T11:10:13.523+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:13 Invoking action: "GET" and url: "https://nsx/api/v1/node/version": timestamp="2024-12-11T11:10:13.523+0100"
2024-12-11T11:10:13.879+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:13 [DEBUG] NSX version is 4.1.2.5.0.24150847: timestamp="2024-12-11T11:10:13.879+0100"
2024-12-11T11:10:13.879+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:13 Invoking action: "GET" and url: "https://nsx/api/v1/node/version": timestamp="2024-12-11T11:10:13.879+0100"
2024-12-11T11:10:14.261+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:14 [DEBUG] NSX version is 4.1.2.5.0.24150847: timestamp="2024-12-11T11:10:14.261+0100"
2024-12-11T11:10:14.261+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:14 Invoking action: "GET" and url: "https://nsx/api/v1/node/version": timestamp="2024-12-11T11:10:14.261+0100"
2024-12-11T11:10:14.627+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:14 [DEBUG] NSX version is 4.1.2.5.0.24150847: timestamp="2024-12-11T11:10:14.627+0100"
2024-12-11T11:10:14.627+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:14 Invoking action: "GET" and url: "https://nsx/api/v1/node/version": timestamp="2024-12-11T11:10:14.627+0100"
2024-12-11T11:10:14.848+0100 [TRACE] dag/walk: vertex "provider[\"[registry.terraform.io/vmware/nsxt\](http://registry.terraform.io/vmware/nsxt%5C)"] (close)" is waiting for "nsxt_logical_tier1_router.trf-test (expand)"
2024-12-11T11:10:14.848+0100 [TRACE] dag/walk: vertex "root" is waiting for "provider[\"[registry.terraform.io/vmware/nsxt\](http://registry.terraform.io/vmware/nsxt%5C)"] (close)"
2024-12-11T11:10:14.991+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:14 [DEBUG] NSX version is 4.1.2.5.0.24150847: timestamp="2024-12-11T11:10:14.991+0100"
2024-12-11T11:10:14.991+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:14 Invoking action: "GET" and url: "https://nsx/api/v1/node/version": timestamp="2024-12-11T11:10:14.991+0100"
2024-12-11T11:10:15.379+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:15 [DEBUG] NSX version is 4.1.2.5.0.24150847: timestamp="2024-12-11T11:10:15.379+0100"
2024-12-11T11:10:15.379+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:15 Invoking action: "GET" and url: "https://nsx/api/v1/node/version": timestamp="2024-12-11T11:10:15.379+0100"
2024-12-11T11:10:15.723+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:15 [DEBUG] NSX version is 4.1.2.5.0.24150847: timestamp="2024-12-11T11:10:15.723+0100"
2024-12-11T11:10:15.723+0100 [INFO]  provider.terraform-provider-nsxt_v3.7.1: 2024/12/11 11:10:15 Invoking action: "GET" and url: "https://nsx/api/v1/node/version": timestamp="2024-12-11T11:10:15.723+0100"
2024-12-11T11:10:15.865+0100 [TRACE] dag/walk: vertex "root" is waiting for "nsxt_logical_tier1_router.trf-test"

... after that the cycle repeats endlessly.

Reproduction steps

  1. Import resource as specified above
  2. Import hangs forever

Expected behavior

Import should work with provider versions >= 3.7.1

Additional context

No response

@martinrohrbach martinrohrbach added the bug Bug label Dec 11, 2024
@salv-orlando
Copy link
Member

The only PR that could have caused this behaviour is #1384

Let's target this to 3.8.0 to try and unblock as soon as possible.

@salv-orlando salv-orlando added this to the v3.8.0 milestone Dec 13, 2024
@salv-orlando salv-orlando changed the title Resouere import runs into endless loop MP Resource import runs into endless loop Dec 13, 2024
@salv-orlando salv-orlando self-assigned this Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug
Projects
None yet
Development

No branches or pull requests

2 participants