Problem:
A Terraform Enterprise workspace becomes unavailable in the UI without any deletion or destroy action performed. Additionally, no logs are available to trace the deletion, making it challenging to identify the cause as no deletion logs are available in the support bundle.
Cause:
Disk Path Issues (Mounted Disk Setup):
- Snapshot or restore issues: Restoring the virtual machine to a previous snapshot may lead to inconsistencies in workspace data.
- Folder backup restore issues: Using the folder backup restore option may not fully restore workspaces, resulting in missing data.
- Improper use of the backup and restore API: If the Terraform Enterprise backup and restore API was not used correctly, it could cause workspaces to be missing.
Database Rollback (External Services):
- Database rollback may remove recently created workspaces if the database is restored to an earlier state.
- Connecting Terraform Enterprise to a different or incorrect database can result in missing workspaces in the UI.
Solution:
If using mounted disk setups:
- Check whether a virtual machine snapshot or restore operation has been executed, and review the most recent available backup for any inconsistencies or issues.
- Verify that the folder backup restoration was completed successfully, ensuring it includes all required workspace data and configurations necessary for proper functionality.
- If you're utilizing the backup and restore API, ensure that the process was carried out correctly. Conduct a thorough check to confirm the integrity of the restored data, ensuring that no critical files or settings were missed during the operation.
For external databases:
- Verify whether a database rollback took place and determine the last stable or consistent state of the database prior to the rollback.
- Ensure that Terraform Enterprise is properly connected to the intended and correct database instance to avoid any potential issues related to configuration or connectivity.
Additional Information:
For more details, refer to the backup and restore API documentation here: [https://developer.hashicorp.com/terraform/enterprise/deploy/replicated/administration/infrastructure/backup-restore]