Problem:
When attempting to change the name of a workspace, the following error is given, despite no pending runs in the UI:Name cannot be changed while a run has not completed
Cause:
The above-mentioned validation error occurs when the workspace contains runs with a status not included in the following list:
applied, discarded, errored, canceled, policy_soft_failed, planned_and_finished, assessed, assessing
Solution:
Review the Runs tab in the workspace and search for any runs which do not have those statuses, and resolve them.
It is also possible to list all runs in a workspace with the Runs API to view the current statuses across all runs: https://developer.hashicorp.com/terraform/enterprise/api-docs/run#list-runs-in-a-workspace
Outcome:
Once all runs are in one of the above mentioned statuses, attempt to rename the workspace again. If this is still not successful, please open a ticket with Hashicorp Support for review.