Skip to content

nutanix_projects and nutanix_project throws error when there is external network associated to a project #337

Closed
@bhati-pradeep

Description

Nutanix Cluster Information

  • Nutanix Prism Central : pc.2021.9.0.1

Terraform Version

1.1.3

Affected Resource(s)

  • Datasource : nutanix_projects
  • Datasource : nutanix_project

Terraform Configuration Files

terraform {
  required_providers {
    nutanix = {
      source = "nutanix/nutanix"
      version = "1.2.2"
    }
  }
}

provider "nutanix" {
   username  = "<username>"
  password  = "<password>"
  endpoint  = "<ip>"
  insecure  = <true/false>
  port      = <port>
}

data "nutanix_projects" "prj1" {}

output "check" {
  value = data.nutanix_projects.prj1
}

Debug Output

2022-02-08T19:12:11.858+0530 [TRACE] vertex "data.nutanix_projects.prj1": visit complete, with errors
2022-02-08T19:12:11.858+0530 [TRACE] vertex "data.nutanix_projects.prj1": dynamic subgraph encountered errors: Invalid address to set: []string{"entities", "1", "external_network_list", "0", "kind"}
2022-02-08T19:12:11.858+0530 [ERROR] vertex "data.nutanix_projects.prj1" error: Invalid address to set: []string{"entities", "1", "external_network_list", "0", "kind"}
2022-02-08T19:12:11.858+0530 [TRACE] vertex "data.nutanix_projects.prj1": visit complete, with errors
2022-02-08T19:12:11.858+0530 [TRACE] vertex "data.nutanix_projects.prj1 (expand)": dynamic subgraph encountered errors: Invalid address to set: []string{"entities", "1", "external_network_list", "0", "kind"}
2022-02-08T19:12:11.858+0530 [ERROR] vertex "data.nutanix_projects.prj1 (expand)" error: Invalid address to set: []string{"entities", "1", "external_network_list", "0", "kind"}
2022-02-08T19:12:11.858+0530 [TRACE] vertex "data.nutanix_projects.prj1 (expand)": visit complete, with errors
2022-02-08T19:12:11.858+0530 [TRACE] dag/walk: upstream of "provider[\"registry.terraform.io/nutanix/nutanix\"] (close)" errored, so skipping
2022-02-08T19:12:11.858+0530 [TRACE] dag/walk: upstream of "output.check" errored, so skipping
2022-02-08T19:12:11.858+0530 [TRACE] dag/walk: upstream of "root" errored, so skipping
2022-02-08T19:12:11.858+0530 [INFO]  backend/local: plan operation completed
╷
│ Error: Invalid address to set: []string{"entities", "1", "external_network_list", "0", "kind"}
│ 
│   with data.nutanix_projects.prj1,
│   on main.tf line 19, in data "nutanix_projects" "prj1":
│   19: data "nutanix_projects" "prj1" {
│ 

Expected Behavior

It shouldn't error out. It should print project data

Actual Behavior

It errors out with error: Invalid address to set: []string{"entities", "1", "external_network_list", "0", "kind"}

Steps to Reproduce

  1. Create main.tf file having above config
  2. Run terraform init
  3. Run terraform plan

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions