{"record":{"id":"5f0919250c9cd909","repo":"hashicorp/terraform","slug":"unsupported-action-trigger-type-t","errorCode":null,"errorMessage":"unsupported action trigger type: %T","messagePattern":"unsupported action trigger type: %T","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/command/jsonplan/action_invocations.go","lineNumber":150,"sourceCode":"\t\treturn ai, fmt.Errorf(\"failed to decode action %s: %w\", action.Addr, err)\n\t}\n\n\tswitch at := action.ActionTrigger.(type) {\n\tcase *plans.ResourceActionTrigger:\n\t\tai.LifecycleActionTrigger = &LifecycleActionTrigger{\n\t\t\tTriggeringResourceAddress: at.TriggeringResourceAddr.String(),\n\t\t\tActionTriggerEvent:        at.TriggerEvent().String(),\n\t\t\tActionTriggerBlockIndex:   at.ActionTriggerBlockIndex,\n\t\t\tActionsListIndex:          at.ActionsListIndex,\n\t\t\tOnFailure:                 at.ActionOnFailure.String(),\n\t\t}\n\tcase *plans.InvokeActionTrigger:\n\t\tai.InvokeActionTrigger = &InvokeActionTrigger{}\n\t\tif at.CallingResourceAddr != nil {\n\t\t\tai.InvokeActionTrigger.CallingResourceAddress = at.CallingResourceAddr.String()\n\t\t}\n\tdefault:\n\t\treturn ai, fmt.Errorf(\"unsupported action trigger type: %T\", at)\n\t}\n\n\tvar config []byte\n\tvar sensitive []byte\n\tvar unknown []byte\n\n\tif actionDec.ConfigValue != cty.NilVal {\n\t\tunmarkedValue, pvms := actionDec.ConfigValue.UnmarkDeepWithPaths()\n\t\tsensitivePaths, otherMarks := marks.PathsWithMark(pvms, marks.Sensitive)\n\t\tephemeralPaths, otherMarks := marks.PathsWithMark(otherMarks, marks.Ephemeral)\n\t\tif len(ephemeralPaths) > 0 {\n\t\t\treturn ai, fmt.Errorf(\"action %s has ephemeral config values, which are not supported in action invocations\", action.Addr)\n\t\t}\n\t\tif len(otherMarks) > 0 {\n\t\t\treturn ai, fmt.Errorf(\"action %s has config values with unsupported marks: %v\", action.Addr, otherMarks)\n\t\t}\n\n\t\tunknownValue := unknownAsBool(unmarkedValue)","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/hashicorp/terraform/blob/c9def3e214014c1188faabfc4a5bde5095139765/internal/command/jsonplan/action_invocations.go#L132-L168","documentation":"MarshalActionInvocation switches on action.ActionTrigger and only handles *plans.ResourceActionTrigger and *plans.InvokeActionTrigger (the only two implementations of the ActionTrigger interface). The default branch fires for any other concrete type, including a nil interface. This is an internal invariant violation rather than a configuration error.","triggerScenarios":"Triggered when ActionTrigger holds a value whose dynamic type is neither *ResourceActionTrigger nor *InvokeActionTrigger, or is nil. Only reachable if a third ActionTrigger implementation is introduced into the plans package without a matching case here, or via a custom/forked build.","commonSituations":"Development of a new action trigger feature in a fork where the renderer was not updated; mismatched internal packages where plans and jsonplan come from different builds; a nil trigger field due to an upstream construction bug.","solutions":["Report this as a Terraform-internal bug; it is not reachable through normal HCL configuration.","If you maintain a fork that added a trigger type, add a matching case in action_invocations.go:135.","Ensure all Terraform binaries involved come from one consistent build (no partial rebuild of internal packages)."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":"func supportedActionTrigger(t plans.ActionTrigger) bool {\n    switch t.(type) {\n    case *plans.ResourceActionTrigger, *plans.InvokeActionTrigger:\n        return true\n    }\n    return false\n}\n\n// use before marshaling\nfor _, a := range actions {\n    if !supportedActionTrigger(a.ActionTrigger) {\n        return fmt.Errorf(\"unsupported action trigger %T for %s\", a.ActionTrigger, a.Addr)\n    }\n}","tryCatchPattern":null,"preventionTips":["Treat this error as a bug report, not a runtime condition to catch.","If forking Terraform to add an ActionTrigger type, update the switch in action_invocations.go:135 in the same change.","Keep internal packages (plans, jsonplan) from a single consistent build."],"tags":["actions","internal","type-switch","invariant"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T21:17:07.882Z"}