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

Terraform unable to set CIUPGRADE config, regardless of running as root or not, using API token #1291

Closed
Tanchwa opened this issue May 13, 2024 · 3 comments · Fixed by #1295
Labels
🐛 bug Something isn't working

Comments

@Tanchwa
Copy link

Tanchwa commented May 13, 2024

Describe the bug
Terraform VM Creation using API token auth mechanisms
Returns 500 error for both a root token and a terraform user token

To Reproduce
Steps to reproduce the behavior:

  1. Creating a fresh VM instance using an API token authentication mechanism
  2. run plan and apply steps
  3. apply goes through for everything except VMs
  4. Errors and logs shown are after running the apply using the root@pam API token, but are the same as the terraform user account token.
  5. ERROR:
│ Error: error creating VM: received an HTTP 500 response - Reason: only root can set 'ciupgrade' config
│
│   with module.talos_worker[1].proxmox_virtual_environment_vm.talos_worker_vm[0],
│   on Modules/Talos/main.tf line 70, in resource "proxmox_virtual_environment_vm" "talos_worker_vm":
│   70: resource "proxmox_virtual_environment_vm" "talos_worker_vm" {
│
╵

Please also provide a minimal Terraform configuration that reproduces the issue.

Provider config

terraform {
  required_version = "~> 1.8.0"
  #backend "azurerm" {
  #  #backend set during terraform init
  #}

  required_providers {
    proxmox = {
      source  = "bpg/proxmox"
      version = "~> 0.54.0"
    }
    random = {
      source  = "hashicorp/random"
      version = "~> 3.0"
    }
    tls = {
      source  = "hashicorp/tls"
      version = "~> 3.0"
    }
  }
}

provider "proxmox" {
  endpoint  = "https://172.31.0.200:8006/"
  api_token = var.proxmox_api_token
  insecure  = true
}
resource "proxmox_virtual_environment_vm" "talos_controlplane_vm" {
  count = var.talos.vm_type == lower("controlplane") ? 1 : 0

  name        = var.talos.node_name
  description = "Managed by Terraform"
  tags        = ["terraform", "talos"]

  node_name = var.proxmox_node_name
  vm_id     = 200

  agent {
    # read 'Qemu guest agent' section, change to true only when ready
    enabled = false
  }

  startup {
    order      = "4"
    up_delay   = "60"
    down_delay = "60"
  }

  cpu {
    cores   = 4
    sockets = 1
    type    = "host"
    flags   = ["+aes"]
  }

  memory {
    dedicated = 4000
  }

  disk {
    datastore_id = "local-lvm"
    file_id      = proxmox_virtual_environment_download_file.talos_img.id
    interface    = "scsi0"
  }

  initialization {
    ip_config {
      ipv4 {
        address = "dhcp"
      }
    }

    user_account {
      keys     = [trimspace(tls_private_key.talos_vm_key.public_key_openssh)]
      password = random_password.talos_vm_password.result
      username = "talos"
    }

    #user_data_file_id = proxmox_virtual_environment_file.cloud_config.id
  }

  network_device {
    bridge = "vmbr0"
  }

  operating_system {
    type = "l26"
  }

  tpm_state {
    version = "v2.0"
  }

  serial_device {}
}

Expected behavior
Provider can create the resources as defined

  • Single or clustered Proxmox:
  • Proxmox version: Linux 6.2.16-3-pve
  • Provider version (ideally it should be the latest version): 0.54.0
  • Terraform/OpenTofu version: Terraform v1.8.1
  • OS (where you run Terraform/OpenTofu from): WSL2 5.15.146.1-microsoft-standard-WSL2 on windows 11
  • Debug logs (TF_LOG=DEBUG terraform apply):

2024-05-13T06:25:23.004-0400 [WARN] Provider "registry.terraform.io/bpg/proxmox" produced an invalid plan for module.talos_controlplane[0].proxmox_virtual_environment_vm.talos_controlplane_vm[0], but we are tolerating it because it is using the legacy plugin SDK.
The following problems may be the cause of any confusing errors from downstream operations:
- .timeout_clone: planned value cty.NumberIntVal(1800) for a non-computed attribute
- .tablet_device: planned value cty.True for a non-computed attribute
- .protection: planned value cty.False for a non-computed attribute
- .keyboard_layout: planned value cty.StringVal("en-us") for a non-computed attribute
- .scsi_hardware: planned value cty.StringVal("virtio-scsi-pci") for a non-computed attribute
- .migrate: planned value cty.False for a non-computed attribute
- .on_boot: planned value cty.True for a non-computed attribute
- .timeout_create: planned value cty.NumberIntVal(1800) for a non-computed attribute
- .timeout_migrate: planned value cty.NumberIntVal(1800) for a non-computed attribute
- .timeout_move_disk: planned value cty.NumberIntVal(1800) for a non-computed attribute
- .bios: planned value cty.StringVal("seabios") for a non-computed attribute
- .timeout_start_vm: planned value cty.NumberIntVal(1800) for a non-computed attribute
- .timeout_stop_vm: planned value cty.NumberIntVal(300) for a non-computed attribute
- .template: planned value cty.False for a non-computed attribute
- .reboot: planned value cty.False for a non-computed attribute
- .acpi: planned value cty.True for a non-computed attribute
- .timeout_shutdown_vm: planned value cty.NumberIntVal(1800) for a non-computed attribute
- .started: planned value cty.True for a non-computed attribute
- .stop_on_destroy: planned value cty.False for a non-computed attribute
- .timeout_reboot: planned value cty.NumberIntVal(1800) for a non-computed attribute
- .agent[0].type: planned value cty.StringVal("virtio") for a non-computed attribute
- .agent[0].timeout: planned value cty.StringVal("15m") for a non-computed attribute
- .agent[0].trim: planned value cty.False for a non-computed attribute
- .memory[0].keep_hugepages: planned value cty.False for a non-computed attribute
- .memory[0].shared: planned value cty.NumberIntVal(0) for a non-computed attribute
- .memory[0].floating: planned value cty.NumberIntVal(0) for a non-computed attribute
- .initialization[0].upgrade: planned value cty.True for a non-computed attribute
- .initialization[0].datastore_id: planned value cty.StringVal("local-lvm") for a non-computed attribute
- .network_device[0].model: planned value cty.StringVal("virtio") for a non-computed attribute
- .network_device[0].mtu: planned value cty.NumberIntVal(0) for a non-computed attribute
- .network_device[0].rate_limit: planned value cty.NumberIntVal(0) for a non-computed attribute
- .network_device[0].vlan_id: planned value cty.NumberIntVal(0) for a non-computed attribute
- .network_device[0].enabled: planned value cty.True for a non-computed attribute
- .network_device[0].firewall: planned value cty.False for a non-computed attribute
- .network_device[0].queues: planned value cty.NumberIntVal(0) for a non-computed attribute
- .serial_device[0].device: planned value cty.StringVal("socket") for a non-computed attribute
- .cpu[0].architecture: planned value cty.StringVal("x86_64") for a non-computed attribute
- .cpu[0].hotplugged: planned value cty.NumberIntVal(0) for a non-computed attribute
- .cpu[0].limit: planned value cty.NumberIntVal(0) for a non-computed attribute
- .cpu[0].numa: planned value cty.False for a non-computed attribute
- .cpu[0].units: planned value cty.NumberIntVal(1024) for a non-computed attribute
- .disk[0].backup: planned value cty.True for a non-computed attribute
- .disk[0].discard: planned value cty.StringVal("ignore") for a non-computed attribute
- .disk[0].size: planned value cty.NumberIntVal(8) for a non-computed attribute
- .disk[0].replicate: planned value cty.True for a non-computed attribute
- .disk[0].ssd: planned value cty.False for a non-computed attribute
- .disk[0].aio: planned value cty.StringVal("io_uring") for a non-computed attribute
- .disk[0].cache: planned value cty.StringVal("none") for a non-computed attribute
- .disk[0].iothread: planned value cty.False for a non-computed attribute
- .tpm_state[0].datastore_id: planned value cty.StringVal("local-lvm") for a non-computed attribute
module.talos_controlplane[0].proxmox_virtual_environment_vm.talos_controlplane_vm[0]: Creating...
2024-05-13T06:25:23.007-0400 [INFO] Starting apply for module.talos_controlplane[0].proxmox_virtual_environment_vm.talos_controlplane_vm[0]
2024-05-13T06:25:23.008-0400 [DEBUG] module.talos_worker[0].proxmox_virtual_environment_vm.talos_worker_vm[0]: applying the planned Create change
2024-05-13T06:25:23.009-0400 [DEBUG] module.talos_worker[1].proxmox_virtual_environment_vm.talos_worker_vm[0]: applying the planned Create change
2024-05-13T06:25:23.010-0400 [DEBUG] module.talos_controlplane[0].proxmox_virtual_environment_vm.talos_controlplane_vm[0]: applying the planned Create change
2024-05-13T06:25:23.014-0400 [DEBUG] provider.terraform-provider-proxmox_v0.54.0: [DEBUG] setting computed for "network_interface_names" from ComputedKeys
2024-05-13T06:25:23.016-0400 [DEBUG] provider.terraform-provider-proxmox_v0.54.0: [DEBUG] setting computed for "ipv6_addresses" from ComputedKeys
2024-05-13T06:25:23.016-0400 [DEBUG] provider.terraform-provider-proxmox_v0.54.0: [DEBUG] setting computed for "ipv4_addresses" from ComputedKeys
2024-05-13T06:25:23.016-0400 [DEBUG] provider.terraform-provider-proxmox_v0.54.0: [DEBUG] setting computed for "ipv6_addresses" from ComputedKeys
2024-05-13T06:25:23.017-0400 [DEBUG] provider.terraform-provider-proxmox_v0.54.0: [DEBUG] setting computed for "mac_addresses" from ComputedKeys
2024-05-13T06:25:23.019-0400 [DEBUG] provider.terraform-provider-proxmox_v0.54.0: [DEBUG] setting computed for "ipv6_addresses" from ComputedKeys
2024-05-13T06:25:23.019-0400 [DEBUG] provider.terraform-provider-proxmox_v0.54.0: [DEBUG] setting computed for "ipv4_addresses" from ComputedKeys
2024-05-13T06:25:23.020-0400 [DEBUG] provider.terraform-provider-proxmox_v0.54.0: [DEBUG] setting computed for "mac_addresses" from ComputedKeys
2024-05-13T06:25:23.020-0400 [DEBUG] provider.terraform-provider-proxmox_v0.54.0: [DEBUG] setting computed for "mac_addresses" from ComputedKeys
2024-05-13T06:25:23.020-0400 [DEBUG] provider.terraform-provider-proxmox_v0.54.0: [DEBUG] setting computed for "network_interface_names" from ComputedKeys
2024-05-13T06:25:23.020-0400 [DEBUG] provider.terraform-provider-proxmox_v0.54.0: [DEBUG] setting computed for "network_interface_names" from ComputedKeys
2024-05-13T06:25:23.020-0400 [DEBUG] provider.terraform-provider-proxmox_v0.54.0: [DEBUG] setting computed for "ipv4_addresses" from ComputedKeys
2024-05-13T06:25:23.024-0400 [DEBUG] provider.terraform-provider-proxmox_v0.54.0: Sending HTTP Request: tf_http_req_body="acpi=1&agent=enabled%3D0%2Cfstrim_cloned_disks%3D0%2Ctype%3Dvirtio&balloon=0&bios=seabios&boot=order%3Dscsi0%3Bnet0&cipassword=dtCtPTTkFIFjAAyH&ciupgrade=1&ciuser=talos&cores=2&cpu=cputype%3Dhost%2Cflags%3D%2Baes&cpuunits=1024&description=Managed+by+Terraform&ide2=file%3Dlocal-lvm%3Acloudinit%2Cmedia%3Dcdrom%2C&ipconfig0=ip%3Ddhcp&keyboard=en-us&memory=4000&name=talos-worker0&net0=model%3Dvirtio%2Cbridge%3Dvmbr0%2Cfirewall%3D0&numa=0&onboot=1&ostype=l26&protection=0&scsihw=virtio-scsi-pci&serial0=socket&sockets=1&sshkeys=ssh-rsa%2520AAAAB3NzaC1yc2EAAAADAQABAAABAQCzJcC11bZqe%252Bucmk4Hq5plmMvjb7gdQL7hFOvdp%252BZZTvxPD7rIYASTqOcFP4GmmJQoVA1f79PIGXC4g6J6m%252FO8bIhIkPstPziYCBLqdrpd9PjOGvN3speWBVGtc%252F5VEMEI8v4H%252BhGaZ8Z19DBfPFo8BqgZKDA%252BTU0itOOm6yTD41h1JjWukdJ8xqZ7ZdBj1JjuRMHAy%252BeLgbh%252BioH58N0pZl72W1OI5AgPovPkdQ7dWnuQluR3SXDTHTjTMrXpZKUKw2O0mzNwxZFxe5m42b6SstyM%252BKHkkkAAfIWdVAXLLjPhzAWppjdqrkbnf5WQVV%252BePz4uFQyWhWBMw%252BTGPHsX&startup=order%3D4%2Cup%3D60%2Cdown%3D60&tablet=1&tags=talos%3Bterraform&template=0&tpmstate0=file%3Dlocal-lvm%3A1%2Cversion%3Dv2.0&vga=memory%3D16%2Ctype%3Dstd&vmid=200" tf_http_req_uri=/api2/json/nodes/proxmox/qemu tf_rpc=ApplyResourceChange Accept=application/json Authorization="PVEAPIToken=root@pam!provider=REDACTED" Content-Length=1124 Content-Type=application/x-www-form-urlencoded Accept-Encoding=gzip tf_http_trans_id=4f50df46-2a39-7427-8ec2-1c74f5ded476 tf_mux_provider=tf5to6server.v5tov6Server tf_req_id=b797e86a-7ac6-07a0-f261-ff086da22f67 tf_resource_type=proxmox_virtual_environment_vm @caller=github.com/hashicorp/terraform-plugin-sdk/v2@v2.33.0/helper/logging/logging_http_transport.go:162 Host=172.31.0.200:8006 tf_http_req_method=POST tf_http_req_version=HTTP/1.1 tf_provider_addr=registry.terraform.io/bpg/proxmox @module=proxmox User-Agent=Go-http-client/1.1 tf_http_op_type=request timestamp=2024-05-13T06:25:23.024-0400
2024-05-13T06:25:23.025-0400 [DEBUG] provider.terraform-provider-proxmox_v0.54.0: Sending HTTP Request: User-Agent=Go-http-client/1.1 tf_http_req_method=POST tf_http_req_version=HTTP/1.1 tf_mux_provider=tf5to6server.v5tov6Server tf_resource_type=proxmox_virtual_environment_vm @module=proxmox tf_rpc=ApplyResourceChange Host=172.31.0.200:8006 tf_http_op_type=request tf_provider_addr=registry.terraform.io/bpg/proxmox @caller=github.com/hashicorp/terraform-plugin-sdk/v2@v2.33.0/helper/logging/logging_http_transport.go:162 Authorization="PVEAPIToken=root@pam!provider=REDACTED" Accept-Encoding=gzip Content-Length=1108 tf_http_req_uri=/api2/json/nodes/proxmox/qemu tf_http_trans_id=1e98bbdf-bbfd-284a-f942-c00f670899b1 tf_req_id=3df69d0e-0f56-efa7-d596-5f8231ebcd76 Accept=application/json Content-Type=application/x-www-form-urlencoded tf_http_req_body="acpi=1&agent=enabled%3D0%2Cfstrim_cloned_disks%3D0%2Ctype%3Dvirtio&balloon=0&bios=seabios&boot=order%3Dscsi0%3Bnet0&cipassword=MxCYLtlR1qoR67Ye&ciupgrade=1&ciuser=talos&cores=2&cpu=cputype%3Dhost%2Cflags%3D%2Baes&cpuunits=1024&description=Managed+by+Terraform&ide2=file%3Dlocal-lvm%3Acloudinit%2Cmedia%3Dcdrom%2C&ipconfig0=ip%3Ddhcp&keyboard=en-us&memory=4000&name=talos-worker1&net0=model%3Dvirtio%2Cbridge%3Dvmbr0%2Cfirewall%3D0&numa=0&onboot=1&ostype=l26&protection=0&scsihw=virtio-scsi-pci&serial0=socket&sockets=1&sshkeys=ssh-rsa%2520AAAAB3NzaC1yc2EAAAADAQABAAABAQDfA%252FdASRCJWxuVhEz1qr9WTlnre71KfdNApV1bJrYiNSPaUi1fdA3wDq9XutT8koIEe0WOus1tCDgZLc1MZEyShze78RDaL89AEBVbLEYTaIXPao937lqY1ReoO8fPqfC0zYr5UNDe%252FaHFSdlHJUQUGKEmN0o%252F%252BLcDwjX7Kp3Qv3QqMAV7tjerS%252BqVnnWCdvYKIqUj6nthOQg4Ell0toW43qbVlDk3x8YhwQPu7VwShuBSImDxdtCIKJqzNE1UPPR7Yc36n6i1lffmfuwpckJNmbIglago4u%252FbcHtYOsUtztmsoWdyPs42mknGr%252FEt4dX5pYPU4wf4W3QanPkiNamR&startup=order%3D4%2Cup%3D60%2Cdown%3D60&tablet=1&tags=talos%3Bterraform&template=0&tpmstate0=file%3Dlocal-lvm%3A1%2Cversion%3Dv2.0&vga=memory%3D16%2Ctype%3Dstd&vmid=200" timestamp=2024-05-13T06:25:23.024-0400
2024-05-13T06:25:23.025-0400 [DEBUG] provider.terraform-provider-proxmox_v0.54.0: Sending HTTP Request: Accept=application/json tf_http_req_uri=/api2/json/nodes/proxmox/qemu tf_rpc=ApplyResourceChange @module=proxmox tf_resource_type=proxmox_virtual_environment_vm Accept-Encoding=gzip Authorization="PVEAPIToken=root@pam!provider=REDACTED" Content-Length=1114 Host=172.31.0.200:8006 tf_http_req_body="acpi=1&agent=enabled%3D0%2Cfstrim_cloned_disks%3D0%2Ctype%3Dvirtio&balloon=0&bios=seabios&boot=order%3Dscsi0%3Bnet0&cipassword=zQOfj%40X5czTvNw%40L&ciupgrade=1&ciuser=talos&cores=4&cpu=cputype%3Dhost%2Cflags%3D%2Baes&cpuunits=1024&description=Managed+by+Terraform&ide2=file%3Dlocal-lvm%3Acloudinit%2Cmedia%3Dcdrom%2C&ipconfig0=ip%3Ddhcp&keyboard=en-us&memory=4000&name=talos-controlplane0&net0=model%3Dvirtio%2Cbridge%3Dvmbr0%2Cfirewall%3D0&numa=0&onboot=1&ostype=l26&protection=0&scsihw=virtio-scsi-pci&serial0=socket&sockets=1&sshkeys=ssh-rsa%2520AAAAB3NzaC1yc2EAAAADAQABAAABAQCihF1x9dkqfz2ktEExJmDlmG1z%252Bci8c9RmZtGCPnswT3g5AY8pozpI9ZKN4GuXXGG5V36uvKpMTtDUH3o0lHgzeqZCEBIiAVref532NOP5dZhYqlOVwwKM28GhbriW90zRGxoKDoPoDyhlohFkBqj2EuSRruSDCP4YLEn1TMwsAjtxPdyapeI9cbsNwmMY9%252F07WYlDV%252BF3rdMKvkiFtyvMxC4JC0En6HbBT9xNnpDrtmnS7wix9m%252F1I3V%252FRZFSedCbf3%252FOaqd9Jy3ronUiG4Lxv1kEGlvzCEq6q6XfXP9mPAfRUoS8hrobYhgdWjUiDl36ubA0xXLqkxMaZ7HmaJ9J&startup=order%3D4%2Cup%3D60%2Cdown%3D60&tablet=1&tags=talos%3Bterraform&template=0&tpmstate0=file%3Dlocal-lvm%3A1%2Cversion%3Dv2.0&vga=memory%3D16%2Ctype%3Dstd&vmid=200" tf_req_id=1ff46a22-30b2-0b58-b28f-acc175466e33 @caller=github.com/hashicorp/terraform-plugin-sdk/v2@v2.33.0/helper/logging/logging_http_transport.go:162 User-Agent=Go-http-client/1.1 tf_http_op_type=request tf_http_req_method=POST tf_http_req_version=HTTP/1.1 tf_http_trans_id=0853f5ea-1430-129c-9c66-4c4c76aea6f2 tf_mux_provider=tf5to6server.v5tov6Server Content-Type=application/x-www-form-urlencoded tf_provider_addr=registry.terraform.io/bpg/proxmox timestamp=2024-05-13T06:25:23.024-0400
2024-05-13T06:25:24.309-0400 [DEBUG] provider.terraform-provider-proxmox_v0.54.0: Received HTTP Response: Server=pve-api-daemon/3.0 tf_http_res_status_code=500 tf_resource_type=proxmox_virtual_environment_vm @caller=github.com/hashicorp/terraform-plugin-sdk/v2@v2.33.0/helper/logging/logging_http_transport.go:162 Cache-Control=max-age=0 Pragma=no-cache tf_mux_provider=tf5to6server.v5tov6Server tf_rpc=ApplyResourceChange Content-Type=application/json;charset=UTF-8 Expires="Mon, 13 May 2024 10:25:25 GMT" tf_http_res_body="{"data":null}" tf_http_res_version=HTTP/1.1 tf_provider_addr=registry.terraform.io/bpg/proxmox @module=proxmox Date="Mon, 13 May 2024 10:25:25 GMT" tf_http_op_type=response tf_http_res_status_reason="500 only root can set 'ciupgrade' config" tf_http_trans_id=1e98bbdf-bbfd-284a-f942-c00f670899b1 tf_req_id=3df69d0e-0f56-efa7-d596-5f8231ebcd76 Content-Length=13 timestamp=2024-05-13T06:25:24.309-0400
2024-05-13T06:25:24.311-0400 [ERROR] provider.terraform-provider-proxmox_v0.54.0: Response contains error diagnostic: @module=sdk.proto diagnostic_severity=ERROR tf_proto_version=6.4 @caller=github.com/hashicorp/terraform-plugin-go@v0.22.2/tfprotov6/internal/diag/diagnostics.go:58 diagnostic_summary="error creating VM: received an HTTP 500 response - Reason: only root can set 'ciupgrade' config" tf_provider_addr=registry.terraform.io/bpg/proxmox tf_req_id=3df69d0e-0f56-efa7-d596-5f8231ebcd76 tf_resource_type=proxmox_virtual_environment_vm tf_rpc=ApplyResourceChange diagnostic_detail="" timestamp=2024-05-13T06:25:24.310-0400
2024-05-13T06:25:24.326-0400 [DEBUG] State storage *statemgr.Filesystem declined to persist a state snapshot
2024-05-13T06:25:24.327-0400 [ERROR] vertex "module.talos_worker[1].proxmox_virtual_environment_vm.talos_worker_vm[0]" error: error creating VM: received an HTTP 500 response - Reason: only root can set 'ciupgrade' config
2024-05-13T06:25:24.330-0400 [DEBUG] provider.terraform-provider-proxmox_v0.54.0: Received HTTP Response: @module=proxmox Cache-Control=max-age=0 Expires="Mon, 13 May 2024 10:25:25 GMT" Pragma=no-cache tf_http_res_status_code=500 tf_mux_provider=tf5to6server.v5tov6Server Content-Length=13 Content-Type=application/json;charset=UTF-8 tf_http_op_type=response tf_http_res_body="{"data":null}" tf_rpc=ApplyResourceChange @caller=github.com/hashicorp/terraform-plugin-sdk/v2@v2.33.0/helper/logging/logging_http_transport.go:162 Server=pve-api-daemon/3.0 tf_http_res_version=HTTP/1.1 tf_resource_type=proxmox_virtual_environment_vm tf_http_res_status_reason="500 only root can set 'ciupgrade' config" tf_http_trans_id=0853f5ea-1430-129c-9c66-4c4c76aea6f2 tf_provider_addr=registry.terraform.io/bpg/proxmox tf_req_id=1ff46a22-30b2-0b58-b28f-acc175466e33 Date="Mon, 13 May 2024 10:25:25 GMT" timestamp=2024-05-13T06:25:24.329-0400
2024-05-13T06:25:24.330-0400 [ERROR] provider.terraform-provider-proxmox_v0.54.0: Response contains error diagnostic: tf_resource_type=proxmox_virtual_environment_vm tf_rpc=ApplyResourceChange @module=sdk.proto diagnostic_detail="" diagnostic_severity=ERROR tf_proto_version=6.4 @caller=github.com/hashicorp/terraform-plugin-go@v0.22.2/tfprotov6/internal/diag/diagnostics.go:58 diagnostic_summary="error creating VM: received an HTTP 500 response - Reason: only root can set 'ciupgrade' config" tf_provider_addr=registry.terraform.io/bpg/proxmox tf_req_id=1ff46a22-30b2-0b58-b28f-acc175466e33 timestamp=2024-05-13T06:25:24.330-0400
2024-05-13T06:25:24.336-0400 [DEBUG] provider.terraform-provider-proxmox_v0.54.0: Received HTTP Response: Content-Length=13 Date="Mon, 13 May 2024 10:25:25 GMT" tf_http_op_type=response tf_http_res_version=HTTP/1.1 tf_http_trans_id=4f50df46-2a39-7427-8ec2-1c74f5ded476 tf_provider_addr=registry.terraform.io/bpg/proxmox tf_rpc=ApplyResourceChange Expires="Mon, 13 May 2024 10:25:25 GMT" Server=pve-api-daemon/3.0 tf_http_res_status_reason="500 only root can set 'ciupgrade' config" tf_mux_provider=tf5to6server.v5tov6Server tf_resource_type=proxmox_virtual_environment_vm @caller=github.com/hashicorp/terraform-plugin-sdk/v2@v2.33.0/helper/logging/logging_http_transport.go:162 Cache-Control=max-age=0 tf_http_res_body="{"data":null}" tf_http_res_status_code=500 tf_req_id=b797e86a-7ac6-07a0-f261-ff086da22f67 @module=proxmox Content-Type=application/json;charset=UTF-8 Pragma=no-cache timestamp=2024-05-13T06:25:24.335-0400
2024-05-13T06:25:24.336-0400 [ERROR] provider.terraform-provider-proxmox_v0.54.0: Response contains error diagnostic: @caller=github.com/hashicorp/terraform-plugin-go@v0.22.2/tfprotov6/internal/diag/diagnostics.go:58 @module=sdk.proto diagnostic_severity=ERROR diagnostic_summary="error creating VM: received an HTTP 500 response - Reason: only root can set 'ciupgrade' config" tf_resource_type=proxmox_virtual_environment_vm tf_rpc=ApplyResourceChange diagnostic_detail="" tf_proto_version=6.4 tf_provider_addr=registry.terraform.io/bpg/proxmox tf_req_id=b797e86a-7ac6-07a0-f261-ff086da22f67 timestamp=2024-05-13T06:25:24.336-0400
2024-05-13T06:25:24.343-0400 [DEBUG] State storage *statemgr.Filesystem declined to persist a state snapshot
2024-05-13T06:25:24.343-0400 [ERROR] vertex "module.talos_controlplane[0].proxmox_virtual_environment_vm.talos_controlplane_vm[0]" error: error creating VM: received an HTTP 500 response - Reason: only root can set 'ciupgrade' config
2024-05-13T06:25:24.352-0400 [DEBUG] State storage *statemgr.Filesystem declined to persist a state snapshot
2024-05-13T06:25:24.352-0400 [ERROR] vertex "module.talos_worker[0].proxmox_virtual_environment_vm.talos_worker_vm[0]" error: error creating VM: received an HTTP 500 response - Reason: only root can set 'ciupgrade' config

│ Error: error creating VM: received an HTTP 500 response - Reason: only root can set 'ciupgrade' config

│ with module.talos_controlplane[0].proxmox_virtual_environment_vm.talos_controlplane_vm[0],
│ on Modules/Talos/main.tf line 1, in resource "proxmox_virtual_environment_vm" "talos_controlplane_vm":
│ 1: resource "proxmox_virtual_environment_vm" "talos_controlplane_vm" {



│ Error: error creating VM: received an HTTP 500 response - Reason: only root can set 'ciupgrade' config

│ with module.talos_worker[1].proxmox_virtual_environment_vm.talos_worker_vm[0],
│ on Modules/Talos/main.tf line 70, in resource "proxmox_virtual_environment_vm" "talos_worker_vm":
│ 70: resource "proxmox_virtual_environment_vm" "talos_worker_vm" {



│ Error: error creating VM: received an HTTP 500 response - Reason: only root can set 'ciupgrade' config

│ with module.talos_worker[0].proxmox_virtual_environment_vm.talos_worker_vm[0],
│ on Modules/Talos/main.tf line 70, in resource "proxmox_virtual_environment_vm" "talos_worker_vm":
│ 70: resource "proxmox_virtual_environment_vm" "talos_worker_vm" {


2024-05-13T06:25:24.366-0400 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: co

@Tanchwa Tanchwa added the 🐛 bug Something isn't working label May 13, 2024
@bpg
Copy link
Owner

bpg commented May 13, 2024

Hi @Tanchwa, I believe this issue has been fixed in v0.55.1. Could you try the latest provider version and check if it works for you?

@bpg bpg added the ⌛ pending author's response Requested additional information from the reporter label May 13, 2024
@Tanchwa
Copy link
Author

Tanchwa commented May 13, 2024

I did and I'm getting the same errors. I tried v0.56.1 also

@bpg bpg removed the ⌛ pending author's response Requested additional information from the reporter label May 14, 2024
@bpg
Copy link
Owner

bpg commented May 15, 2024

Thanks @Tanchwa, I found the issue, but can't really fix it in the current implementation, so I'm going to remove ciupgrade attribute support altogether and reopen #1079.

The problem is related to the default values handling (#566) in the SDK-based implementation, which will be fixed in #1231.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants