Problem
A Terraform Enterprise workspace becomes unavailable in the UI without any apparent deletion or destroy action. The absence of deletion logs in the support bundle makes it difficult to trace the cause.
Cause
This issue can stem from two primary causes:
- Disk Path and Backup Inconsistencies: Issues related to virtual machine snapshots, folder-level restores, or improper use of the backup and restore API can lead to data inconsistencies where workspace data is not correctly restored or becomes out of sync.
- External Database State Issues: If Terraform Enterprise uses an external database, a database rollback to an earlier state can remove records of recently created workspaces. Connecting to an incorrect database instance can also cause workspaces to appear missing.
Solutions
Follow the solution that matches your Terraform Enterprise configuration.
Solution 1: Investigate Disk Path and Backup Issues
If your Terraform Enterprise instance uses a mounted disk setup, investigate potential issues with backup, restore, or snapshot operations.
- Review VM Snapshots: Check if a virtual machine snapshot or restore operation has been recently executed. Review the most recent available backup for any inconsistencies.
- Verify Folder Backup Integrity: Confirm that any recent folder-based backup restoration completed successfully and included all required workspace data and configurations.
- Validate API-Based Restores: If you used the backup and restore API, ensure the process was performed correctly. Conduct a thorough check to confirm the integrity of the restored data and verify that no critical files or settings were missed during the operation.
Solution 2: Verify External Database State
If your Terraform Enterprise instance uses an external database, verify its state and connectivity.
- Check for Database Rollbacks: Determine if a database rollback occurred. If so, identify the last known stable state of the database before the rollback to understand what data may have been lost.
- Confirm Database Connection: Ensure that Terraform Enterprise is properly connected to the correct database instance. Incorrect connection details can lead to the application reading from an empty or outdated database.
Additional Information
For more details on the backup and restore process, refer to the Backup and Restore API documentation.