{"record":{"id":"c36146ad54895517","repo":"gohugoio/hugo","slug":"printpathwarnings-w","errorCode":null,"errorMessage":"printPathWarnings: %w","messagePattern":"printPathWarnings: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"hugolib/hugo_sites_build.go","lineNumber":209,"sourceCode":"\n\tfor s := range h.allSites(nil) {\n\t\ts.state = siteStateReady\n\t}\n\n\tif prepareErr == nil {\n\t\tif err := h.render(infol, conf); err != nil {\n\t\t\th.SendError(fmt.Errorf(\"render: %w\", err))\n\t\t}\n\n\t\t// Make sure to write any build stats to disk first so it's available\n\t\t// to the post processors.\n\t\tif err := h.writeBuildStats(); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// We need to do this before render deferred.\n\t\tif err := h.printPathWarningsOnce(); err != nil {\n\t\t\th.SendError(fmt.Errorf(\"printPathWarnings: %w\", err))\n\t\t}\n\n\t\tif err := h.renderDeferred(infol); err != nil {\n\t\t\th.SendError(fmt.Errorf(\"renderDeferred: %w\", err))\n\t\t}\n\n\t\t// This needs to be done after the deferred rendering to get complete template usage coverage.\n\t\tif err := h.printUnusedTemplatesOnce(); err != nil {\n\t\t\th.SendError(fmt.Errorf(\"printPathWarnings: %w\", err))\n\t\t}\n\n\t\tif err := h.postProcess(infol); err != nil {\n\t\t\th.SendError(fmt.Errorf(\"postProcess: %w\", err))\n\t\t}\n\t}\n\n\tif h.Metrics != nil {\n\t\tvar b bytes.Buffer","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/hugolib/hugo_sites_build.go#L191-L227","documentation":"Sent via SendError when printPathWarningsOnce() fails — the step that prints warnings about duplicate/overlapping output paths. The %w is the underlying error from the path-warning check.","triggerScenarios":"Raised at hugo_sites_build.go:209 when h.printPathWarningsOnce() errors while detecting and reporting path collisions in the rendered output.","commonSituations":"Multiple pages/sections resolving to the same publish path causing the warning routine itself to fail; filesystem stat failures on the publish dir while computing overlaps; large sites where the path-map walk encounters an internal error.","solutions":["Unwrap %w to see which path/stat operation failed.","Resolve duplicate output paths (same advice as assemble collision errors).","Ensure the publish directory is accessible for stat checks.","If non-blocking, run with path warnings disabled in config to confirm it's the source."],"exampleFix":"// before: two outputs to /foo/index.html\n[permalinks]\nposts = \"/foo/:slug\"\npages = \"/foo/:slug\"\n\n// after: distinct paths\n[permalinks]\nposts = \"/posts/:slug\"\npages = \"/pages/:slug\"","handlingStrategy":"validation","validationCode":"// Resolve all output paths and assert uniqueness up front.\nif dups := duplicatePaths(pages); len(dups) > 0 { return fmt.Errorf(\"path overlaps: %v\", dups) }","typeGuard":null,"tryCatchPattern":"if err := h.printPathWarningsOnce(); err != nil {\n    // path-warning failures are non-fatal diagnostics; log and continue\n    h.Log.Warnf(\"printPathWarnings: %v\", err)\n}","preventionTips":["Design permalink rules that can't collide across sections.","Run path-collision checks in CI before publishing.","Treat path warnings as build-blocking signals to fix early."],"tags":["build","paths","warnings","rendering","hugo"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}