{"record":{"id":"78f244e3620762b8","repo":"hashicorp/terraform","slug":"provider-installation-was-canceled-by-an-interrupt-78f244","errorCode":null,"errorMessage":"Provider installation was canceled by an interrupt signal.","messagePattern":"Provider installation was canceled by an interrupt signal\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/command/state_migrate.go","lineNumber":599,"sourceCode":"\t\t\t}\n\n\t\t\t// 2. Call the shared callback for FetchPackageSuccess\n\t\t\tcb := fetchPackageSuccessCallback(view)\n\t\t\tcb(provider, version, localDir, authResult)\n\t\t},\n\t\tProvidersLockUpdated: providersLockUpdatedCallback(&c.incompleteProviders),\n\t\tProvidersFetched:     providersFetchedCallback(view),\n\t}\n\tctx = evts.OnContext(ctx)\n\n\tmode := providercache.InstallNewProvidersOnly\n\tif upgrade {\n\t\tmode = providercache.InstallUpgrades\n\t}\n\n\tnewLocks, err := inst.EnsureProviderVersions(ctx, locks, reqs, mode)\n\tif ctx.Err() == context.Canceled {\n\t\tdiags = diags.Append(fmt.Errorf(\"Provider installation was canceled by an interrupt signal.\"))\n\t\treturn true, nil, Invalid, nil, diags\n\t}\n\tif err != nil {\n\t\t// The errors captured in \"err\" should be redundant with what we\n\t\t// received via the InstallerEvents callbacks above, so we'll\n\t\t// just return those as long as we have some.\n\t\tif !diags.HasErrors() {\n\t\t\tdiags = diags.Append(err)\n\t\t}\n\n\t\treturn true, nil, Invalid, nil, diags\n\t}\n\n\t// Return advice to the calling code about what to do regarding safe state store provider installation\n\ttrust = c.determineIfProviderTrusted(stateStore.ProviderAddr, providerLocations, locks)\n\n\treturn true, newLocks, trust, stateStoreProviderAuthResult, diags\n}","sourceCodeStart":581,"sourceCodeEnd":617,"githubUrl":"https://github.com/hashicorp/terraform/blob/c9def3e214014c1188faabfc4a5bde5095139765/internal/command/state_migrate.go#L581-L617","documentation":"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.","triggerScenarios":"Pressing Ctrl-C (or sending SIGINT) while `terraform state migrate` is downloading the source or destination state-store provider via EnsureProviderVersions.","commonSituations":"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.","solutions":["Simply re-run `terraform state migrate`; provider downloads are idempotent and cached.","Pre-install providers first with `terraform init` so migrate has little to download.","If cancellation happened by accident, retry and let it complete.","In CI, ensure the job timeout exceeds provider download time, or pre-warm the plugin cache."],"exampleFix":"# before: accidental Ctrl-C during migrate\nterraform state migrate\n^C  # Provider installation was canceled by an interrupt signal.\n\n# after: pre-install then migrate\nterraform init\nterraform state migrate","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// handle cancellation gracefully: clean partial state, allow safe retry\nctx, cancel := context.WithCancel(context.Background())\ndefer cancel()\nif _, err := inst.EnsureProviderVersions(ctx, locks, reqs, mode); ctx.Err() == context.Canceled {\n    // provider install was cancelled; clean partial cache and let caller retry\n    return errCancelled\n}","preventionTips":["Pre-install providers with `terraform init` so migrate has little to download.","Pre-warm a shared plugin cache in CI to shorten downloads.","Size CI timeouts to exceed provider download time.","Avoid Ctrl-C during downloads; cancel cleanly only if the wrong provider was selected."],"tags":["state-migrate","provider","interrupt","cancellation"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T21:17:07.882Z"}