The following error may occur when beginning a Terraform run in TFE:
error asking for state migration action: input disabled
Cause of the error
This error occurs when a Terraform state is present in the configuration files that are ingressed into TFE via VCS integration or API upload (push).
terraform init runs in TFE, it runs non-interactively. During initialization, if a local state file is present, it discovers the local state and attempts to initialize the TFE backend, which triggers a state migration. Since Terraform is running in an automated manner (
input disabled), the interactive migration prompts cannot be shown and the run exits with an error.
Resolution for the error
The state for a run in TFE should come from the TFE backend and should not be present in the configuration. To resolve the error, inspect the VCS repository or directory to ensure that the
.terraform directory is not tracked by the VCS or pushed with the configuration.
To prevent the
.terraform directory from being tracked in the future, include it in the VCS’s ignore file such as