SQL Server Flex BETA instance creation fails with non-GenericOpenApiError during provisioning #66

Closed
opened 2026-02-16 09:04:25 +00:00 by sven.schmidt · 2 comments

Description

When creating a stackitprivatepreview_sqlserverflexbeta_instance, the Terraform run fails during the provisioning phase.

The instance remains in creating state for some time and then aborts with a non-GenericOpenApiError. The error message does not provide any actionable details besides the instance ID and a trace ID.

The failure happens during initial creation. No manual changes were performed in parallel.

Steps to reproduce

/*Copyright 2025 STACKIT GmbH & Co. KG <maintainer.email@stackit.cloud>

Use of this source code is governed by an MIT-style
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.*/

resource "stackitprivatepreview_sqlserverflexbeta_instance" "tcc_test_instance" {
  project_id      = var.tcc_project_id
  name            = "schmidtsv-tcc-sqlserverflex"
  backup_schedule = "0 2 * * *"
  encryption = {
    kek_key_version = "1"
    kek_key_id      = stackit_kms_key.key.key_id
    kek_key_ring_id = stackit_kms_keyring.tcc_keyring.keyring_id
    service_account = var.tcc_service_account_email
  }
  storage = {
    class = "premium-perf2-stackit"
    size  = 5
  }
  retention_days = 55
  network = {
    acl          = ["10.77.0.0/16"]
    access_scope = "SNA"
  }
  flavor_id = "4.32-Replica"

  version = 2022
}


output "sqlserver_instance_id" {

  value = stackitprivatepreview_sqlserverflexbeta_instance.tcc_test_instance.instance_id

}
  1. Run terraform init
  2. Run terraform apply
  3. Wait until provisioning starts
  4. After ~1–2 minutes creation fails with error shown below

Actual behavior

Terraform fails with the following error:

terraform apply

Terraform used the selected providers to generate the following execution plan. Resource actions are
indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # stackit_kms_key.key will be created
  + resource "stackit_kms_key" "key" {
      + access_scope = "SNA"
      + algorithm    = "aes_256_gcm"
      + display_name = "key-01"
      + id           = (known after apply)
      + import_only  = (known after apply)
      + key_id       = (known after apply)
      + keyring_id   = (known after apply)
      + project_id   = "5da71386-b8c6-44ba-b030-d20b8400d69e"
      + protection   = "software"
      + purpose      = "symmetric_encrypt_decrypt"
      + region       = "eu01"
    }

  # stackit_kms_keyring.tcc_keyring will be created
  + resource "stackit_kms_keyring" "tcc_keyring" {
      + description  = "pipeline created keyring"
      + display_name = "pipeline-keyring"
      + id           = (known after apply)
      + keyring_id   = (known after apply)
      + project_id   = "5da71386-b8c6-44ba-b030-d20b8400d69e"
      + region       = "eu01"
    }

  # stackit_routing_table_route.tcc_rt_sql_server will be created
  + resource "stackit_routing_table_route" "tcc_rt_sql_server" {
      + created_at       = (known after apply)
      + destination      = {
          + type  = "cidrv4"
          + value = (known after apply)
        }
      + id               = (known after apply)
      + network_area_id  = "ef1667fe-0c85-4b15-b020-3375cbce8310"
      + next_hop         = {
          + type  = "ipv4"
          + value = (known after apply)
        }
      + organization_id  = "03a34540-3c1a-4794-b2c6-7111ecf824ef"
      + region           = "eu01"
      + route_id         = (known after apply)
      + routing_table_id = "64c5b91a-94f2-4ddc-80a8-f8b6ce98dc74"
      + updated_at       = (known after apply)
    }

  # stackitprivatepreview_sqlserverflexbeta_instance.tcc_test_instance will be created
  + resource "stackitprivatepreview_sqlserverflexbeta_instance" "tcc_test_instance" {
      + backup_schedule = "0 2 * * *"
      + edition         = (known after apply)
      + encryption      = {
          + kek_key_id      = (known after apply)
          + kek_key_ring_id = (known after apply)
          + kek_key_version = "1"
          + service_account = "pe-kms-test-6r534pi8@sa.stackit.cloud"
        }
      + flavor_id       = "4.32-Replica"
      + id              = (known after apply)
      + instance_id     = (known after apply)
      + is_deletable    = (known after apply)
      + name            = "schmidtsv-tcc-sqlserverflex"
      + network         = {
          + access_scope     = "SNA"
          + acl              = [
              + "10.77.0.0/16",
            ]
          + instance_address = (known after apply)
          + router_address   = (known after apply)
        }
      + project_id      = "5da71386-b8c6-44ba-b030-d20b8400d69e"
      + region          = "eu01"
      + replicas        = (known after apply)
      + retention_days  = 55
      + status          = (known after apply)
      + storage         = {
          + class = "premium-perf2-stackit"
          + size  = 5
        }
      + version         = "2022"
    }

Plan: 4 to add, 0 to change, 0 to destroy.

Changes to Outputs:
  + sqlserver_instance_id = (known after apply)
╷
│ Warning: stackit_routing_table_route is part of the routing-tables experiment.
│ 
│   with stackit_routing_table_route.tcc_rt_sql_server,
│   on 04-routing-tables.tf line 7, in resource "stackit_routing_table_route" "tcc_rt_sql_server":
│    7: resource "stackit_routing_table_route" "tcc_rt_sql_server" {
│ 
│ This resource is part of the routing-tables experiment and is likely going to undergo significant
│ changes or be removed in the future. Use it at your own discretion.
│ 
│ (and one more similar warning elsewhere)
╵

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

stackit_kms_keyring.tcc_keyring: Creating...
stackit_kms_keyring.tcc_keyring: Creation complete after 5s [id=5da71386-b8c6-44ba-b030-d20b8400d69e,eu01,61959807-b84a-46c7-af79-5f738a8477c0]
stackit_kms_key.key: Creating...
stackit_kms_key.key: Creation complete after 6s [id=5da71386-b8c6-44ba-b030-d20b8400d69e,eu01,61959807-b84a-46c7-af79-5f738a8477c0,a98bf84b-0e61-46d3-9b29-568536a1a4ec]
stackitprivatepreview_sqlserverflexbeta_instance.tcc_test_instance: Creating...
stackitprivatepreview_sqlserverflexbeta_instance.tcc_test_instance: Still creating... [00m10s elapsed]
stackitprivatepreview_sqlserverflexbeta_instance.tcc_test_instance: Still creating... [00m20s elapsed]
stackitprivatepreview_sqlserverflexbeta_instance.tcc_test_instance: Still creating... [00m30s elapsed]
stackitprivatepreview_sqlserverflexbeta_instance.tcc_test_instance: Still creating... [00m40s elapsed]
stackitprivatepreview_sqlserverflexbeta_instance.tcc_test_instance: Still creating... [00m50s elapsed]
stackitprivatepreview_sqlserverflexbeta_instance.tcc_test_instance: Still creating... [01m00s elapsed]
stackitprivatepreview_sqlserverflexbeta_instance.tcc_test_instance: Still creating... [01m10s elapsed]
stackitprivatepreview_sqlserverflexbeta_instance.tcc_test_instance: Still creating... [01m20s elapsed]
stackitprivatepreview_sqlserverflexbeta_instance.tcc_test_instance: Still creating... [01m30s elapsed]
stackitprivatepreview_sqlserverflexbeta_instance.tcc_test_instance: Still creating... [01m40s elapsed]
╷
│ Error: [SQL Server Flex BETA - Create] error
│ 
│   with stackitprivatepreview_sqlserverflexbeta_instance.tcc_test_instance,
│   on 03-sql-server.tf line 7, in resource "stackitprivatepreview_sqlserverflexbeta_instance" "tcc_test_instance":
│    7: resource "stackitprivatepreview_sqlserverflexbeta_instance" "tcc_test_instance" {
│ 
│ Instance creation waiting: found non-GenericOpenApiError: create failed for instance with id
│ f35330de-6b1e-4a3a-9e0d-650b3c55a912
│ Trace ID: "b6d25a9534655d705c194cbef1f1b292"

Expected behavior

The SQL Server Flex BETA instance should be created successfully and reach a stable RUNNING or AVAILABLE state.

If provisioning fails internally, Terraform should return a more detailed and actionable error message from the API.

## Description When creating a stackitprivatepreview_sqlserverflexbeta_instance, the Terraform run fails during the provisioning phase. The instance remains in creating state for some time and then aborts with a non-GenericOpenApiError. The error message does not provide any actionable details besides the instance ID and a trace ID. The failure happens during initial creation. No manual changes were performed in parallel. ## Steps to reproduce ```terraform /*Copyright 2025 STACKIT GmbH & Co. KG <maintainer.email@stackit.cloud> Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.*/ resource "stackitprivatepreview_sqlserverflexbeta_instance" "tcc_test_instance" { project_id = var.tcc_project_id name = "schmidtsv-tcc-sqlserverflex" backup_schedule = "0 2 * * *" encryption = { kek_key_version = "1" kek_key_id = stackit_kms_key.key.key_id kek_key_ring_id = stackit_kms_keyring.tcc_keyring.keyring_id service_account = var.tcc_service_account_email } storage = { class = "premium-perf2-stackit" size = 5 } retention_days = 55 network = { acl = ["10.77.0.0/16"] access_scope = "SNA" } flavor_id = "4.32-Replica" version = 2022 } output "sqlserver_instance_id" { value = stackitprivatepreview_sqlserverflexbeta_instance.tcc_test_instance.instance_id } ``` 1. Run terraform init 2. Run terraform apply 3. Wait until provisioning starts 4. After ~1–2 minutes creation fails with error shown below ## Actual behavior Terraform fails with the following error: ```bash terraform apply Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: + create Terraform will perform the following actions: # stackit_kms_key.key will be created + resource "stackit_kms_key" "key" { + access_scope = "SNA" + algorithm = "aes_256_gcm" + display_name = "key-01" + id = (known after apply) + import_only = (known after apply) + key_id = (known after apply) + keyring_id = (known after apply) + project_id = "5da71386-b8c6-44ba-b030-d20b8400d69e" + protection = "software" + purpose = "symmetric_encrypt_decrypt" + region = "eu01" } # stackit_kms_keyring.tcc_keyring will be created + resource "stackit_kms_keyring" "tcc_keyring" { + description = "pipeline created keyring" + display_name = "pipeline-keyring" + id = (known after apply) + keyring_id = (known after apply) + project_id = "5da71386-b8c6-44ba-b030-d20b8400d69e" + region = "eu01" } # stackit_routing_table_route.tcc_rt_sql_server will be created + resource "stackit_routing_table_route" "tcc_rt_sql_server" { + created_at = (known after apply) + destination = { + type = "cidrv4" + value = (known after apply) } + id = (known after apply) + network_area_id = "ef1667fe-0c85-4b15-b020-3375cbce8310" + next_hop = { + type = "ipv4" + value = (known after apply) } + organization_id = "03a34540-3c1a-4794-b2c6-7111ecf824ef" + region = "eu01" + route_id = (known after apply) + routing_table_id = "64c5b91a-94f2-4ddc-80a8-f8b6ce98dc74" + updated_at = (known after apply) } # stackitprivatepreview_sqlserverflexbeta_instance.tcc_test_instance will be created + resource "stackitprivatepreview_sqlserverflexbeta_instance" "tcc_test_instance" { + backup_schedule = "0 2 * * *" + edition = (known after apply) + encryption = { + kek_key_id = (known after apply) + kek_key_ring_id = (known after apply) + kek_key_version = "1" + service_account = "pe-kms-test-6r534pi8@sa.stackit.cloud" } + flavor_id = "4.32-Replica" + id = (known after apply) + instance_id = (known after apply) + is_deletable = (known after apply) + name = "schmidtsv-tcc-sqlserverflex" + network = { + access_scope = "SNA" + acl = [ + "10.77.0.0/16", ] + instance_address = (known after apply) + router_address = (known after apply) } + project_id = "5da71386-b8c6-44ba-b030-d20b8400d69e" + region = "eu01" + replicas = (known after apply) + retention_days = 55 + status = (known after apply) + storage = { + class = "premium-perf2-stackit" + size = 5 } + version = "2022" } Plan: 4 to add, 0 to change, 0 to destroy. Changes to Outputs: + sqlserver_instance_id = (known after apply) ╷ │ Warning: stackit_routing_table_route is part of the routing-tables experiment. │ │ with stackit_routing_table_route.tcc_rt_sql_server, │ on 04-routing-tables.tf line 7, in resource "stackit_routing_table_route" "tcc_rt_sql_server": │ 7: resource "stackit_routing_table_route" "tcc_rt_sql_server" { │ │ This resource is part of the routing-tables experiment and is likely going to undergo significant │ changes or be removed in the future. Use it at your own discretion. │ │ (and one more similar warning elsewhere) ╵ Do you want to perform these actions? Terraform will perform the actions described above. Only 'yes' will be accepted to approve. Enter a value: yes stackit_kms_keyring.tcc_keyring: Creating... stackit_kms_keyring.tcc_keyring: Creation complete after 5s [id=5da71386-b8c6-44ba-b030-d20b8400d69e,eu01,61959807-b84a-46c7-af79-5f738a8477c0] stackit_kms_key.key: Creating... stackit_kms_key.key: Creation complete after 6s [id=5da71386-b8c6-44ba-b030-d20b8400d69e,eu01,61959807-b84a-46c7-af79-5f738a8477c0,a98bf84b-0e61-46d3-9b29-568536a1a4ec] stackitprivatepreview_sqlserverflexbeta_instance.tcc_test_instance: Creating... stackitprivatepreview_sqlserverflexbeta_instance.tcc_test_instance: Still creating... [00m10s elapsed] stackitprivatepreview_sqlserverflexbeta_instance.tcc_test_instance: Still creating... [00m20s elapsed] stackitprivatepreview_sqlserverflexbeta_instance.tcc_test_instance: Still creating... [00m30s elapsed] stackitprivatepreview_sqlserverflexbeta_instance.tcc_test_instance: Still creating... [00m40s elapsed] stackitprivatepreview_sqlserverflexbeta_instance.tcc_test_instance: Still creating... [00m50s elapsed] stackitprivatepreview_sqlserverflexbeta_instance.tcc_test_instance: Still creating... [01m00s elapsed] stackitprivatepreview_sqlserverflexbeta_instance.tcc_test_instance: Still creating... [01m10s elapsed] stackitprivatepreview_sqlserverflexbeta_instance.tcc_test_instance: Still creating... [01m20s elapsed] stackitprivatepreview_sqlserverflexbeta_instance.tcc_test_instance: Still creating... [01m30s elapsed] stackitprivatepreview_sqlserverflexbeta_instance.tcc_test_instance: Still creating... [01m40s elapsed] ╷ │ Error: [SQL Server Flex BETA - Create] error │ │ with stackitprivatepreview_sqlserverflexbeta_instance.tcc_test_instance, │ on 03-sql-server.tf line 7, in resource "stackitprivatepreview_sqlserverflexbeta_instance" "tcc_test_instance": │ 7: resource "stackitprivatepreview_sqlserverflexbeta_instance" "tcc_test_instance" { │ │ Instance creation waiting: found non-GenericOpenApiError: create failed for instance with id │ f35330de-6b1e-4a3a-9e0d-650b3c55a912 │ Trace ID: "b6d25a9534655d705c194cbef1f1b292" ╵ ``` ## Expected behavior The SQL Server Flex BETA instance should be created successfully and reach a stable RUNNING or AVAILABLE state. If provisioning fails internally, Terraform should return a more detailed and actionable error message from the API.
Author

creation of instance worked perfectly in the background.

creation of instance worked perfectly in the background.
Author

second run went successfully. Then its interesting to manage when the error occurs and to prevent it / catch it.


7111ecf824ef,eu01,ef1667fe-0c85-4b15-b020-3375cbce8310,64c5b91a-94f2-4ddc-80a8-f8b6ce98dc74,e488d5a8-258e-4fcb-a366-843088b29d95]
╷
│ Warning: stackit_routing_table_route is part of the routing-tables experiment.
│ 
│   with stackit_routing_table_route.tcc_rt_sql_server,
│   on 04-routing-tables.tf line 7, in resource "stackit_routing_table_route" "tcc_rt_sql_server":
│    7: resource "stackit_routing_table_route" "tcc_rt_sql_server" {
│ 
│ This resource is part of the routing-tables experiment and is likely going to undergo significant
│ changes or be removed in the future. Use it at your own discretion.
│ 
│ (and one more similar warning elsewhere)
╵

Apply complete! Resources: 2 added, 0 changed, 0 destroyed.

Outputs:

sqlserver_instance_id = "b9b63364-966a-474f-bc34-23b5e571210e"

second run went successfully. Then its interesting to manage when the error occurs and to prevent it / catch it. ```bash 7111ecf824ef,eu01,ef1667fe-0c85-4b15-b020-3375cbce8310,64c5b91a-94f2-4ddc-80a8-f8b6ce98dc74,e488d5a8-258e-4fcb-a366-843088b29d95] ╷ │ Warning: stackit_routing_table_route is part of the routing-tables experiment. │ │ with stackit_routing_table_route.tcc_rt_sql_server, │ on 04-routing-tables.tf line 7, in resource "stackit_routing_table_route" "tcc_rt_sql_server": │ 7: resource "stackit_routing_table_route" "tcc_rt_sql_server" { │ │ This resource is part of the routing-tables experiment and is likely going to undergo significant │ changes or be removed in the future. Use it at your own discretion. │ │ (and one more similar warning elsewhere) ╵ Apply complete! Resources: 2 added, 0 changed, 0 destroyed. Outputs: sqlserver_instance_id = "b9b63364-966a-474f-bc34-23b5e571210e" ```
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: stackit-dev-tools/terraform-provider-stackitprivatepreview#66
No description provided.