{"record":{"id":"76b6bde845066daa","repo":"gohugoio/hugo","slug":"readandprocesscontent-w","errorCode":null,"errorMessage":"readAndProcessContent: %w","messagePattern":"readAndProcessContent: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"hugolib/hugo_sites_build.go","lineNumber":1278,"sourceCode":"\t}\n\n\treturn nil\n}\n\nfunc (h *HugoSites) LogServerAddresses() {\n\tif h.hugoInfo.IsMultihost() {\n\t\tfor _, s := range h.Sites {\n\t\t\th.Log.Printf(\"Web Server is available at %s (bind address %s) %s\\n\", s.conf.C.BaseURL, s.conf.C.ServerInterface, s.Language().Lang)\n\t\t}\n\t} else {\n\t\ts := h.Sites[0]\n\t\th.Log.Printf(\"Web Server is available at %s (bind address %s)\\n\", s.conf.C.BaseURL, s.conf.C.ServerInterface)\n\t}\n}\n\nfunc (h *HugoSites) processFull(ctx context.Context, l logg.LevelLogger, config *BuildCfg) (err error) {\n\tif err = h.processFiles(ctx, l, config); err != nil {\n\t\terr = fmt.Errorf(\"readAndProcessContent: %w\", err)\n\t\treturn\n\t}\n\treturn err\n}\n\nfunc (s *Site) handleContentAdapterChanges(bi pagesfromdata.BuildInfo, buildConfig *BuildCfg) {\n\tif !s.h.isRebuild() {\n\t\treturn\n\t}\n\n\tif len(bi.ChangedIdentities) > 0 {\n\t\tbuildConfig.WhatChanged.Add(bi.ChangedIdentities...)\n\t\tbuildConfig.WhatChanged.needsPagesAssembly = true\n\t}\n\n\tfor _, p := range bi.DeletedPaths {\n\t\tpp := paths.AddLeadingSlash(path.Join(bi.Path.Base(), p.Path))\n\t\tdf := func(n contentNode) bool {","sourceCodeStart":1260,"sourceCodeEnd":1296,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/hugolib/hugo_sites_build.go#L1260-L1296","documentation":"Outer wrapper from HugoSites.processFull (hugo_sites_build.go:1278) around whatever processFiles returns. processFiles is the stage that reads and processes all content/source files (markdown, page bundles, resources) into the page trees. The %w is the concrete read/parse error; this label just names the stage so the cause is traceable.","triggerScenarios":"Any failure inside the file ingestion/content-processing pipeline: a content file that fails to parse, a file-system read error, a page-bundle resource that cannot be loaded, a fatal error from a content adapter (data-driven pages), or an error from processContentAdaptersOnRebuild during watch rebuilds.","commonSituations":"Malformed front matter or broken shortcodes in a content file; a content file deleted/moved between two watch ticks; a remote/adapter content source returning an error; permission issues reading files under content/.","solutions":["Inspect the wrapped %w — it carries the file path and the parse/read cause.","Open the named content file and fix the syntax (front matter delimiters, shortcode balance).","If on watch, verify the file still exists at the reported path (race with an editor save).","For content adapters, check the data source/script output that feeds them."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// validate content files parse before full build (library use)\n// hugo already reports file/line in the wrapped error; pre-check front matter with a YAML/TOML linter","typeGuard":null,"tryCatchPattern":"if err := sites.Build(cfg); err != nil {\n    if strings.HasPrefix(err.Error(), \"readAndProcessContent:\") {\n        cause := errors.Unwrap(err) // the file/parse-level detail\n        _ = cause\n    }\n}","preventionTips":["Lint front matter and shortcode balance in content files.","On watch, ignore transient errors mid-save and re-trigger the rebuild."],"tags":["build","content-processing","file-io","parse"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}