hashicorp / terraform

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
https://www.terraform.io
Other
42.77k stars 9.56k forks source link

azurerm_sql_database not respecting timeout block [azure devops pipeline] #25737

Closed jwshive closed 4 years ago

jwshive commented 4 years ago

Terraform Version

terraform 0.12.28 x64

Terraform Configuration Files

resource "azurerm_mssql_database" "sql_database" {
  name                = "#{agency}#-#{department}#-#{environment}#-#{application}#-db"
  server_id           = module.application-sql_server.id
  collation           = "SQL_Latin1_General_CP1_CI_AS"
  license_type        = "BasePrice"
  read_scale          = false
  sku_name            = "ElasticPool"
  zone_redundant      = false
  tags = {
    environment = "#{environment}#"
    application = "#{application}#"
    product_owner = "#{product-owner}#"
    service_owner = "#{service-owner}#"
    cost_center = "#{cost-center}#"
    type        = "mssql-database"
  }
  elastic_pool_id     = azurerm_mssql_elasticpool.sql_elastic_pool.id
  extended_auditing_policy {
    storage_endpoint                        = module.storage-working-storage_account.primary_blob_endpoint
    storage_account_access_key              = module.storage-working-storage_account.primary_access_key
    storage_account_access_key_is_secondary = true
    retention_in_days                       = 6
  }
  timeouts {
    create = "2h"
    delete = "2h"
  }
}
...

Debug Output

Crash Output

Expected Behavior

Expect terraform (through azure devops) to wait at least 2 hours before failing. ### Actual Behavior Terraform (through azure devops) waits 11 minutes and fails. ### Steps to Reproduce

Additional Context

The database is created, available and usable through the azure portal, but I assume some provisioning statement isn't claiming complete and that's what is triggering the timeout. ``` 2020-08-04T01:44:20.3729389Z azurerm_mssql_database.sql_database: Still creating... [10m10s elapsed] 2020-08-04T01:44:30.3751181Z azurerm_mssql_database.sql_database: Still creating... [10m20s elapsed] 2020-08-04T01:44:40.3772278Z azurerm_mssql_database.sql_database: Still creating... [10m30s elapsed] 2020-08-04T01:44:50.3788765Z azurerm_mssql_database.sql_database: Still creating... [10m40s elapsed] 2020-08-04T01:45:00.3815142Z azurerm_mssql_database.sql_database: Still creating... [10m50s elapsed] 2020-08-04T01:45:10.6773262Z  2020-08-04T01:45:10.6777939Z Error: failure in issuing create/update request for SQL Database "agency-dept-dev-app-db" Blob Auditing Policies(SQL Server "agency-dept-dev-app-sqlsvr"/ Resource Group "agency-dept-dev-app-rg"): sql.ExtendedDatabaseBlobAuditingPoliciesClient#CreateOrUpdate: Failure responding to request: StatusCode=500 -- Original Error: autorest/azure: Service returned an error. Status=500 Code="InternalServerError" Message="An unexpected error occured while processing the request. Tracking ID: '8f78e558-d9bb-4644-9e7a-1ca753986d9c'" 2020-08-04T01:45:10.6780054Z 2020-08-04T01:45:10.6780718Z  on dept-app-env.tf line 254, in resource "azurerm_mssql_database" "sql_database": 2020-08-04T01:45:10.6781509Z 254: resource "azurerm_mssql_database" "sql_database" { 2020-08-04T01:45:10.6782014Z  2020-08-04T01:45:10.6782280Z  2020-08-04T01:45:10.8191946Z ##[error]Error: The process 'C:\hostedtoolcache\windows\terraform\0.12.28\x64\terraform.exe' failed with exit code 1 2020-08-04T01:45:10.8260098Z ##[section]Finishing: Terraform : apply ``` ### References
anarsen commented 4 years ago

You'll have the all the right people looking at this issue if you move it to the azurerm provider's repository: https://github.com/terraform-providers/terraform-provider-azurerm

ghost commented 4 years ago

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.