Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LRO Polling fails from time to time #4571

Open
paulomarquesc opened this issue Dec 2, 2024 · 0 comments
Open

LRO Polling fails from time to time #4571

paulomarquesc opened this issue Dec 2, 2024 · 0 comments

Comments

@paulomarquesc
Copy link
Contributor

paulomarquesc commented Dec 2, 2024

While executing a VolumesDeleteReplicationThenPoll function to delete replication of an Azure NetApp Files volume, I'm getting this error:

pmarques [ ~/go/src/github.com/hashicorp/terraform-provider-azurerm ]$ make acctests SERVICE='netapp' TESTARGS=' -parallel 5 -run=TestAccNetAppVolumeGroupSAPHana_crossRegionReplication -count=1' TESTTIMEOUT='1200m'
==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
==> Checking that acceptance test packages are used...
TF_ACC=1 go test -v ./internal/services/netapp -parallel 5 -run=TestAccNetAppVolumeGroupSAPHana_crossRegionReplication -count=1 -timeout 1200m -ldflags="-X=github.com/hashicorp/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccNetAppVolumeGroupSAPHana_crossRegionReplication
=== PAUSE TestAccNetAppVolumeGroupSAPHana_crossRegionReplication
=== CONT  TestAccNetAppVolumeGroupSAPHana_crossRegionReplication
    testcase.go:173: Error running post-test destroy, there may be dangling resources: exit status 1

        Error: deleting `volume`: deleting replicate Volume (Subscription: "66bc9830-19b6-4987-94d2-0e487be7aa47"
        Resource Group Name: "acctestRG-netapp-241202210223147768"
        Net App Account Name: "acctest-NetAppAccount-Secondary-241202210223147768"
        Capacity Pool Name: "acctest-NetAppPool-Secondary-241202210223147768"
        Volume Name: "acctest-NetAppVolume-1-Secondary-241202210223147768"): polling after VolumesDeleteReplication: `result.Status` was nil/empty - `op.Status` was "DeleteReplication" / `op.Properties.ProvisioningState` was ""

        deleting `volume`: deleting replicate Volume (Subscription:
        "66bc9830-19b6-4987-94d2-0e487be7aa47"
        Resource Group Name: "acctestRG-netapp-241202210223147768"
        Net App Account Name: "acctest-NetAppAccount-Secondary-241202210223147768"
        Capacity Pool Name: "acctest-NetAppPool-Secondary-241202210223147768"
        Volume Name: "acctest-NetAppVolume-1-Secondary-241202210223147768"): polling
        after VolumesDeleteReplication: `result.Status` was nil/empty - `op.Status`
        was "DeleteReplication" / `op.Properties.ProvisioningState` was ""
--- FAIL: TestAccNetAppVolumeGroupSAPHana_crossRegionReplication (1444.04s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-azurerm/internal/services/netapp        1444.060s
FAIL
make: *** [GNUmakefile:103: acctests] Error 1

This is intermittent but I've got it so many times that it is time to open an issue about this with the Hashicorp SDK. This happened with other resource types and operations as well for Azure NetApp Files but it is being very consistent on VolumesDeleteReplicationThenPoll() method.

My workaround is to replace the VolumesDeleteReplicationThenPoll function with VolumesDeleteReplication only and keep the wait function there.

Here is the code snippet example of this latest issue:

if _, err = replicationClient.VolumesDeleteReplicationThenPoll(ctx, pointer.From(replicaVolumeId)); err != nil {
    return fmt.Errorf("deleting replicate %s: %+v", pointer.From(replicaVolumeId), err)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant