{"record":{"id":"fd49b730ccf96b9b","repo":"projectdiscovery/nuclei","slug":"no-extracted-values-found-for-template-s","errorCode":null,"errorMessage":"no extracted values found for template: %s","messagePattern":"no extracted values found for template: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/runner/lazy.go","lineNumber":142,"sourceCode":"\t\t\t\t\t\tdata[k] = value\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// named extractors\n\t\t\tfor k, v := range e.OperatorsResult.Extracts {\n\t\t\t\tif len(v) > 0 {\n\t\t\t\t\tdata[k] = v[0]\n\t\t\t\t}\n\t\t\t}\n\t\t\t// log result of template in result file/screen\n\t\t\t_ = writer.WriteResult(e, opts.ExecOpts.Output, opts.ExecOpts.Progress, opts.ExecOpts.IssuesClient)\n\t\t}\n\t\t_, execErr := tmpl.Executer.ExecuteWithResults(ctx)\n\t\tif execErr != nil {\n\t\t\tfinalErr = execErr\n\t\t}\n\t\tif finalErr == nil && len(data) == 0 {\n\t\t\tfinalErr = fmt.Errorf(\"no extracted values found for template: %s\", d.TemplatePath)\n\t\t}\n\t\t// store extracted result in auth context\n\t\td.Extracted = data\n\t\tif finalErr != nil && opts.OnError != nil {\n\t\t\topts.OnError(finalErr)\n\t\t}\n\t\treturn finalErr\n\t}\n}\n","sourceCodeStart":124,"sourceCodeEnd":152,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/internal/runner/lazy.go#L124-L152","documentation":"After executing the dynamic-secret template, the callback (internal/runner/lazy.go:142) requires at least one extracted value to store in d.Extracted; execution succeeding with zero values is treated as failure. The template either defines no extractors or none of its extractors matched the target's responses — matcher-only detection templates will always fail here. The error names the template path for follow-up.","triggerScenarios":"Auth template without extractors; extractors present but not matching the actual responses; the target (d.Input) unreachable or returning different content than the template expects; matcher conditions preventing extractor evaluation.","commonSituations":"Reusing detection templates (matcher-only) as dynamic secret sources without adding extractors; target service responding differently than when the template was authored; expired credentials changing response content.","solutions":["Add named extractors to the template for every secret it must yield (tokens, cookies, session ids)","Test the template directly (`nuclei -t auth.yaml -u <target> -v`) and confirm values are extracted","Verify the input/target configured for the dynamic secret is reachable and returns the expected response","Ensure gating matchers actually match so extractors run"],"exampleFix":"# before\nhttp:\n  - method: GET\n    path: \"{{BaseURL}}/login\"\n    matchers:\n      - type: status\n        status: [200]\n\n# after\nhttp:\n  - method: GET\n    path: \"{{BaseURL}}/login\"\n    extractors:\n      - type: kval\n        name: session_token\n        kval:\n          - \"session_token\"\n    matchers:\n      - type: status\n        status: [200]","handlingStrategy":"validation","validationCode":"// before registering a dynamic secret, require extractors on the template\nparsed, err := templates.Parse(templateFile, nil, options)\nif err != nil { return err }\nhasExtractors := false\nfor _, p := range parsed.Protocols {\n    if len(p.GetOperators().Extractors) > 0 { hasExtractors = true }\n}\nif !hasExtractors {\n    return errors.New(\"dynamic secret template defines no extractors\")\n}","typeGuard":null,"tryCatchPattern":"if finalErr == nil && len(data) == 0 {\n    finalErr = fmt.Errorf(\"template %s extracted nothing; check extractors and target reachability\", d.TemplatePath)\n    opts.OnError(finalErr)\n}","preventionTips":["Only use templates with named extractors as dynamic secret sources","Test auth templates against a live target before wiring them into secrets","Keep an on-error hook so extraction failures surface in monitoring"],"tags":["go","nuclei","auth-secrets","extractors","templates"],"backgroundTag":null,"analyzedSha":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}