{"record":{"id":"285765c5bce84179","repo":"projectdiscovery/nuclei","slug":"w-for-path-s","errorCode":null,"errorMessage":"%w for path: %s","messagePattern":"%w for path: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/runner/lazy.go","lineNumber":75,"sourceCode":"\topts.IncludeConditions = nil\n\tcfg := loader.NewConfig(opts, catalog, execOpts)\n\tcfg.StoreId = loader.AuthStoreId\n\tstore, err := loader.New(cfg)\n\tif err != nil {\n\t\treturn nil, errkit.Wrap(err, \"failed to initialize dynamic auth templates store\")\n\t}\n\treturn store, nil\n}\n\n// GetLazyAuthFetchCallback returns a lazy fetch callback for auth secrets\nfunc GetLazyAuthFetchCallback(opts *AuthLazyFetchOptions) authx.LazyFetchSecret {\n\treturn func(d *authx.Dynamic) error {\n\t\ttmpls, err := opts.TemplateStore.LoadTemplates([]string{d.TemplatePath})\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to load templates: %w\", err)\n\t\t}\n\t\tif len(tmpls) == 0 {\n\t\t\treturn fmt.Errorf(\"%w for path: %s\", disk.ErrNoTemplatesFound, d.TemplatePath)\n\t\t}\n\t\tif len(tmpls) > 1 {\n\t\t\treturn fmt.Errorf(\"multiple templates found for path: %s\", d.TemplatePath)\n\t\t}\n\t\tdata := map[string]interface{}{}\n\t\ttmpl := tmpls[0]\n\t\t// add args to tmpl here\n\t\tvars := map[string]interface{}{}\n\t\tmainCtx := context.Background()\n\t\tctx := scan.NewScanContext(mainCtx, contextargs.NewWithInput(mainCtx, d.Input))\n\n\t\tcliVars := map[string]interface{}{}\n\t\tif opts.ExecOpts.Options != nil {\n\t\t\t// gets variables passed from cli -v and -env-vars\n\t\t\tcliVars = generators.BuildPayloadFromOptions(opts.ExecOpts.Options)\n\t\t}\n\n\t\tfor _, v := range d.Variables {","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/internal/runner/lazy.go#L57-L93","documentation":"LoadTemplates returned zero templates for the dynamic secret's path (internal/runner/lazy.go:75); the shared disk.ErrNoTemplatesFound ('no templates found') is wrapped with the offending path. The path resolved but matched nothing loadable as a template: nonexistent file, non-template file, or content excluded by the loader. The error text names the exact path that came up empty.","triggerScenarios":"A dynamic-secrets entry with a stale or wrong TemplatePath; the template deleted/moved after the secrets config was written; the file existing but not recognized as a nuclei template.","commonSituations":"Renaming or relocating auth templates without updating the secrets config; environment-specific paths baked into shared configs; empty files left by failed git checkouts.","solutions":["Verify the exact path named in the error exists (`ls -l <TemplatePath>`)","Correct TemplatePath in the dynamic secrets configuration","Ensure the file is a real nuclei template (id, info, protocol sections)","Lint secrets configs in CI so paths cannot drift from the templates"],"exampleFix":"# before (secrets file)\n- id: session\n  dynamic:\n    template-path: auth/get-session-v1.yaml\n\n# after\n- id: session\n  dynamic:\n    template-path: auth/get-session-v2.yaml","handlingStrategy":"validation","validationCode":"if fi, err := os.Stat(d.TemplatePath); err != nil || fi.IsDir() {\n    return fmt.Errorf(\"dynamic secret path %s does not point at a template file\", d.TemplatePath)\n}","typeGuard":null,"tryCatchPattern":"if len(tmpls) == 0 {\n    return fmt.Errorf(\"no template at %s — check the path in the secrets config\", d.TemplatePath)\n}","preventionTips":["Update secrets configs whenever auth templates move or are renamed","Add a CI lint that every template-path in secrets configs exists","Verify files are genuine nuclei templates, not placeholders"],"tags":["go","nuclei","auth-secrets","templates","path-resolution"],"backgroundTag":null,"analyzedSha":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}