Closed powellquiring closed 2 years ago
@powellquiring @ujjwal-ibm There is a PR #3180 in the affected area. Please see if this helps.
Maybe that fix is dealing with the load balancer modification while the load balancer is UPDATE_PENDING Another fix is likely needed to deal with the security group target failing because the load balancer is UPDATE_PENDING
Created a simpler cut down test: https://github.com/powellquiring/tfbugs/tree/master/bug-lb-order Consider adding it to the regression suite.
Added version information:
Terraform v1.0.9
on darwin_amd64
+ provider registry.terraform.io/ibm-cloud/ibm v1.34.0
Tried again, here is the end of the log:
Plan: 0 to add, 0 to change, 16 to destroy.
ibm_is_security_group_target.load_balancer_targets_front: Destroying... [id=r014-a97833fd-45a7-41f5-b27b-126afc8f2e3d/r014-b0dffedf-675d-4c33-abea-9b177e94e354]
ibm_is_security_group_rule.inbound_8000: Destroying... [id=r014-e30bb03e-b505-46d0-a545-ea3639ff7462.r014-757894db-e407-4c42-9881-4b9898beec56]
ibm_is_subnet.back["1"]: Destroying... [id=0767-9ecc53fb-0981-4f23-8c3d-b2cc15cb0345]
ibm_is_subnet.back["0"]: Destroying... [id=0757-5ee3f0be-799f-432f-b055-2ea67877d350]
ibm_is_security_group_rule.inbound_8000: Destruction complete after 1s
ibm_is_subnet.back["1"]: Still destroying... [id=0767-9ecc53fb-0981-4f23-8c3d-b2cc15cb0345, 10s elapsed]
ibm_is_subnet.back["0"]: Still destroying... [id=0757-5ee3f0be-799f-432f-b055-2ea67877d350, 10s elapsed]
ibm_is_subnet.back["1"]: Destruction complete after 15s
ibm_is_subnet.back["0"]: Destruction complete after 16s
╷
│ Error: error Deleting Security Group Targets : error communicating with LBaaS: The load balancer with ID 'r014-b0dffedf-675d-4c33-abea-9b177e94e354' cannot be updated because its status is 'UPDATE_PENDING'.
│ {
│ "StatusCode": 409,
│ "Headers": {
Tried in eu-de:
Plan: 0 to add, 0 to change, 16 to destroy.
ibm_is_security_group_target.load_balancer_targets_front: Destroying... [id=r010-2732e991-1a99-4d06-81b3-2025b0579438/r010-544d8790-b059-4cf2-852b-844bd79ee9cb]
ibm_is_security_group_rule.inbound_8000: Destroying... [id=r010-835be93f-4ede-4c43-8f83-f81c6edc7527.r010-9505916b-dd2d-4ca4-995c-a6de497affdf]
ibm_is_subnet.back["1"]: Destroying... [id=02c7-2d3e1f8c-44fd-420b-a7c4-58909df8ea62]
ibm_is_subnet.back["0"]: Destroying... [id=02b7-ece51b67-04de-48ea-ba71-97b50415ce41]
ibm_is_security_group_rule.inbound_8000: Destruction complete after 1s
ibm_is_security_group_target.load_balancer_targets_front: Destruction complete after 3s
ibm_is_lb_listener.front: Destroying... [id=r010-544d8790-b059-4cf2-852b-844bd79ee9cb/r010-00c6257c-542c-4357-8165-106155a99afe]
ibm_is_security_group_rule.load_balancer_targets_inbound: Destroying... [id=r010-2732e991-1a99-4d06-81b3-2025b0579438.r010-cb1e5f83-ead5-4c58-8da5-545854492683]
ibm_is_security_group_rule.load_balancer_targets_outbound: Destroying... [id=r010-2732e991-1a99-4d06-81b3-2025b0579438.r010-d526ab3c-bb7d-406d-ac28-258a495dac62]
ibm_is_security_group_rule.load_balancer_targets_inbound: Destruction complete after 2s
ibm_is_security_group_rule.load_balancer_targets_outbound: Destruction complete after 2s
ibm_is_security_group.load_balancer_targets: Destroying... [id=r010-2732e991-1a99-4d06-81b3-2025b0579438]
ibm_is_subnet.back["0"]: Still destroying... [id=02b7-ece51b67-04de-48ea-ba71-97b50415ce41, 10s elapsed]
ibm_is_subnet.back["1"]: Still destroying... [id=02c7-2d3e1f8c-44fd-420b-a7c4-58909df8ea62, 10s elapsed]
ibm_is_lb_listener.front: Still destroying... [id=r010-544d8790-b059-4cf2-852b-844bd79ee9...0-00c6257c-542c-4357-8165-106155a99afe, 10s elapsed]
ibm_is_subnet.back["1"]: Destruction complete after 17s
ibm_is_subnet.back["0"]: Destruction complete after 17s
ibm_is_lb_listener.front: Still destroying... [id=r010-544d8790-b059-4cf2-852b-844bd79ee9...0-00c6257c-542c-4357-8165-106155a99afe, 20s elapsed]
ibm_is_lb_listener.front: Still destroying... [id=r010-544d8790-b059-4cf2-852b-844bd79ee9...0-00c6257c-542c-4357-8165-106155a99afe, 30s elapsed]
ibm_is_lb_listener.front: Still destroying... [id=r010-544d8790-b059-4cf2-852b-844bd79ee9...0-00c6257c-542c-4357-8165-106155a99afe, 40s elapsed]
ibm_is_lb_listener.front: Still destroying... [id=r010-544d8790-b059-4cf2-852b-844bd79ee9...0-00c6257c-542c-4357-8165-106155a99afe, 50s elapsed]
ibm_is_lb_listener.front: Still destroying... [id=r010-544d8790-b059-4cf2-852b-844bd79ee9...0-00c6257c-542c-4357-8165-106155a99afe, 1m0s elapsed]
ibm_is_lb_listener.front: Still destroying... [id=r010-544d8790-b059-4cf2-852b-844bd79ee9...0-00c6257c-542c-4357-8165-106155a99afe, 1m10s elapsed]
ibm_is_lb_listener.front: Still destroying... [id=r010-544d8790-b059-4cf2-852b-844bd79ee9...0-00c6257c-542c-4357-8165-106155a99afe, 1m20s elapsed]
ibm_is_lb_listener.front: Still destroying... [id=r010-544d8790-b059-4cf2-852b-844bd79ee9...0-00c6257c-542c-4357-8165-106155a99afe, 1m30s elapsed]
ibm_is_lb_listener.front: Destruction complete after 1m36s
ibm_is_lb_pool.front: Destroying... [id=r010-544d8790-b059-4cf2-852b-844bd79ee9cb/r010-1d7648e9-7208-45d5-ba62-730a03177eaf]
ibm_is_lb_pool.front: Still destroying... [id=r010-544d8790-b059-4cf2-852b-844bd79ee9...0-1d7648e9-7208-45d5-ba62-730a03177eaf, 10s elapsed]
ibm_is_lb_pool.front: Still destroying... [id=r010-544d8790-b059-4cf2-852b-844bd79ee9...0-1d7648e9-7208-45d5-ba62-730a03177eaf, 20s elapsed]
ibm_is_lb_pool.front: Still destroying... [id=r010-544d8790-b059-4cf2-852b-844bd79ee9...0-1d7648e9-7208-45d5-ba62-730a03177eaf, 30s elapsed]
ibm_is_lb_pool.front: Still destroying... [id=r010-544d8790-b059-4cf2-852b-844bd79ee9...0-1d7648e9-7208-45d5-ba62-730a03177eaf, 40s elapsed]
ibm_is_lb_pool.front: Destruction complete after 45s
ibm_is_lb.front: Destroying... [id=r010-544d8790-b059-4cf2-852b-844bd79ee9cb]
ibm_is_lb.front: Still destroying... [id=r010-544d8790-b059-4cf2-852b-844bd79ee9cb, 10s elapsed]
ibm_is_lb.front: Still destroying... [id=r010-544d8790-b059-4cf2-852b-844bd79ee9cb, 20s elapsed]
ibm_is_lb.front: Still destroying... [id=r010-544d8790-b059-4cf2-852b-844bd79ee9cb, 30s elapsed]
ibm_is_lb.front: Still destroying... [id=r010-544d8790-b059-4cf2-852b-844bd79ee9cb, 40s elapsed]
ibm_is_lb.front: Still destroying... [id=r010-544d8790-b059-4cf2-852b-844bd79ee9cb, 50s elapsed]
ibm_is_lb.front: Still destroying... [id=r010-544d8790-b059-4cf2-852b-844bd79ee9cb, 1m0s elapsed]
ibm_is_lb.front: Still destroying... [id=r010-544d8790-b059-4cf2-852b-844bd79ee9cb, 1m10s elapsed]
ibm_is_lb.front: Still destroying... [id=r010-544d8790-b059-4cf2-852b-844bd79ee9cb, 1m20s elapsed]
ibm_is_lb.front: Still destroying... [id=r010-544d8790-b059-4cf2-852b-844bd79ee9cb, 1m30s elapsed]
ibm_is_lb.front: Still destroying... [id=r010-544d8790-b059-4cf2-852b-844bd79ee9cb, 1m40s elapsed]
ibm_is_lb.front: Still destroying... [id=r010-544d8790-b059-4cf2-852b-844bd79ee9cb, 1m50s elapsed]
ibm_is_lb.front: Still destroying... [id=r010-544d8790-b059-4cf2-852b-844bd79ee9cb, 2m0s elapsed]
ibm_is_lb.front: Still destroying... [id=r010-544d8790-b059-4cf2-852b-844bd79ee9cb, 2m10s elapsed]
ibm_is_lb.front: Still destroying... [id=r010-544d8790-b059-4cf2-852b-844bd79ee9cb, 2m20s elapsed]
ibm_is_lb.front: Destruction complete after 2m30s
ibm_is_subnet.front["0"]: Destroying... [id=02b7-3a6193a6-b1e0-4e26-a6df-a8e1461f8c2e]
ibm_is_subnet.front["1"]: Destroying... [id=02c7-f4f4f169-4741-4949-b857-01f25eef429e]
ibm_is_subnet.front["0"]: Still destroying... [id=02b7-3a6193a6-b1e0-4e26-a6df-a8e1461f8c2e, 10s elapsed]
ibm_is_subnet.front["1"]: Still destroying... [id=02c7-f4f4f169-4741-4949-b857-01f25eef429e, 10s elapsed]
ibm_is_subnet.front["1"]: Destruction complete after 16s
ibm_is_subnet.front["0"]: Destruction complete after 16s
ibm_is_vpc_address_prefix.locations["2"]: Destroying... [id=r010-3f401f41-c498-40ce-8fc4-a2b5872b46a6/r010-0c19e11b-e27e-4d93-a60d-9b2bfec26633]
ibm_is_vpc_address_prefix.locations["0"]: Destroying... [id=r010-3f401f41-c498-40ce-8fc4-a2b5872b46a6/r010-f7b63fe2-a174-49e1-95a7-80af4d00deaf]
ibm_is_vpc_address_prefix.locations["1"]: Destroying... [id=r010-3f401f41-c498-40ce-8fc4-a2b5872b46a6/r010-3bcdd30a-85c0-47e4-99b2-c00f4efb9b14]
ibm_is_vpc_address_prefix.locations["0"]: Destruction complete after 2s
ibm_is_vpc_address_prefix.locations["2"]: Destruction complete after 2s
ibm_is_vpc_address_prefix.locations["1"]: Destruction complete after 3s
╷
│ Error: Error Deleting Security Group Targets : error communicating with LBaaS: The load balancer with ID 'r010-544d8790-b059-4cf2-852b-844bd79ee9cb' cannot be updated because its status is 'UPDATE_PENDING'.
│ {
│ "StatusCode": 409,
│ "Headers": {
│ "Cache-Control": [
│ "max-age=0, no-cache, no-store, must-revalidate"
│ ],
│ "Cf-Cache-Status": [
│ "DYNAMIC"
│ ],
│ "Cf-Ray": [
│ "6a025a4b282afd99-PDX"
│ ],
│ "Content-Length": [
│ "470"
│ ],
│ "Content-Type": [
│ "application/json"
│ ],
│ "Date": [
│ "Mon, 18 Oct 2021 14:10:54 GMT"
│ ],
│ "Expect-Ct": [
│ "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""
│ ],
│ "Expires": [
│ "-1"
│ ],
│ "Pragma": [
│ "no-cache"
│ ],
│ "Server": [
│ "cloudflare"
│ ],
│ "Strict-Transport-Security": [
│ "max-age=31536000; includeSubDomains"
│ ],
│ "Vary": [
│ "Accept-Encoding"
│ ],
│ "X-Content-Type-Options": [
│ "nosniff"
│ ],
│ "X-Request-Id": [
│ "256eaef2-60cf-4c62-a04b-111c80092d21"
│ ],
│ "X-Xss-Protection": [
│ "1; mode=block"
│ ]
│ },
│ "Result": {
│ "errors": [
│ {
│ "code": "load_balancer_update_conflict",
│ "message": "error communicating with LBaaS: The load balancer with ID 'r010-544d8790-b059-4cf2-852b-844bd79ee9cb' cannot be updated because its status is 'UPDATE_PENDING'.",
│ "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-rias-error-messagesload_balancer_update_conflict",
│ "target": {
│ "name": "id",
│ "type": "parameter",
│ "value": "r010-544d8790-b059-4cf2-852b-844bd79ee9cb"
│ }
│ }
│ ],
│ "trace": "256eaef2-60cf-4c62-a04b-111c80092d21"
│ },
│ "RawResult": null
│ }
│
│
Right after the terraform apply
is completed I noticed that the load balancer is in the update_pending state.
Apply complete! Resources: 16 added, 0 changed, 0 destroyed.
+ ibmcloud is load-balancers
+ grep update_pending
r010-cac1227a-722c-4cc6-b4b6-d57ba3806435 bug00-front Application bug00-front-0, bug00-front-1 true update_pending online default
+ ibmcloud is load-balancers
Listing load balancers for generation 2 compute in resource group default and region eu-de under account Powell Quiring's Account as user pquiring@us.ibm.com...
ID Name Family Subnets Is public Provision status Operating status Resource group
r010-cac1227a-722c-4cc6-b4b6-d57ba3806435 bug00-front Application bug00-front-0, bug00-front-1 true update_pending online default
I think this is causing the previous error message.
But the previous error message is confusing. What does this mean?
│ Error: Error Deleting Security Group Targets : error communicating with LBaaS: The load balancer with ID 'r010-544d8790-b059-4cf2-852b-844bd79ee9cb' cannot be updated because its status is 'UPDATE_PENDING'.
│ "message": "error communicating with LBaaS: The load balancer with ID 'r010-544d8790-b059-4cf2-852b-844bd79ee9cb' cannot be updated because its status is 'UPDATE_PENDING'.",
What resource action is returning this message? It mentions Error Deleting Security Group Targets
. Is that this?
ibm_is_security_group_target.load_balancer_targets_front: Destroying... [id=r010-2732e991-1a99-4d06-81b3-2025b0579438/r010-544d8790-b059-4cf2-852b-844bd79ee9cb]
...
ibm_is_security_group_target.load_balancer_targets_front: Destruction complete after 3s
Why is the Destruction complete
and not an error?
This issue can no longer be reproduced.
@ujjwal-ibm
See full configuration: https://github.com/powellquiring/tfbugs/tree/master/bug-lb-order
Notice:
Since there is a target = dependency this should mean that the ibm_is_security_group_target gets created after the load balancers and deleted before the load balancers.
But the problem is: The load balancer with ID 'r006-99b40e58-dd89-4695-a93a-258fdc3b2957' cannot be updated because its status is 'UPDATE_PENDING'.
And update pending is do to the deletion of these, right? : ibm_is_lb_pool, ibm_is_lb_listener, ibm_is_lb_pool_member
Fuller output:
Tried again a few minutes later, all is good: