{"record":{"id":"42462ec6d8b2b85e","repo":"hashicorp/terraform","slug":"errrequestcanceled","errorCode":"ErrRequestCanceled","errorMessage":"request was canceled","messagePattern":"request was canceled","errorType":"exception","errorClass":"ErrRequestCanceled","httpStatus":null,"severity":"warning","filePath":"internal/pluginshared/errors.go","lineNumber":17,"sourceCode":"// Copyright IBM Corp. 2014, 2026\n// SPDX-License-Identifier: BUSL-1.1\n\npackage pluginshared\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n)\n\nvar (\n\t// ErrPluginNotSupported is the error returned when the upstream HCP Terraform does not\n\t// have a manifest.\n\tErrPluginNotSupported = errors.New(\"plugin is not supported by the remote version of Terraform Enterprise\")\n\n\t// ErrRequestCanceled is the error returned when the context was cancelled.\n\tErrRequestCanceled = errors.New(\"request was canceled\")\n\n\t// ErrArchNotSupported is the error returned when the plugin does not have a build for the\n\t// current OS/Architecture.\n\tErrArchNotSupported = errors.New(\"plugin is not supported by your computer architecture/operating system\")\n\n\t// ErrPluginNotFound is the error returned when the plugin manifest points to a location\n\t// that was does not exist.\n\tErrPluginNotFound = errors.New(\"plugin download was not found in the location specified in the manifest\")\n)\n\n// ErrQueryFailed is the error returned when the plugin http client request fails\ntype ErrQueryFailed struct {\n\tinner error\n}\n\n// ErrCloudPluginNotVerified is the error returned when the archive authentication process fails\ntype ErrCloudPluginNotVerified struct {\n\tinner error","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/hashicorp/terraform/blob/c9def3e214014c1188faabfc4a5bde5095139765/internal/pluginshared/errors.go#L1-L35","documentation":"ErrRequestCanceled is a sentinel error returned by the pluginshared HTTP client when the request's context is canceled (errors.Is(err, context.Canceled)) during FetchManifest or DownloadFile. It is an intentional cancellation signal, not a transport failure, and is propagated so callers can distinguish a user-initiated stop from a genuine network error.","triggerScenarios":"Returned at internal/pluginshared/client.go:175 (FetchManifest) and :215 (DownloadFile) when the underlying retryablehttp request fails and errors.Is(err, context.Canceled) is true. Also surfaced by the getproviders layer as ErrRequestCanceled{} (internal/getproviders/errors.go:224).","commonSituations":"User pressed Ctrl+C during `terraform init` while a plugin/manifest download is in flight. A parent operation (plan/apply) was canceled or hit its deadline. An automation runner (CI) canceled the step on timeout. A context with a short timeout was attached to the plugin fetch.","solutions":["Treat as expected: if the user interrupted, no fix is needed — rerun the command when ready.","If it happens unprompted, raise the timeout on the parent context or the CI step that wraps the operation.","Check that no wrapper script is sending SIGINT/SIGTERM prematurely.","If recurring in automation, ensure the runner's job timeout exceeds the worst-case plugin download time."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Pass a context you control; cancel only on real interrupts.\nctx, cancel := context.WithCancel(parentCtx)\ndefer cancel()\n// client.FetchManifest uses b.ctx internally; build it from ctx.","typeGuard":"func isRequestCanceled(err error) bool {\n    return errors.Is(err, pluginshared.ErrRequestCanceled) || errors.Is(err, context.Canceled) || errors.Is(err, getproviders.ErrRequestCanceled{})\n}","tryCatchPattern":"rel, err := client.FetchManifest(lastModified)\nif errors.Is(err, pluginshared.ErrRequestCanceled) {\n    // intentional cancel: exit cleanly, do not retry\n    return nil\n}","preventionTips":["Do not attach artificially short deadlines to plugin fetch contexts.","Distinguish cancellation from real failures so you don't retry on Ctrl+C.","In CI, ensure the job timeout exceeds expected download time."],"tags":["plugin","context","cancellation","network"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T21:17:07.882Z"}