{"record":{"id":"bcbfe6ca606df77d","repo":"argoproj/argo-workflows","slug":"failed-to-evaluate-expression-s-is-missing","errorCode":null,"errorMessage":"failed to evaluate expression: %s is missing","messagePattern":"failed to evaluate expression: (.+?) is missing","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"util/template/expression_template.go","lineNumber":92,"sourceCode":"\nfunc expressionReplaceStrict(ctx context.Context, w io.Writer, expression string, env map[string]any, strictRegex *regexp.Regexp) (int, error) {\n\t// The template is JSON-marshaled. This JSON-unmarshals the expression to undo any character escapes.\n\tvar unmarshalledExpression string\n\terr := json.Unmarshal(fmt.Appendf(nil, `\"%s\"`, expression), &unmarshalledExpression)\n\tif err != nil {\n\t\t// If we can't unmarshal, we can't parse. Fallback to expressionReplaceCore to handle it (likely error).\n\t\treturn expressionReplaceCore(ctx, w, expression, env, false)\n\t}\n\n\tmissingIdentifiers, err := missingVarsInEnv(unmarshalledExpression, env)\n\tif err != nil {\n\t\t// If we can't parse, we can't check variables. Fallback to expressionReplaceCore(false) to report syntax error.\n\t\treturn expressionReplaceCore(ctx, w, expression, env, false)\n\t}\n\n\tfor _, id := range missingIdentifiers {\n\t\tif strictRegex != nil && strictRegex.MatchString(id) {\n\t\t\treturn 0, fmt.Errorf(\"failed to evaluate expression: %s is missing\", id)\n\t\t}\n\t}\n\n\t// If we have missing identifiers but they are NOT strict, we allow unresolved.\n\t// If we have NO missing identifiers, we enforce resolution (to catch runtime errors),\n\t// unless the caller allows unresolved (strictRegex == nil), in which case runtime\n\t// failures are tolerated and the expression is left unresolved for later evaluation.\n\tallowUnresolved := len(missingIdentifiers) > 0 || strictRegex == nil\n\treturn expressionReplaceCore(ctx, w, expression, env, allowUnresolved)\n}\n\ntype identifierVisitor struct {\n\tidentifiers []string\n\tseen        map[string]bool\n\tguarded     map[ast.Node]bool\n}\n\nfunc (v *identifierVisitor) Visit(node *ast.Node) {","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/util/template/expression_template.go#L74-L110","documentation":"expressionReplaceStrict determined that the expression references variables missing from env; the message (built from missingVars) names the missing identifier(s). This is the strict-mode rejection: unlike allowUnresolved paths, the unresolved variable is a terminal error here.","triggerScenarios":"Thrown at util/template/expression_template.go:92 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Supply the missing variable (e.g. define the parameter or ensure the referenced node output exists)","Check spelling of identifiers inside the {{= ... }} expression"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"35bff19146f5a6ada77468c431f2624bd577e373","analyzedAt":"2026-09-03T19:34:35.908Z","contentChangedAt":"2026-09-03T19:34:35.908Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}