hashicorp/terraform · error

no schema found for %s (in provider %s)

Error message

no schema found for %s (in provider %s)

What it means

Returned by jsonplan.MarshalActionInvocation when schemas.ActionTypeConfig(provider, type).ConfigSchema is nil — i.e. the loaded schema set has no entry for the action type within its provider (action_invocations.go:122-128). The %s placeholders are the action type and provider address. Without a config schema the action invocation cannot be marshalled, so the error propagates.

Source

Thrown at internal/command/jsonplan/action_invocations.go:127

		}
		ret = append(ret, ai)
	}
	return ret, nil
}

func MarshalActionInvocation(action *plans.ActionInvocationInstanceSrc, schemas *terraform.Schemas) (ActionInvocation, error) {
	ai := ActionInvocation{
		Address:      action.Addr.String(),
		Type:         action.Addr.Action.Action.Type,
		Name:         action.Addr.Action.Action.Name,
		ProviderName: action.ProviderAddr.Provider.String(),
	}
	schema := schemas.ActionTypeConfig(
		action.ProviderAddr.Provider,
		action.Addr.Action.Action.Type,
	)
	if schema.ConfigSchema == nil {
		return ai, fmt.Errorf("no schema found for %s (in provider %s)", action.Addr.Action.Action.Type, action.ProviderAddr.Provider)
	}

	actionDec, err := action.Decode(&schema)
	if err != nil {
		return ai, fmt.Errorf("failed to decode action %s: %w", action.Addr, err)
	}

	switch at := action.ActionTrigger.(type) {
	case *plans.ResourceActionTrigger:
		ai.LifecycleActionTrigger = &LifecycleActionTrigger{
			TriggeringResourceAddress: at.TriggeringResourceAddr.String(),
			ActionTriggerEvent:        at.TriggerEvent().String(),
			ActionTriggerBlockIndex:   at.ActionTriggerBlockIndex,
			ActionsListIndex:          at.ActionsListIndex,
			OnFailure:                 at.ActionOnFailure.String(),
		}
	case *plans.InvokeActionTrigger:
		ai.InvokeActionTrigger = &InvokeActionTrigger{}

View on GitHub (pinned to c9def3e214)

Solutions

  1. Run `terraform init` to load the provider schemas that define the action type before show -json.
  2. Update or pin required_providers to a version that includes the action type.
  3. Regenerate the plan after installing the correct provider (avoid rendering plans made with a different provider set).
  4. Remove the action from configuration if the action type is no longer supported.

Example fix

# before
$ terraform show -json tfplan   # action provider schema not loaded
# after
$ terraform init
$ terraform show -json tfplan
Defensive patterns

Strategy: validation

Validate before calling

// Confirm every action type has a config schema before marshalling.
for _, a := range actions {
    if schemas.ActionTypeConfig(a.ProviderAddr.Provider, a.Addr.Action.Action.Type).ConfigSchema == nil {
        return fmt.Errorf("no schema for action %s in %s; run terraform init",
            a.Addr.Action.Action.Type, a.ProviderAddr.Provider)
    }
}

Prevention

When it happens

Trigger: Producing JSON plan output for a plan containing an action invocation whose action type is not present in the installed provider's schema: provider not installed, wrong/old provider version, action type renamed/removed, or the schema cache is stale relative to the plan.

Common situations: Forgetting `terraform init` so provider action schemas are not loaded before `terraform show -json`; a plan referencing an action type dropped in a provider upgrade; lock file pinning a provider version without that action; provider fork that lacks the action.

Related errors


AI-assisted analysis of hashicorp/terraform@c9def3e214 (2026-08-07). Data as JSON: /api/errors/57823e8ef965d523. Report an issue: GitHub.