aliyun / terraform-provider-alicloud

Terraform AliCloud provider
https://www.terraform.io/docs/providers/alicloud/
Mozilla Public License 2.0
590 stars 553 forks source link

Terraform HaVip ENI attachment failing on Alibaba Cloud with unknown error #6371

Open hshimesh opened 1 year ago

hshimesh commented 1 year ago

Hi there,

I am Himesh Sarkari from Palo Alto Networks. I have created a terraform script for a HA use case, but in that HaVip attachment to ENI is failing in Alibaba cloud. Though the 'terraform plan' is passing but in 'terraform apply' it fails stating "Unknown error" in Alibaba cloud.

Please help resolve this

######################################################### Terraform snippet

# Create HaVip
resource "alicloud_havip" "havip-untrust" {
  vswitch_id  = alicloud_vswitch.auto-pavmqa-DATA-Untrust.id
  ip_address = "10.x.x.x"
  ha_vip_name = "${local.res_grp}-HaVip1"
}

# Attach FW1 Untrust ENI to Untrust HaVip
resource "alicloud_havip_attachment" "havip-untrust-attachment1" {
  havip_id = alicloud_havip.havip-untrust.id
  instance_id = alicloud_network_interface.auto-pavmqa-DATA-FW1-Untrust.id
}

# Attach FW2 Untrust ENI to Untrust HaVip
resource "alicloud_havip_attachment" "havip-untrust-attachment2" {
  havip_id = alicloud_havip.havip-untrust.id
  instance_id = alicloud_network_interface.auto-pavmqa-DATA-FW2-Untrust.id
}

######################################################## Terraform Error

Error: [ERROR] terraform-provider-alicloud/alicloud/resource_alicloud_havip_attachment.go:97: Resource alicloudhavip_attachment AssociateHaVip Failed!!| [SDK alibaba-cloud-sdk-go ERROR]: 
SDKError:
StatusCode: 400
Code: UnknownError
Message: code: 400, The request processing has failed due to some unknown error. request id: 543476AF-77E3-36E2-912B-660798810B7E 
Data: {"Code": "UnknownError" } "HostId": "vpc.cn-hongkong.aliyuncs", "Message" : "The request processing has failed due to some unknown error." "Recomend": "https://api.aliyun.com/troubleshoot?q=UnknownError\u0026product=Vpc", "RequestId": "543476AF-77E3-36E2-912B-660798810B7E"} 

with alicloud_havip_attachment.havip-untrust-attachment1, 
on main.tf line 475, in resource “alicloud_havip_attachment" “havip-untrust-attachment1”:
       475: resource “alicloud_havip_attachment" “havip-untrust-attachment1” {

########################################################

Terraform Version

Terraform v1.3.4

hshimesh commented 1 year ago

When Tried from Alicloud CLI, similar issue seen

admin@ubuntu:~$ aliyun vpc AssociateHaVip --HaVipId havip-j6c74v2hzpma04mr0r993 --InstanceId eni-j6cejdyld622rj4gixiz
ERROR: SDK.ServerError
ErrorCode: UnknownError
Recommend: https://api.aliyun.com/troubleshoot?q=UnknownError&product=Vpc
RequestId: 2A359098-A3A1-39AD-A771-658E4A56FF05
Message: The request processing has failed due to some unknown error.
RespHeaders: map[Access-Control-Allow-Origin:[*] Access-Control-Expose-Headers:[*] Connection:[keep-alive] Content-Length:[264] Content-Type:[application/json;charset=utf-8] Date:[Wed, 02 Aug 2023 16:13:26 GMT] Keep-Alive:[timeout=25] X-Acs-Request-Id:[2A359098-A3A1-39AD-A771-658E4A56FF05] X-Acs-Trace-Id:[6a40f51e68f0694cd9e709b267cdfa3c]]`