Introduction
Problem
Customers running Terraform Enterprise may be unable to safely delete workspaces. The UI returns the error:
latest workspace state is being processed to discover resources. Please try again later
Investigation shows that the resources_processed flag on workspace state versions remains false, even after successful runs and destroys. This prevents safe deletion and forces customers to rely on restarts or force-delete operations, which are not acceptable in many environments.
Prerequisites
Terraform Enterprise v202404 to 1.0.3
Causes
This error message is caused by the following reason(s):
This issue is caused by a known bug in the WorkspaceResourcesWorker, which is present in affected versions and removed in TFE v1.1.0.
Solutions:
Engineering has confirmed that this issue is fully resolved by upgrading to Terraform Enterprise v1.1.0 or later, where the WorkspaceResourcesWorker has been removed. No backport or patch will be provided for earlier versions, as a workaround, the workspaces can be deleted in this state using the Force Delete API. After the upgrade, resource processing jobs should complete as expected, the resources_processed flag will be correctly updated, and workspaces should no longer become stuck in an non-deletable state.
Additional Information
Here is a link to the release notes for 1.1.1 for more information:
1.1.x - Terraform Enterprise | Terraform | HashiCorp DeveloperLink to Force Delete API Documentation: Force Delete API