{"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":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/command/state_migrate.go","lineNumber":606,"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":588,"sourceCodeEnd":624,"githubUrl":"https://github.com/hashicorp/terraform/blob/d32a084675427f5ac3f7d2868578ef8b2c1dc525/internal/command/state_migrate.go#L588-L624","documentation":"Thrown after inst.EnsureProviderVersions returns when ctx.Err() == context.Canceled. This is a deliberate, user-initiated cancellation — the run was interrupted (Ctrl+C or SIGINT) while downloading state-store providers required for migration. No underlying err is wrapped; it is a fixed diagnostic.","triggerScenarios":"User presses Ctrl+C (or pipeline sends SIGINT / context cancel) while `terraform state migrate` is still installing state-store providers in EnsureProviderVersions. The install is aborted mid-download.","commonSituations":"Impatient Ctrl+C during a slow provider download; CI job timeout sending SIGTERM; orchestrator canceling the step; running in a wrapper that sends SIGINT on unrelated failure.","solutions":["Re-run `terraform state migrate` — provider install will resume from cache.","Pre-install providers with `terraform init` so the migration has nothing to download.","If using CI, raise the step timeout to cover a cold provider download.","Avoid interrupting mid-migration: state is consistent but you will redo the install."],"exampleFix":"# before\n terraform state migrate   # Ctrl+C during download\n\n# after\n terraform init\n terraform state migrate","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"select {\ncase <-ctx.Done():\n    if ctx.Err() == context.Canceled {\n        diags = diags.Append(fmt.Errorf(\"Provider installation was canceled by an interrupt signal.\"))\n        return true, nil, Invalid, nil, diags\n    }\ndefault:\n}","preventionTips":["Pre-install providers with `terraform init` so migrations do not download at runtime.","Raise CI step timeouts to cover cold provider downloads.","Avoid Ctrl+C during provider install; let it complete or fail naturally.","Use `terraform providers lock` to pre-seed the plugin cache for offline runs."],"tags":["terraform","state-migration","provider","interrupt","context","signal"],"backgroundTag":null,"analyzedSha":"d32a084675427f5ac3f7d2868578ef8b2c1dc525","analyzedAt":"2026-08-11T18:43:52.779Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}