Problem
During Sentinel policy runs in Terraform Enterprise, you may encounter the following error:
An error occurred: unsupported state format version: expected ["0.1" "0.2"], got "1.0"
Prerequisites
This issue affects Terraform Enterprise release versions prior to v202111-1.
Cause
This error occurs when Terraform plan JSON files require a higher version of the terraform-json library than the version supported by your installation of Terraform Enterprise. This mismatch typically happens when using a newer Terraform CLI version with an older Terraform Enterprise instance.
Solutions
There are two primary approaches to resolve this issue.
Solution 1: Upgrade Terraform Enterprise
Install a more recent version of Terraform Enterprise. Newer versions include the necessary packages to interface with modern versions of the Terraform CLI.
Solution 2: Downgrade the Workspace Terraform Version
Downgrade the Terraform version used in the affected workspace to a version that is compatible with your current installation of Terraform Enterprise.
Outcome
After upgrading Terraform Enterprise or downgrading the workspace's Terraform CLI version, the "unsupported state format version" error will no longer occur during Sentinel runs.