{"record":{"id":"3e11da83e3090486","repo":"gohugoio/hugo","slug":"assemble-w","errorCode":null,"errorMessage":"assemble: %w","messagePattern":"assemble: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"hugolib/hugo_sites_build.go","lineNumber":178,"sourceCode":"\t\t\t\t} else {\n\t\t\t\t\tif err := h.initSites(); err != nil {\n\t\t\t\t\t\treturn fmt.Errorf(\"initSites: %w\", err)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\tctx := context.Background()\n\n\t\t\tif err := h.process(ctx, infol, conf, init, events...); err != nil {\n\t\t\t\treturn fmt.Errorf(\"process: %w\", err)\n\t\t\t}\n\t\t\th.reportProgress(func() (state terminal.ProgressState, progress float64) {\n\t\t\t\treturn terminal.ProgressNormal, 0.15\n\t\t\t})\n\t\t\tif err := h.assemble(ctx, infol, conf); err != nil {\n\t\t\t\treturn fmt.Errorf(\"assemble: %w\", err)\n\t\t\t}\n\t\t\th.reportProgress(func() (state terminal.ProgressState, progress float64) {\n\t\t\t\treturn terminal.ProgressNormal, 0.20\n\t\t\t})\n\n\t\t\treturn nil\n\t\t}\n\n\t\tif prepareErr = prepare(); prepareErr != nil {\n\t\t\th.SendError(prepareErr)\n\t\t}\n\t}\n\n\tfor s := range h.allSites(nil) {\n\t\ts.state = siteStateReady\n\t}\n\n\tif prepareErr == nil {","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/hugolib/hugo_sites_build.go#L160-L196","documentation":"Wraps a failure of the assemble() step — where processed pages are assembled into the page trees, relations resolved, and taxonomies built. The %w is the assembly-phase error.","triggerScenarios":"Raised at hugo_sites_build.go:178 when h.assemble(ctx, infol, conf) errors during page-tree assembly — duplicate paths, relation resolution failures, or rendering-dependent state errors.","commonSituations":"Two pages resolving to the same output path (duplicate permalinks/URLs); circular or broken page references; a permalink pattern that produces invalid paths; multilingual alignment issues.","solutions":["Unwrap %w — often names the conflicting page path or relation.","Resolve duplicate output paths by renaming pages or adjusting permalink config.","Check translations point to valid counterpart pages.","Simplify to a minimal content set and re-add to isolate the conflict."],"exampleFix":"# before: two pages share a path\ncontent/a/index.md   -> /a/\ncontent/a.md         -> /a/   # collision\n\n# after: keep one canonical source\nrm content/a.md","handlingStrategy":"validation","validationCode":"// Detect duplicate output paths before building by simulating permalink resolution.\nseen := map[string]string{}\nfor _, p := range pages {\n    out := permalinkFor(p)\n    if prev, dup := seen[out]; dup { return fmt.Errorf(\"path clash %s vs %s\", prev, p.File) }\n    seen[out] = p.File\n}","typeGuard":null,"tryCatchPattern":"if err := h.assemble(ctx, l, conf); err != nil {\n    // assemble errors usually cite a clashing path; log and surface for fixing\n    h.Log.Errorf(\"assemble: %v\", err)\n    return err\n}","preventionTips":["Enforce unique page paths/slugs via naming conventions.","Review [permalinks] patterns to avoid collisions across sections.","Validate translations map to existing pages."],"tags":["build","assembly","pages","paths","hugo"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}