You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
------- Stdout: -------
=== RUN TestAccStorageSync_update
=== PAUSE TestAccStorageSync_update
=== CONT TestAccStorageSync_update
testcase.go:113: Step 5/6 error: Error running apply: exit status 1
Error: creating Storage Sync Service (Subscription: "*******"
Resource Group Name: "acctestRG-ss-230725005007008353"
Storage Sync Service Name: "acctest-SS-230725005007008353"): polling after StorageSyncServicesCreate: `result.Status` was nil/empty - `op.Status` was "finishNewStorageSyncService" / `op.Properties.ProvisioningState` was ""
with azurerm_storage_sync.test,
on terraform_plugin_test.tf line 24, in resource "azurerm_storage_sync" "test":
24: resource "azurerm_storage_sync" "test" {
--- FAIL: TestAccStorageSync_update (403.32s)
FAIL
The reason is as seen in the above error message, that the service API returns some unknown status, which doesn't belong to any of the status expected by longRunningOperationPoller:
ifpt.resp.StatusCode==http.StatusAccepted {
pt.State=operationInProgress
} elseifprovStateApl {
ifps:=pt.getProvisioningState(); ps!=nil {
pt.State=*ps
} else {
pt.State=operationSucceeded
}
} else {
returnautorest.NewError("pollingTrackerBase", "updatePollingState", "the response from the async operation has an invalid status code")
}
In this case, any unknown status will be regarded as succeeded as long as the response status code is successful. This somehow hides the issue, whilst I don't think it is the right way.
So my question is do I need to extend the "known" status for the longRunningOperationPoller to include the reported status?
The problem is that, from the test failures, so far we have following status for storage sync resource:
finishNewStorageSyncService
validateInput
newPrivateDnsEntries
And we have following status for the storage sync cloud endpoint resource:
newReplicaGroup
The swagger doesn't define the full list of status, where the status is defined as a plain string.
References
No response
The text was updated successfully, but these errors were encountered:
In this case it's unfortunate that these aren't documented within the Swagger since they are in some of the other API's - newer API's limit the provisioningState values to 5 defined values (succeeded etc) and instead use another field for this "sub-status" (kusto/aks/hdinsight do this iirc).
FWIW we're intentionally not interpreting an unexpected value as pending to ensure we're handling these correctly/to avoid polling indefinitely - since these should all be caught by the acctests/during development of these resources - these unknown provisioningState's shouldn't be shipped to users (and whilst I can understand the legacy base layer using this approach, we're intentionally not doing that to ensure we're avoiding infinite polling issues etc).
Is there an existing issue for this?
Community Note
Service Used
StorageSync
API Versions Used
2020-03-01
Description
Since migrating
storage_sync
resources tohashicorp/go-azure-sdk
, the acctests for storage sync and the alikes keep failing, e.g.:The reason is as seen in the above error message, that the service API returns some unknown
status
, which doesn't belong to any of the status expected bylongRunningOperationPoller
:https://github.com/magodo/terraform-provider-azurerm/blob/main/vendor/github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager/poller_lro.go#L152-L171.
In contrast, the Track1 SDK has below logic for polling:
https://github.com/magodo/terraform-provider-azurerm/blob/d6bc225707d78a51f7db65824bb84aab197aa536/vendor/github.com/Azure/go-autorest/autorest/azure/async.go#L570-L575
In this case, any unknown status will be regarded as succeeded as long as the response status code is successful. This somehow hides the issue, whilst I don't think it is the right way.
So my question is do I need to extend the "known" status for the
longRunningOperationPoller
to include the reported status?The problem is that, from the test failures, so far we have following status for storage sync resource:
And we have following status for the storage sync cloud endpoint resource:
The swagger doesn't define the full list of status, where the
status
is defined as a plain string.References
No response
The text was updated successfully, but these errors were encountered: