Skip to content

2.6.1 introduced a bug in the error_message_regex #975

@ronaldvb-k

Description

@ronaldvb-k

Version 2.6.1 introduced an issue with error_message_regex retry parameter.

We have a generic TF module to create runCommands using the Microsoft.HybridCompute/machines/runCommands API.

In the module, the error_message_regex parameter is a empy list of strings by default (see below). But in some cases we have to specify an error messages, that's why it's variable.

  retry = {
    error_message_regex = try(each.value.retry.error_message_regex, [""])
  }

This worked fine in version 2.5, but since we upgraded to 2.6.1 we noticed that the creation always fails (hitting the 30m creation timeout).

In the debug logging, we noticed that the error_message_regex is always matched because both the error message and regex are empty.

2025-09-01T12:44:10.929+0200 [DEBUG] provider.terraform-provider-azapi_v2.6.1:  matches regex
2025-09-01T12:44:10.929+0200 [DEBUG] provider.terraform-provider-azapi_v2.6.1: [DEBUG] Sep  1 12:44:10.928984 Retry: End Try #3, Delay=15s
2025-09-01T12:44:25.934+0200 [DEBUG] provider.terraform-provider-azapi_v2.6.1: [DEBUG] Sep  1 12:44:25.934171 Retry: =====> Try=4 for PUT https://management.azure.com/subscriptions/xxxx/resourceGroups/rg-xxxx/providers/Microsoft.HybridCompute/machines/vm-xxx/runCommands/command-xxx?api-version=2024-07-31-preview
2025-09-01T12:44:25.934+0200 [DEBUG] provider.terraform-provider-azapi_v2.6.1: [DEBUG] Sep  1 12:44:25.934572 Request: ==> OUTGOING REQUEST (Try=4)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions