Skip to content

segfault while handling nutanix_user_group resources #883

@phillipmacey

Description

@phillipmacey

Nutanix Cluster Information

PC 2024.3.1.4 (also had the same problem on older versions. Probably 2024.2 ish)

Terraform Version

Tested months ago using 1.x terraform versions having similar issues but I don't have the details captured. Restarted testing today initially using 1.11.3 and subsequently upgraded to 1.12.2 with no change. (MacOS build installed via brew)
terraform -v
Terraform v1.11.3
on darwin_arm64

  • provider registry.terraform.io/nutanix/nutanix v2.2.1

Re-tested on updated version (same behaviour):
terraform -v
Terraform v1.12.2
on darwin_arm64

  • provider registry.terraform.io/nutanix/nutanix v2.2.1

Affected Resource(s)

  • resource.nutanix_user_group

Terraform Configuration Files

I have attempted to strip out all the bits that are not relevant to the crash based on my understanding that it is only the nutanix_user_group resource that has issues. (If I target some other non-group resource, terraform seems to run just fine. There are a number of other resources in my full code base)

variable "idp" {
  type          = map(string)
  description   = "Maps an Identity Provider by name to its UUID for ease of use. idp[\"name_of_idp\"] gives you the uuid"
}

variable "tenants" {
  type        = map(object({
    name                      = string,
    description               = string,
    accessGroupName           = optional(string, null)
    adminGroupName            = optional(string, null)
    # use this to map into the idp["name_of_idp"] variable
    idp                       = optional(string, null)
  }))
  default     = {}
  description = "List of tenants and their required attributes"
}

idp     = {
  "name-of-our-idp": "uuid-of-our-idp"
}


tenants = {
  "org-test"                = {
    name                      = "org Test"
    description               = "A test tenant for org to use"
  }
}


resource "nutanix_user_groups" "tenantBasicAccessGroups" {
  for_each      = var.tenants
  saml_user_group {
    # If accessGroupName is set for the tenant, use it. Otherwise, default to 'xxxx idp group'
    name        = coalesce(each.value.accessGroupName, join("", [each.key, " idp group"]))
    idp_uuid    = var.idp["name-of-our-idp"]
  }
}

Debug Output

https://gist.github.com/phillipmacey/8001da637def6e6c5afaa60a3b05bba8

Panic Output

Terraform passed on a segfault from the nutanix provider:

https://gist.github.com/phillipmacey/1a6ba93c042d0321036adce463157809

Expected Behavior

No segfaults, any errors handled cleanly

Actual Behavior

segfault bombed out the whole terraform run

Steps to Reproduce

  1. Run any terraform plan or apply command: `terraform apply -target 'name-of-nutanix_user_group-resource'

Without targeting, the same fault still happens when it arrives at the nutanix_user_group resources. Other non-group resources can be targeted to get a successful run. (Didn't include any of the HCL for those non-group resources above but they do exist)

Important Factors

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions