vmware / terraform-provider-vcd

Terraform VMware Cloud Director provider
https://www.terraform.io/docs/providers/vcd/
Mozilla Public License 2.0
148 stars 112 forks source link

vcd_org - API Error: 406 creating a new org since 3.8.0+ #1025

Open username-is-already-taken2 opened 1 year ago

username-is-already-taken2 commented 1 year ago

Issue WIP, I'm trying to get something out the door so need to share more debug captures, as it stands I've rolled back to version 3.7.0 and it works as desired. I've tried 3.8.0, .1 & .2 (latest)

Terraform Version

1.4.2

Affected Resource(s)

Terraform Configuration Files

terraform {
  required_providers {
    vcd = {
      source = "vmware/vcd"
      version = "3.8.2"
    }
  }
}
provider "vcd" {
  user                               = var.vcd_admin_user
  password                           = var.vcd_admin_pass
  org                                = var.vcd_admin_org # System
  url                                = var.vcd_url
  max_retry_timeout                  = var.vcd_max_retry_timeout
  allow_unverified_ssl               = var.vcd_allow_unverified_ssl
  auth_type                          = "integrated"
}
resource "vcd_org" "tenant-org" {
  name = "GIT99"
  full_name = "Issue Demo"
  delete_recursive = false
  delete_force = false
}

Debug Output

go-vcloud-director.log

...
2023/03/21 10:29:36 ################################################################################
2023/03/21 10:29:36 Response caller govcd.CreateOrg-->govcd.CreateOrg-->govcd.executeRequestWithApiVersion-->govcd.(*Client).executeTaskRequest-->govcd.executeRequestCustomErr-->govcd.checkRespWithErrType-->govcd.ParseErr-->govcd.decodeBody
2023/03/21 10:29:36 Response status 406 Not Acceptable
2023/03/21 10:29:36 ################################################################################
2023/03/21 10:29:36 Response header:
2023/03/21 10:29:36     Date: [Tue, 21 Mar 2023 10:29:41 GMT]
2023/03/21 10:29:36     X-Vmware-Vcloud-Request-Id: [b464a963-ed1c-4c46-a0bd-4ea870bc3dc5]
2023/03/21 10:29:36     Cache-Control: [no-store, must-revalidate]
2023/03/21 10:29:36     Content-Type: [application/vnd.vmware.vcloud.error+xml;version=37.1]
2023/03/21 10:29:36     X-Vmware-Vcloud-Request-Execution-Time: [1]
2023/03/21 10:29:36     Content-Length: [904]
2023/03/21 10:29:36 Response text: [904]
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Error xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:vmext="http://www.vmware.com/vcloud/extension/v1.5" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" xmlns:common="http://schemas.dmtf.org/wbem/wscim/1/common" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:vmw="http://www.vmware.com/schema/ovf" xmlns:ovfenv="http://schemas.dmtf.org/ovf/environment/1" xmlns:ns9="http://www.vmware.com/vcloud/versions" message="The request has invalid accept header: Invalid API version requested. Supported API versions are: [38.0.0-alpha, 37.1, 37.0, 36.3, 36.2, 36.1, 36.0, 35.2 [D], 35.0 [D], 34.0 [D], 33.0 [D]] ([D] indicates deprecated versions)" majorErrorCode="406" minorErrorCode="NOT_ACCEPTABLE"/>

Expected Behavior

Creates Org

Actual Behavior

Is able to plan the change but when appling it'll error. Version 3.7.0 works as desired. vcloud cell version = 10.4.1.20912624 api explorer reports api version as 37.1

User Access rights

System Administrator

adezxc commented 1 year ago

Hello @username-is-already-taken2, thanks for reporting this issue.

Could you send the full log while trying to create the organization on v3.8.0 version?