{"record":{"id":"612d9d5948f9571c","repo":"projectdiscovery/nuclei","slug":"errors-occurred-during-template-validation","errorCode":null,"errorMessage":"errors occurred during template validation","messagePattern":"errors occurred during template validation","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/catalog/loader/loader.go","lineNumber":644,"sourceCode":"\n\tworkflowPaths, errs := store.config.Catalog.GetTemplatesPath(store.finalWorkflows)\n\tstore.logErroredTemplates(errs)\n\n\ttemplatePathsMap := make(map[string]struct{}, len(templatePaths))\n\tfor _, path := range templatePaths {\n\t\ttemplatePathsMap[path] = struct{}{}\n\t}\n\n\tworkflowPathsMap := make(map[string]struct{}, len(workflowPaths))\n\tfor _, path := range workflowPaths {\n\t\tworkflowPathsMap[path] = struct{}{}\n\t}\n\n\tif store.areTemplatesValid(templatePathsMap) && store.areWorkflowsValid(workflowPathsMap) {\n\t\treturn nil\n\t}\n\n\treturn errors.New(\"errors occurred during template validation\")\n}\n\nfunc (store *Store) areWorkflowsValid(filteredWorkflowPaths map[string]struct{}) bool {\n\treturn store.areWorkflowOrTemplatesValid(filteredWorkflowPaths, true, func(templatePath string, tagFilter *templates.TagFilter) (bool, error) {\n\t\treturn store.config.ExecutorOptions.Parser.LoadWorkflow(templatePath, store.config.Catalog)\n\t})\n}\n\nfunc (store *Store) areTemplatesValid(filteredTemplatePaths map[string]struct{}) bool {\n\treturn store.areWorkflowOrTemplatesValid(filteredTemplatePaths, false, func(templatePath string, tagFilter *templates.TagFilter) (bool, error) {\n\t\treturn store.config.ExecutorOptions.Parser.LoadTemplate(templatePath, store.tagFilter, nil, store.config.Catalog)\n\t})\n}\n\nfunc (store *Store) areWorkflowOrTemplatesValid(filteredTemplatePaths map[string]struct{}, isWorkflow bool, load func(templatePath string, tagFilter *templates.TagFilter) (bool, error)) bool {\n\tareTemplatesValid := true\n\n\tfor templatePath := range filteredTemplatePaths {","sourceCodeStart":626,"sourceCodeEnd":662,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/pkg/catalog/loader/loader.go#L626-L662","documentation":"Error \"errors occurred during template validation\" thrown in projectdiscovery/nuclei.","triggerScenarios":"Thrown at pkg/catalog/loader/loader.go:644 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}