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

Error: The terraform-provider-nutanix_v1.9.5.exe plugin crashed! #689

Open
honestabe00 opened this issue Sep 19, 2024 · 2 comments
Open
Labels

Comments

@honestabe00
Copy link

Nutanix Cluster Information

Terraform Version

Terraform v1.9.5
on windows_386

  • provider registry.terraform.io/nutanix/nutanix v1.9.5

Affected Resource(s)

with nutanix_virtual_machine.mktest,
│ on main.tf line 31, in resource "nutanix_virtual_machine" "mktest":
│ 31: resource "nutanix_virtual_machine" "mktest" {

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file.
terraform {
  required_providers {
    nutanix = {
      source  = "nutanix/nutanix"
      version = "1.9.5"
    }
  }
}

data "nutanix_cluster" "cluster" {
  name = var.cluster_name
}
data "nutanix_subnet" "subnet" {
  subnet_name = var.subnet_name
}

provider "nutanix" {
  username     = var.user
  password     = var.password
  endpoint     = var.endpoint
  insecure     = true
  wait_timeout = 60
}

resource "nutanix_image" "image" {
  name        = "Arch Linux"
  description = "Arch-Linux-x86_64-basic-20210401.18564"
  source_uri  = "https://mirror.pkgbuild.com/images/latest/Arch-Linux-x86_64-basic-20210415.20050.qcow2"
}

resource "nutanix_virtual_machine" "mktest" {
  name                 = "mktest"
  cluster_uuid         = data.nutanix_cluster.cluster.id
  num_vcpus_per_socket = "2"
  num_sockets          = "1"
  memory_size_mib      = 1024

  disk_list {
    data_source_reference = {
      kind = "image"
      uuid = nutanix_image.image.id
    }
  }

  disk_list {
    disk_size_bytes = 10 * 1024 * 1024 * 1024
    device_properties {
      device_type = "DISK"
      disk_address = {
        "adapter_type" = "SCSI"
        "device_index" = "1"
      }
    }
  }
  nic_list {
    subnet_uuid = data.nutanix_subnet.subnet.id
  }
}

### Debug Output
<!---
Plan: 1 to add, 0 to change, 0 to destroy.
╷
│ Warning: Disabled Providers: foundation, ndb. Please provide required fields in provider configuration to enable them. Refer docs.
│
│   with provider["registry.terraform.io/nutanix/nutanix"],
│   on main.tf line 17, in provider "nutanix":
│   17: provider "nutanix" {
│
╵
╷
│ Error: Plugin did not respond
│
│   with nutanix_virtual_machine.mktest,
│   on main.tf line 31, in resource "nutanix_virtual_machine" "mktest":31: resource "nutanix_virtual_machine" "mktest" {
│
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).PlanResourceChange call. The plugin   
│ logs may contain more details.
╵

Stack trace from the terraform-provider-nutanix_v1.9.5.exe plugin:

panic: Error reading level config: strconv.ParseInt: parsing "10737418240": value out of range

goroutine 44 [running]:
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ResourceData).get(0x125f5810, {0x1293b140, 0x1, 0x1}, 0x12)     
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.10.1/helper/schema/resource_data.go:553 +0x279
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ResourceData).getChange(0x125f5810, {0xed5e02, 0x9}, 0x1, 0x12) 
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.10.1/helper/schema/resource_data.go:524 +0x15f
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ResourceData).diffChange(0x125f5810, {0xed5e02, 0x9})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.10.1/helper/schema/resource_data.go:501 +0x63
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.diffList(0x125d79e0, {0xed5e02, 0x9}, 0x125ec5a0, 0x124599d4, {0x100fd94, 0x125f5810}, 0x0)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.10.1/helper/schema/schema.go:1001 +0x4f
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.diff(0x125d79e0, {0xed5e02, 0x9}, 0x125ec5a0, 0x125f57c0, {0x100fd94, 0x125f5810}, 0x0)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.10.1/helper/schema/schema.go:962 +0xb6
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.Diff(0x125d79e0, {0x1005144, 0x12e5bcb0}, 0x129f2a80, 0x12e5de30, 0xf18f40, {0xdb7280, 0x12d867c0}, 0x0)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.10.1/helper/schema/schema.go:525 +0x291
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).SimpleDiff(0x125b1f10, {0x1005144, 0x12e5bcb0}, 0x129f2a80, 0x12e5de30, {0xdb7280, 0x12d867c0})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.10.1/helper/schema/resource.go:517 +0x6f
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).PlanResourceChange(0x129b04b0, {0x1005144, 0x12e5bcb0}, 0x12e5bd10)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.10.1/helper/schema/grpc_provider.go:703 +0xa6c
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).PlanResourceChange(0x1245a400, {0x10051a4, 0x12e5d740}, 0x12cbcd40)
        github.com/hashicorp/terraform-plugin-go@v0.5.0/tfprotov5/tf5server/server.go:578 +0x374
400}, {0x10051a4, 0x12e5d740}, 0x12e5baa0, 0x0)
        github.com/hashicorp/terraform-plugin-go@v0.5.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:362 +0x18a
google.golang.org/grpc.(*Server).processUnaryRPC(0x124ca7e0, {0x1013934, 0x12628200}, 0x128d8c60, 0x1299d6f8, 0x14d1494, 0x0)        google.golang.org/grpc@v1.32.0/server.go:1194 +0xd30
google.golang.org/grpc.(*Server).handleStream(0x124ca7e0, {0x1013934, 0x12628200}, 0x128d8c60, 0x0)
        google.golang.org/grpc@v1.32.0/server.go:1517 +0xa2d
google.golang.org/grpc.(*Server).serveStreams.func1.2(0x1260e2c0, 0x124ca7e0, {0x1013934, 0x12628200}, 0x128d8c60)
        google.golang.org/grpc@v1.32.0/server.go:859 +0x92
created by google.golang.org/grpc.(*Server).serveStreams.func1
        google.golang.org/grpc@v1.32.0/server.go:857 +0x1a7

Error: The terraform-provider-nutanix_v1.9.5.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.
--->
### Panic Output
<!--- If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the `crash.log`. --->
### Expected Behavior
<!--- What should have happened? --->
Deploy Nutanix VM mktest
<!--- What actually happened? --->
### Steps to Reproduce
<!--- Please list the steps required to reproduce the issue. --->
1. `terraform apply`
### Important Factors
<!--- Are there anything atypical about your accounts that we should know?
For example if you are using a Prism Element or Prism Central -- >### References
<!---
Information about referencing Github Issues: https://help.github.com/articles/basic-writing-and-formatting-syntax/#referencing-issues-and-pull-requests
Are there any other GitHub issues (open or closed) or pull requests that should be linked here? Vendor documentation? For example:
--->
* #0000 <!---Github Issue number --->
@Haroon-Dweikat-Ntx
Copy link
Collaborator

Hi @honestabe00

This isn't a provider issue, it's related to the Terraform SDK. It often happens when users accidentally install the 32-bit version of Terraform, which can still run on 64-bit systems.

Integer Limitations:

On 32-bit systems, the maximum signed integer is 2,147,483,647 (2³¹ - 1). If you use a value larger than this, like 10,737,418,240 (10¹⁰, ~10 GB), it exceeds the limit. This triggers a strconv.ParseInt error, throwing "value out of range."

The 64-bit version, however, can handle integers up to 9,223,372,036,854,775,807 (2⁶³ - 1), which is why the error doesn't appear when using it.

Solution:

Install the 64-bit version of Terraform to resolve this issue.

For example, if you check your Terraform version and see:

Terraform v1.9.5
on windows_386

You're using the 32-bit version. After downloading the 64-bit version, the output should look like this:

Terraform v1.9.5
on windows_amd64

This will fix the integer limit problem.

@honestabe00
Copy link
Author

honestabe00 commented Oct 1, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: This is need to review
Development

No branches or pull requests

3 participants