hashicorp/terraform · error

${resp.Error}

Error message

${resp.Error}

What it means

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.

Source

Thrown at internal/plugin/grpc_provider.go:535

	protoResp, err := p.client.Configure(p.ctx, protoReq)
	if err != nil {
		resp.Diagnostics = resp.Diagnostics.Append(grpcErr(err))
		return resp
	}
	resp.Diagnostics = resp.Diagnostics.Append(convert.ProtoToDiagnostics(protoResp.Diagnostics))
	return resp
}

func (p *GRPCProvider) Stop() error {
	logger.Trace("GRPCProvider: Stop")

	resp, err := p.client.Stop(p.ctx, new(proto.Stop_Request))
	if err != nil {
		return err
	}

	if resp.Error != "" {
		return errors.New(resp.Error)
	}
	return nil
}

func (p *GRPCProvider) ReadResource(r providers.ReadResourceRequest) (resp providers.ReadResourceResponse) {
	logger.Trace("GRPCProvider: ReadResource")

	schema := p.GetProviderSchema()
	if schema.Diagnostics.HasErrors() {
		resp.Diagnostics = schema.Diagnostics
		return resp
	}

	resSchema, ok := schema.ResourceTypes[r.TypeName]
	if !ok {
		resp.Diagnostics = resp.Diagnostics.Append(fmt.Errorf("unknown resource type %s", r.TypeName))
		return resp
	}

View on GitHub (pinned to d32a084675)

Solutions

  1. Retry the operation; transient stop failures often succeed on a clean re-run after the prior process exits.
  2. Manually clean up any external process the provider reported it could not stop.
  3. Upgrade the provider — known stop-handling bugs are fixed over time.
  4. Capture the provider's reported message; it is passed through as-is and usually names the affected resource.

Example fix

# before
$ terraform destroy   # interrupted -> provider stop error

# after
# let prior process exit, then re-run
$ terraform destroy
Defensive patterns

Strategy: retry

Try / catch

# Go (terraform plugin client caller): treat Stop error as best-effort
if err := provider.Stop(); err != nil {
    log.Printf("warn: provider stop reported: %v", err) // non-fatal
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of hashicorp/terraform@d32a084675 (2026-08-11). Data as JSON: /api/errors/03e22eb3b040400b. Report an issue: GitHub.