BunnyWay / terraform-provider-bunnynet

bunny.net Terraform provider
https://registry.terraform.io/providers/BunnyWay/bunnynet
Mozilla Public License 2.0
7 stars 1 forks source link

Terraform apply/plan is randomly hanging #6

Closed spaceemotion closed 3 months ago

spaceemotion commented 3 months ago
Terraform: 1.5.7
BunnyCDN: 0.3.9

Hi there,

we're having an issue that happens seemingly randomly which we traced back to the BunnyCDN plugin.

Using TF_LOG=TRACE, we were able to see the following loop of messages:

024-08-27T19:03:31.9747399Z 2024-08-27T19:03:30.208Z [TRACE] dag/walk: vertex "root" is waiting for "module.cdn (close)"
2024-08-27T19:03:31.9748040Z 2024-08-27T19:03:31.588Z [TRACE] dag/walk: vertex "root" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction[0]"
2024-08-27T19:03:33.8124086Z 2024-08-27T19:03:33.811Z [TRACE] dag/walk: vertex "module.cdn (close)" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction (expand)"
2024-08-27T19:03:33.9326187Z 2024-08-27T19:03:33.932Z [TRACE] dag/walk: vertex "module.cdn.provider[\"registry.terraform.io/bunnyway/bunnynet\"] (close)" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction (expand)"
2024-08-27T19:03:35.2091384Z 2024-08-27T19:03:35.208Z [TRACE] dag/walk: vertex "root" is waiting for "module.cdn (close)"
2024-08-27T19:03:36.5893898Z 2024-08-27T19:03:36.588Z [TRACE] dag/walk: vertex "root" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction[0]"
2024-08-27T19:03:38.8125029Z 2024-08-27T19:03:38.812Z [TRACE] dag/walk: vertex "module.cdn (close)" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction (expand)"
2024-08-27T19:03:38.9326485Z 2024-08-27T19:03:38.932Z [TRACE] dag/walk: vertex "module.cdn.provider[\"registry.terraform.io/bunnyway/bunnynet\"] (close)" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction (expand)"
2024-08-27T19:03:40.2095450Z 2024-08-27T19:03:40.208Z [TRACE] dag/walk: vertex "root" is waiting for "module.cdn (close)"
2024-08-27T19:03:41.5893867Z 2024-08-27T19:03:41.588Z [TRACE] dag/walk: vertex "root" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction[0]"
2024-08-27T19:03:43.8130617Z 2024-08-27T19:03:43.812Z [TRACE] dag/walk: vertex "module.cdn (close)" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction (expand)"
2024-08-27T19:03:43.9334780Z 2024-08-27T19:03:43.933Z [TRACE] dag/walk: vertex "module.cdn.provider[\"registry.terraform.io/bunnyway/bunnynet\"] (close)" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction (expand)"
2024-08-27T19:03:45.2094326Z 2024-08-27T19:03:45.209Z [TRACE] dag/walk: vertex "root" is waiting for "module.cdn (close)"
2024-08-27T19:03:46.5902707Z 2024-08-27T19:03:46.589Z [TRACE] dag/walk: vertex "root" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction[0]"
2024-08-27T19:03:48.8144872Z 2024-08-27T19:03:48.814Z [TRACE] dag/walk: vertex "module.cdn (close)" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction (expand)"
2024-08-27T19:03:48.9336557Z 2024-08-27T19:03:48.933Z [TRACE] dag/walk: vertex "module.cdn.provider[\"registry.terraform.io/bunnyway/bunnynet\"] (close)" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction (expand)"
2024-08-27T19:03:50.2096862Z 2024-08-27T19:03:50.209Z [TRACE] dag/walk: vertex "root" is waiting for "module.cdn (close)"
2024-08-27T19:03:51.5905779Z 2024-08-27T19:03:51.590Z [TRACE] dag/walk: vertex "root" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction[0]"
2024-08-27T19:03:53.8157434Z 2024-08-27T19:03:53.815Z [TRACE] dag/walk: vertex "module.cdn (close)" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction (expand)"
2024-08-27T19:03:53.9339162Z 2024-08-27T19:03:53.933Z [TRACE] dag/walk: vertex "module.cdn.provider[\"registry.terraform.io/bunnyway/bunnynet\"] (close)" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction (expand)"
2024-08-27T19:03:55.2101809Z 2024-08-27T19:03:55.209Z [TRACE] dag/walk: vertex "root" is waiting for "module.cdn (close)"
2024-08-27T19:03:56.5907635Z 2024-08-27T19:03:56.590Z [TRACE] dag/walk: vertex "root" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction[0]"
2024-08-27T19:03:58.8159782Z 2024-08-27T19:03:58.815Z [TRACE] dag/walk: vertex "module.cdn (close)" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction (expand)"
2024-08-27T19:03:58.9341206Z 2024-08-27T19:03:58.933Z [TRACE] dag/walk: vertex "module.cdn.provider[\"registry.terraform.io/bunnyway/bunnynet\"] (close)" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction (expand)"
2024-08-27T19:04:00.2102955Z 2024-08-27T19:04:00.209Z [TRACE] dag/walk: vertex "root" is waiting for "module.cdn (close)"
2024-08-27T19:04:01.5909835Z 2024-08-27T19:04:01.590Z [TRACE] dag/walk: vertex "root" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction[0]"
2024-08-27T19:04:03.8166629Z 2024-08-27T19:04:03.816Z [TRACE] dag/walk: vertex "module.cdn (close)" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction (expand)"
2024-08-27T19:04:03.9351492Z 2024-08-27T19:04:03.934Z [TRACE] dag/walk: vertex "module.cdn.provider[\"registry.terraform.io/bunnyway/bunnynet\"] (close)" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction (expand)"
2024-08-27T19:04:05.2105236Z 2024-08-27T19:04:05.210Z [TRACE] dag/walk: vertex "root" is waiting for "module.cdn (close)"
2024-08-27T19:04:06.5911822Z 2024-08-27T19:04:06.590Z [TRACE] dag/walk: vertex "root" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction[0]"
2024-08-27T19:04:08.8168399Z 2024-08-27T19:04:08.816Z [TRACE] dag/walk: vertex "module.cdn (close)" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction (expand)"
2024-08-27T19:04:08.9349685Z 2024-08-27T19:04:08.934Z [TRACE] dag/walk: vertex "module.cdn.provider[\"registry.terraform.io/bunnyway/bunnynet\"] (close)" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction (expand)"
2024-08-27T19:04:10.2114766Z 2024-08-27T19:04:10.211Z [TRACE] dag/walk: vertex "root" is waiting for "module.cdn (close)"
2024-08-27T19:04:11.5913576Z 2024-08-27T19:04:11.590Z [TRACE] dag/walk: vertex "root" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction[0]"
2024-08-27T19:04:13.8170213Z 2024-08-27T19:04:13.816Z [TRACE] dag/walk: vertex "module.cdn (close)" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction (expand)"
2024-08-27T19:04:13.9351571Z 2024-08-27T19:04:13.934Z [TRACE] dag/walk: vertex "module.cdn.provider[\"registry.terraform.io/bunnyway/bunnynet\"] (close)" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction (expand)"
2024-08-27T19:04:15.2116412Z 2024-08-27T19:04:15.211Z [TRACE] dag/walk: vertex "root" is waiting for "module.cdn (close)"
2024-08-27T19:04:16.5915766Z 2024-08-27T19:04:16.591Z [TRACE] dag/walk: vertex "root" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction[0]"
2024-08-27T19:04:18.8171413Z 2024-08-27T19:04:18.816Z [TRACE] dag/walk: vertex "module.cdn (close)" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction (expand)"
2024-08-27T19:04:18.9353901Z 2024-08-27T19:04:18.934Z [TRACE] dag/walk: vertex "module.cdn.provider[\"registry.terraform.io/bunnyway/bunnynet\"] (close)" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction (expand)"
2024-08-27T19:04:20.2117863Z 2024-08-27T19:04:20.211Z [TRACE] dag/walk: vertex "root" is waiting for "module.cdn (close)"
2024-08-27T19:04:21.5917429Z 2024-08-27T19:04:21.591Z [TRACE] dag/walk: vertex "root" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction[0]"
2024-08-27T19:04:23.8174592Z 2024-08-27T19:04:23.816Z [TRACE] dag/walk: vertex "module.cdn (close)" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction (expand)"
2024-08-27T19:04:23.9356054Z 2024-08-27T19:04:23.935Z [TRACE] dag/walk: vertex "module.cdn.provider[\"registry.terraform.io/bunnyway/bunnynet\"] (close)" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction (expand)"
2024-08-27T19:04:25.2120195Z 2024-08-27T19:04:25.211Z [TRACE] dag/walk: vertex "root" is waiting for "module.cdn (close)"
2024-08-27T19:04:26.5918802Z 2024-08-27T19:04:26.591Z [TRACE] dag/walk: vertex "root" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction[0]"
2024-08-27T19:04:28.8176718Z 2024-08-27T19:04:28.817Z [TRACE] dag/walk: vertex "module.cdn (close)" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction (expand)"
2024-08-27T19:04:28.9358572Z 2024-08-27T19:04:28.935Z [TRACE] dag/walk: vertex "module.cdn.provider[\"registry.terraform.io/bunnyway/bunnynet\"] (close)" is waiting for "module.cdn.bunnynet_pullzone_edgerule.geo_restriction (expand)"

The resource in question looks like this:

resource "bunnynet_pullzone_edgerule" "geo_restriction" {
  enabled     = true
  pullzone    = bunnynet_pullzone.this.id
  description = "Restrict Countries"

  action     = "BlockRequest"
  match_type = "MatchAny"
  triggers = [
    {
      type       = "CountryCode"
      match_type = "MatchNone"
      patterns   = ["DE", "GB", "US"]
      parameter1 = null
      parameter2 = null
    }
  ]
}

We already checked the Bunny Status page to see if there were any API outages reported yesterday, but we couldn't see an incident.

Is this something internal to the BCDN plugin? Is it something API-related?

rafael-at-bunny commented 3 months ago

Are you defining more bunnynet resources? Does it hang always in the same one?

rafael-at-bunny commented 3 months ago

Hi!

Although I'm not exactly sure this fixes the issue, I've included in the v0.3.10 release a change that might address an specific case that could deadlock the provider if you were simultaneously changing multiple resources linked to the same pullzone. Please let me know if your issue persists after upgrading to v0.3.10.

Thank you!

spaceemotion commented 3 months ago

Just wanted to chime in that we now did many deployments in a row with v0.3.10, without any issues. The changes indeed seemed to have fixed the issues we were experiencing - fingers crossed!

I'm going to close this for the time being.