Closed NillsF closed 3 years ago
This is easily reproduced by introducing a secondary location for one of the replicas in Acceptance Test TestAccPostgreSQLServer_scaleReplicas
:
❯ make acctests SERVICE='postgres' TESTARGS='-run=Replicas'
==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
==> Checking that acceptance test packages are used...
TF_ACC=1 go test -v ./azurerm/internal/services/postgres -run=Replicas -timeout 180m -ldflags="-X=github.com/terraform-providers/terraform-provider-azurerm/version.ProviderVersion=acc"
2021/04/24 15:29:08 [DEBUG] not using binary driver name, it's no longer needed
2021/04/24 15:29:09 [DEBUG] not using binary driver name, it's no longer needed
=== RUN TestAccPostgreSQLServer_scaleReplicas
=== PAUSE TestAccPostgreSQLServer_scaleReplicas
=== CONT TestAccPostgreSQLServer_scaleReplicas
testing.go:620: Step 3/6 error: Error running apply: exit status 1
Error: updating PostgreSQL Server "acctest-psql-server-210424152910412500-replica2" (Resource Group "acctestRG-psql-210424152910412500"): postgresql.ServersClient#Update: Failure sending request: StatusCode=0 -- Original Error: autorest/azure: Service returned an error. Status=<nil> Code="ServiceBusy" Message="Service is temporarily busy and the operation cannot be performed. Please try again later."
on terraform_plugin_test.tf line 43, in resource "azurerm_postgresql_server" "replica2":
43: resource "azurerm_postgresql_server" "replica2" {
--- FAIL: TestAccPostgreSQLServer_scaleReplicas (1481.86s)
FAIL
FAIL github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/postgres 1485.338s
FAIL
make: *** [acctests] Error 1
I'll check the options to solve it, probably something like removing sku_name
for a secondary.
This has been released in version 2.57.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:
provider "azurerm" {
version = "~> 2.57.0"
}
# ... other configuration ...
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Community Note
Terraform (and AzureRM Provider) Version
Affected Resource(s)
azurerm_postgresql_server
Terraform Configuration Files
Two files:
postgres.tf
var.tf
Debug Output
https://gist.github.com/NillsF/cda78b2bb2a7cd90ba833bcced9665ae
Panic Output
Expected Behaviour
Actual Behaviour
This can be resolved by running
terraform plan
andterraform apply
a second time.Steps to Reproduce
terraform apply
terraform apply
will emit the error (if replica is in another region)Important Factoids
References
@aristosvo did some great work implementing locking in the following issue/PR:
10754
10284