Loading...
Loading...
### Terraform Version ```shell C:\projects> terraform version Terraform v1.2.8 on windows_amd64 ``` ### Terraform Configuration Files ```terraform cannot easily share at this time ``` ### Debug Output [TF_LOG=trace terraform workspace list](https://gist.github.com/coderjoe/0c9012bfbcea5d0a76c9224f61fed131) ### Expected Behavior Terraform should list all workspaces ### Actual Behavior The list of workspaces is not deterministic. The length changes constantly and it returns different values on every call. ### Steps to Reproduce 1. Create many workspaces (a few hundred) 2. Attempt to list those workspaces with `terraform workspace list` 3. Note that the list changes slightly on each call ### Additional Context We believe the issue happens due to these lines [34 through 37 in backend_state.go](https://github.com/hashicorp/terraform/blob/main/internal/backend/remote-state/azure/backend_state.go#L34) They fetch the blobs using ListBlobs - but ListBlobs does not return the same results on every call. It [may or may not also return a "NextMarker"](https://github.com/tombuildsstuff/giovanni/blob/master/storage/2018-11-09/blob/containers/list_blobs.go#L28) which if present would require another call to ListBlobs in order to fetch the rest of the results. The backend does not appear to handle the edge case where a NextMarker is returned, omitting every result after the first request. The attached debug log seems to corroborate this presumption by returning a NextMarker in the response when it does not work properly. ### References _No response_
Click on a version to see all relevant bugs
Terraform Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.