Skip to content

Error Handling Reference

Recovery, by where it went wrong. One rule runs through all of it: nothing is retried. A failure settles; fix the cause and run up again, which plans over what was left against current state — it never replays the failed plan.

A plan that cannot be made ends the convergence failed (or error) before anything is applied: rounds[].diagnostics and rounds[].error say why, naming a file and line where there is one. A plan that was made but went stale before its apply — a file it parsed, an auto-loaded .tfvars or the lock file changed between up and apply, or no longer loads — ends it stale instead, with rounds[].stale_reason: run up again and review the new plan. Never edit between the two.

  1. Report the error to the user verbatim.
  2. Don’t apply around it — nothing from a plan that errored is applied, and what depends on the broken part could not resolve anyway.
  3. Fix the cause — the configuration (load skill_authoring first), a missing var, a provider’s credentials — and run up again. There is no -target: to go ahead with the independent resources while one stays broken, the configuration has to stop declaring it. Ask before editing their files that way.

Common ones:

Error What to do
“Inconsistent dependency lock file” A provider was added, or a constraint no longer admits the locked version: run init, with upgrade: true only to move a locked version (tell the user: it changes what the lock pins). Never delete or hand-edit the lock file. If instead a package no longer matches the checksums the lock records, stop and tell the user: that can be a tampered package, and neither init nor upgrade is the fix until they have looked.
“… this engine milestone does not walk …” A construct Turf refuses: references/divergences.md has the remedy. Tell the user; don’t strip it out without their say-so.
“Resource instance cannot be destroyed”; “… has a prevent_destroy argument but its value will not be known until the apply step” prevent_destroy doing its job: the plan wanted to destroy that instance (a delete, a replace, or the destroy). Tell the user what and why; never disable the flag or remove its block without their say-so. The second form is a flag the plan could not read — a value known only after apply, or a module instance the configuration no longer declares (skill_authoring → references/lifecycle.md).
“… references …, which this configuration does not declare”, “Unsupported attribute” A typo, or a module output the module does not declare: read the module’s output blocks.
A required variable has no value Pass it as var, or ask the user.
“lineage … is bound to backend … and this open arrives from a different backend” The backend moved: references/workspaces.md (reconfigure).

A round’s apply makes each change once. When one fails, the round finishes everything independent of it and the convergence ends failed: rounds[].failures name each failed change in the provider’s words, and rounds[].actions any action that failed or halted.

  1. Report the error, and tell the user what succeeded: what did not depend on the failure was applied, and state reflects every change applied so far.
  2. You don’t hand-avoid dependents: what depends on a failed change was not started (rounds[].skipped).
  3. Fix the cause — a provider-side error, a wrong value, a missing permission, a quota — and run up again. A create that failed partway left an object standing: it is tainted, and planned for replacement, as in Terraform.
  4. The workspace stays open throughout.

Turf actions that failed show in rounds[].actions with their error (detail): a halt stopped what waited on it, a taint (on after_create) marked the new object for replacement, a continue only warned. Fix what the action found and run up again.

A validation decided only at apply fails after the round applied: the round reads applied, and the convergence ends failed naming the rule. Fix the value and run up again.

A create_before_destroy replace creates the new object first, deposing the old one, and destroys the deposed object once the create lands.

  • The create fails and wrote nothing: the deposed object is put back as current in the same round. Nothing is owed; fix the cause and run up again, and the replace is planned afresh.
  • The create left a partial object: that object is current now, tainted, and the old one stays deposed. The next up plans destroying the deposed object (a delete carrying its deposed key) and replacing the tainted one.
  • The delete of the deposed object fails: it stays in state (state_list shows it), and the next up plans its destroy.
  • A before_create gate fails: the create never ran, so nothing was deposed and the old object is still current. Differs from Terraform: Terraform deposes first and leaves nothing current.

Either way you drive nothing by hand: read rounds[].failures, fix the cause, up, and review the plan. Deposed and tainted objects are not refreshed before the plan acts on them.

Situation What to do
“the local Turf engine is still starting” This server started it for your call, and it did not answer within 90 s. It goes on starting: call again in a moment. turf-mcp-server engine status shows how far it is.
“the local Turf engine is not running, and …”; “the local Turf engine did not start” This server starts the local engine when a call needs it, and the message says why it did not: TURF_ENGINE_AUTOSTART=off (the user starts it: brew services start turf, or turf-mcp-server engine run in a terminal — ask before running either yourself); a container (TURF_DEPLOYMENT=container), which needs an engine named by TURF_RESTATE_URL; restate-server or turf-engine not found, with where it looked and what to install or set; or a start that failed, with the end of <TURF_HOME>/engine/supervisor.log. Tell the user. Once it is fixed, call again: nothing needs reconnecting. init, the provider tools and the skills work without it.
“the local Turf engine is waiting for Turf’s license terms to be accepted” The engine is up but starts nothing until the user accepts the license terms; it was started in a way that does not see this server’s acceptance (the Homebrew service or a terminal, which never see a variable in a shell or in the MCP client’s configuration). Ask the user to read https://turf.build/license/v1/ and confirm they accept; only then run turf license accept (turf-mcp-server license accept without the turf CLI). The message names the other ways for the engine at hand (the service’s turf.env, or turf-mcp-server engine stop for one a server started). It starts within seconds of the marker; call again then. Never accept for the user.
“Turf’s license terms have not been accepted, so this did not run” This server’s own terms are not accepted: every call answers so, and no engine is started, until they are. Same remedy: the user reads the terms and confirms, then turf license accept, or turf-mcp-server license accept without the turf CLI (through npx: npx -y @turfbuild/turf-mcp-server license accept; no restart needed either way), or TURF_ACCEPT_EULA=yes in this server’s environment.
A provider finds no credentials, no such profile, or no such command (“No valid credential sources found”, “failed to get shared config profile”, “executable file not found in $PATH”) Providers run in the engine, and of this session’s environment get only the variables this server’s provider environment names. Call status: provider_env lists the names a start would send and the declared ones unset here, and no such key means none is declared. The first fix is the user’s, in the MCP client’s entry for this server: the variable and TURF_PROVIDER_ENV naming it in its env block, then a client restart and up again. A command is never found this way (PATH is not sent). Otherwise a credentials file, a provider argument, the configuration’s mise.local.toml, or the Homebrew service with its turf.env: references/credentials.md, Providers.
“a Turf engine X is running for this user, and this server is Y” The engine and this server come from different lines (minor releases); the message says which to restart. An older engine (the binaries were upgraded, the engine kept running): the user restarts it, as the message says — turf-mcp-server engine stop for one a server started (the next call starts the new one), brew services restart turf for the service, or stop and start turf-mcp-server engine run. A convergence waiting in it is cancelled by the upgrade, what was applied is kept: afterwards apply on it answers cancelled, and up plans again. A newer engine (it restarted on the upgrade): this server is the old one, so the user starts the client again — in Claude Code, reconnect turf with /mcp.
“… is being followed by another call; wait for it to return” Another call is following that convergence — usually one of yours still running: wait for it; don’t retry in a loop, and never batch dependent calls. With none of yours in flight, another client is following it: tell the user, and ask before you cancel.
A takeover waits, then is refused Another client renews the convergence’s lease, or held it past two minutes: that client is following it.
An apply call ended early (cancelled, client dropped) The convergence goes on in the engine: apply with the same arguments follows it again.
A provider call hangs It cannot be interrupted: cancel takes effect once the call returns, and nothing new starts. A helm_release waiting on pods is the usual case (references/credentials.md).

“the state is already locked by another tofu client”: check for a convergence holding the workspace first (open reports it) — take it up or cancel it, never force-unlock it. Otherwise ask the user before force_unlock. The full procedure, lock_id included: references/workspaces.md.

Turf™ is a trademark of Turf LLC. Terraform® is a trademark of HashiCorp. Ansible® is a trademark of Red Hat, LLC, registered in the United States and other countries. Helm®, Kubernetes®, Prometheus® and OpenTelemetry® are registered trademarks, and Jaeger™ is a trademark, of the Linux Foundation. OpenTofu® and Model Context Protocol® are registered trademarks of LF Projects, LLC. All other trademarks are the property of their respective owners. Turf is not affiliated with, endorsed by, or sponsored by HashiCorp, IBM, Red Hat, the Linux Foundation, LF Projects or the OpenTofu project.

© 2026 Turf LLC. Free for individuals, education and small businesses within the Community limits, under the Turf Community Edition License 1.0. Government and larger organizations need a commerciallicense.turf.build · Discord ·GitHub