hashicorp/terraform · error

Can't ask approval for state migration when interactive…

Error message

Can't ask approval for state migration when interactive input is disabled.

Please remove the "-input=false" option and try again.

What it means

`promptMultiToSingleCloudMigration` returns this when collapsing a multi-state backend into a single cloud workspace needs a confirmation but input is disabled (`m.input == false`) and `-force` is not set. This path is lossy by nature (multiple workspaces -> one), so Terraform insists on explicit consent.

Solutions

  1. Reconsider the migration: multi->single is destructive; instead target a `cloud` block that preserves separate workspaces.
  2. Run interactively (drop `-input=false`) and confirm you accept the consolidation.
  3. If intentional, pass `-migrate-state -force` and verify the surviving state afterward.
Defensive patterns

Strategy: validation

Validate before calling

// Before multi->single cloud migration:
if !m.input && !opts.force {
    return errors.New(strings.TrimSpace(errInteractiveInputDisabled))
}

Prevention

When it happens

Trigger: `terraform init` migrates from a multi-state backend (e.g. `backend "remote"` with multiple named workspaces) into a single cloud workspace, `m.input == false`, `opts.force == false`.

Common situations: Consolidating workspaces during a backend refactor in CI; the multi->single reduction can drop states and Terraform will not do it silently.

Related errors


AI-assisted analysis of hashicorp/terraform@d32a084675 (2026-08-11). Data as JSON: /api/errors/45c02ae092a2472a. Report an issue: GitHub.

Appendix: source

Thrown at internal/command/meta_backend_migrate.go:924

			Description: fmt.Sprintf(strings.TrimSpace(tfcInputBackendMigrateRemoteMultiToCloud), appName),
		})
		if err != nil {
			return fmt.Errorf("Error asking for state migration action: %s", err)
		}
	}

	if !migrate {
		return fmt.Errorf("Migration aborted by user.")
	}

	return nil
}

// Multi-state to single state.
func (m *Meta) promptMultiToSingleCloudMigration(opts *backendMigrateOpts) error {
	if !m.input {
		log.Print("[TRACE] backendMigrateState: can't prompt for input, so aborting migration")
		return errors.New(strings.TrimSpace(errInteractiveInputDisabled))
	}
	migrate := opts.force
	if !migrate {
		var err error
		appName := "HCP Terraform"
		if cloudBackend, ok := opts.Destination.(*cloud.Cloud); ok {
			appName = cloudBackend.AppName()
		}
		srcWord := backendHumanName(opts.Source)
		// Ask the user if they want to migrate their existing remote state
		migrate, err = m.confirm(&terraform.InputOpts{
			Id:    "backend-migrate-multistate-to-single",
			Query: "Do you want to copy only your current workspace?",
			Description: fmt.Sprintf(
				strings.TrimSpace(tfcInputBackendMigrateMultiToSingle),
				opts.SourceType, srcWord, opts.destinationWorkspace, appName),
		})
		if err != nil {

View on GitHub (pinned to d32a084675)