{"record":{"id":"d6da8de13970b763","repo":"hashicorp/terraform","slug":"protoresp-error","errorCode":null,"errorMessage":"${protoResp.Error}","messagePattern":"\\$\\{protoResp\\.Error\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/plugin/grpc_provisioner.go","lineNumber":166,"sourceCode":"\t\t\tbreak\n\t\t}\n\n\t\tif len(rcv.Diagnostics) > 0 {\n\t\t\tresp.Diagnostics = resp.Diagnostics.Append(convert.ProtoToDiagnostics(rcv.Diagnostics))\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn resp\n}\n\nfunc (p *GRPCProvisioner) Stop() error {\n\tprotoResp, err := p.client.Stop(p.ctx, &proto.Stop_Request{})\n\tif err != nil {\n\t\treturn err\n\t}\n\tif protoResp.Error != \"\" {\n\t\treturn errors.New(protoResp.Error)\n\t}\n\treturn nil\n}\n\nfunc (p *GRPCProvisioner) Close() error {\n\t// check this since it's not automatically inserted during plugin creation\n\tif p.PluginClient == nil {\n\t\tlogger.Debug(\"provisioner has no plugin.Client\")\n\t\treturn nil\n\t}\n\n\tp.PluginClient.Kill()\n\treturn nil\n}\n","sourceCodeStart":148,"sourceCodeEnd":181,"githubUrl":"https://github.com/hashicorp/terraform/blob/d32a084675427f5ac3f7d2868578ef8b2c1dc525/internal/plugin/grpc_provisioner.go#L148-L181","documentation":"Thrown by GRPCProvisioner.Stop() (plugin v5 provisioner) when the Stop RPC returned no transport error but set a non-empty `Error` string. Mirrors the provider Stop path: a provisioner reports it could not cleanly interrupt/stop its operation during shutdown, and the raw message is wrapped in errors.New.","triggerScenarios":"Interrupting an apply/destroy while a provisioner is mid-execution, and the provisioner's stop handler reports a failure.","commonSituations":"A long-running local-exec or remote-exec provisioner killed mid-flight. A custom provisioner whose stop handler is buggy.","solutions":["Let the provisioner's process finish or be cleaned up externally, then re-run.","Avoid interrupting provisioners mid-execution; design resources to be idempotent.","Migrate off provisioners to managed resources where possible."],"exampleFix":"# before\n$ terraform apply   # Ctrl-C during provisioner -> stop error\n\n# after\n# clean up the external process, then\n$ terraform apply","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"# Go caller: log provisioner stop errors as warnings\nif err := prov.Stop(); err != nil {\n    log.Printf(\"warn: provisioner stop: %v\", err)\n}","preventionTips":["Avoid interrupting provisioners mid-execution.","Make provisioned actions idempotent so re-runs are safe.","Migrate off provisioners to managed resources."],"tags":["terraform","provisioner","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"}