hashicorp/terraform · warning

Provider installation was canceled by an interrupt signal.

Error message

Provider installation was canceled by an interrupt signal.

What it means

Returned by getSingleProvider when, after calling inst.EnsureProviderVersions, ctx.Err() == context.Canceled — i.e. the user interrupted (Ctrl-C) the provider download during `terraform state migrate`. It is a clean cancellation diagnostic, not a corruption error; no partial provider install is committed to the lock file.

Source

Thrown at internal/command/state_migrate.go:599

			}

			// 2. Call the shared callback for FetchPackageSuccess
			cb := fetchPackageSuccessCallback(view)
			cb(provider, version, localDir, authResult)
		},
		ProvidersLockUpdated: providersLockUpdatedCallback(&c.incompleteProviders),
		ProvidersFetched:     providersFetchedCallback(view),
	}
	ctx = evts.OnContext(ctx)

	mode := providercache.InstallNewProvidersOnly
	if upgrade {
		mode = providercache.InstallUpgrades
	}

	newLocks, err := inst.EnsureProviderVersions(ctx, locks, reqs, mode)
	if ctx.Err() == context.Canceled {
		diags = diags.Append(fmt.Errorf("Provider installation was canceled by an interrupt signal."))
		return true, nil, Invalid, nil, diags
	}
	if err != nil {
		// The errors captured in "err" should be redundant with what we
		// received via the InstallerEvents callbacks above, so we'll
		// just return those as long as we have some.
		if !diags.HasErrors() {
			diags = diags.Append(err)
		}

		return true, nil, Invalid, nil, diags
	}

	// Return advice to the calling code about what to do regarding safe state store provider installation
	trust = c.determineIfProviderTrusted(stateStore.ProviderAddr, providerLocations, locks)

	return true, newLocks, trust, stateStoreProviderAuthResult, diags
}

View on GitHub (pinned to c9def3e214)

Solutions

  1. Simply re-run `terraform state migrate`; provider downloads are idempotent and cached.
  2. Pre-install providers first with `terraform init` so migrate has little to download.
  3. If cancellation happened by accident, retry and let it complete.
  4. In CI, ensure the job timeout exceeds provider download time, or pre-warm the plugin cache.

Example fix

# before: accidental Ctrl-C during migrate
terraform state migrate
^C  # Provider installation was canceled by an interrupt signal.

# after: pre-install then migrate
terraform init
terraform state migrate
Defensive patterns

Strategy: retry

Try / catch

// handle cancellation gracefully: clean partial state, allow safe retry
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
if _, err := inst.EnsureProviderVersions(ctx, locks, reqs, mode); ctx.Err() == context.Canceled {
    // provider install was cancelled; clean partial cache and let caller retry
    return errCancelled
}

Prevention

When it happens

Trigger: Pressing Ctrl-C (or sending SIGINT) while `terraform state migrate` is downloading the source or destination state-store provider via EnsureProviderVersions.

Common situations: Long provider downloads on slow networks; user aborting because the wrong provider/version was being pulled; CI job timeout sending SIGINT; accidentally cancelling an in-progress large provider download.

Related errors


AI-assisted analysis of hashicorp/terraform@c9def3e214 (2026-08-07). Data as JSON: /api/errors/78f244e3620762b8. Report an issue: GitHub.