{"record":{"id":"03e22eb3b040400b","repo":"hashicorp/terraform","slug":"resp-error","errorCode":null,"errorMessage":"${resp.Error}","messagePattern":"\\$\\{resp\\.Error\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/plugin/grpc_provider.go","lineNumber":535,"sourceCode":"\tprotoResp, err := p.client.Configure(p.ctx, protoReq)\n\tif err != nil {\n\t\tresp.Diagnostics = resp.Diagnostics.Append(grpcErr(err))\n\t\treturn resp\n\t}\n\tresp.Diagnostics = resp.Diagnostics.Append(convert.ProtoToDiagnostics(protoResp.Diagnostics))\n\treturn resp\n}\n\nfunc (p *GRPCProvider) Stop() error {\n\tlogger.Trace(\"GRPCProvider: Stop\")\n\n\tresp, err := p.client.Stop(p.ctx, new(proto.Stop_Request))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif resp.Error != \"\" {\n\t\treturn errors.New(resp.Error)\n\t}\n\treturn nil\n}\n\nfunc (p *GRPCProvider) ReadResource(r providers.ReadResourceRequest) (resp providers.ReadResourceResponse) {\n\tlogger.Trace(\"GRPCProvider: ReadResource\")\n\n\tschema := p.GetProviderSchema()\n\tif schema.Diagnostics.HasErrors() {\n\t\tresp.Diagnostics = schema.Diagnostics\n\t\treturn resp\n\t}\n\n\tresSchema, ok := schema.ResourceTypes[r.TypeName]\n\tif !ok {\n\t\tresp.Diagnostics = resp.Diagnostics.Append(fmt.Errorf(\"unknown resource type %s\", r.TypeName))\n\t\treturn resp\n\t}","sourceCodeStart":517,"sourceCodeEnd":553,"githubUrl":"https://github.com/hashicorp/terraform/blob/d32a084675427f5ac3f7d2868578ef8b2c1dc525/internal/plugin/grpc_provider.go#L517-L553","documentation":"Thrown by GRPCProvider.Stop() (plugin v5) when the provider's Stop RPC returned no transport error but set a non-empty `Error` string in the Stop response. Stop is invoked during `terraform destroy` / shutdown; the provider uses this string to report that it could not cleanly stop a running process (e.g., a long-running operation, graceful-shutdown failure). The raw string is wrapped verbatim in errors.New.","triggerScenarios":"Running an operation that triggers provider Stop (e.g., interrupting a destroy) and the provider reported a failure to stop one of its managed processes.","commonSituations":"A provider that manages long-running daemons (e.g., kubernetes, a custom provider supervising a process) failing graceful shutdown. Interrupting apply/destroy while the provider holds resources.","solutions":["Retry the operation; transient stop failures often succeed on a clean re-run after the prior process exits.","Manually clean up any external process the provider reported it could not stop.","Upgrade the provider — known stop-handling bugs are fixed over time.","Capture the provider's reported message; it is passed through as-is and usually names the affected resource."],"exampleFix":"# before\n$ terraform destroy   # interrupted -> provider stop error\n\n# after\n# let prior process exit, then re-run\n$ terraform destroy","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"# Go (terraform plugin client caller): treat Stop error as best-effort\nif err := provider.Stop(); err != nil {\n    log.Printf(\"warn: provider stop reported: %v\", err) // non-fatal\n}","preventionTips":["Treat provider Stop errors as non-fatal warnings during teardown where possible.","Avoid interrupting long-running applies mid-flight.","Keep providers current — stop-handling improves over releases."],"tags":["terraform","provider","grpc","plugin-v5","shutdown"],"backgroundTag":null,"analyzedSha":"d32a084675427f5ac3f7d2868578ef8b2c1dc525","analyzedAt":"2026-08-11T18:43:52.779Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}