{"record":{"id":"32dbb48e15ef4880","repo":"gohugoio/hugo","slug":"walk-stat-s","errorCode":null,"errorMessage":"walk: stat: %s","messagePattern":"walk: stat: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"hugofs/walk.go","lineNumber":139,"sourceCode":"\n\treturn false\n}\n\n// walk recursively descends path, calling walkFn.\nfunc (w *Walkway) walk(ctx context.Context, path string, info FileMetaInfo, dirEntries []FileMetaInfo) error {\n\tpathRel := strings.TrimPrefix(path, w.cfg.Root)\n\n\tif info == nil {\n\t\tvar err error\n\t\tfi, err := w.cfg.Fs.Stat(path)\n\t\tif err != nil {\n\t\t\tif path == w.cfg.Root && herrors.IsNotExist(err) {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tif w.checkErr(path, err) {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"walk: stat: %s\", err)\n\t\t}\n\t\tinfo = fi.(FileMetaInfo)\n\t}\n\n\terr := w.cfg.WalkFn(ctx, path, info)\n\tif err != nil {\n\t\tif info.IsDir() && err == filepath.SkipDir {\n\t\t\treturn nil\n\t\t}\n\t\treturn err\n\t}\n\n\tif !info.IsDir() {\n\t\treturn nil\n\t}\n\n\tif dirEntries == nil {\n\t\tf, err := w.cfg.Fs.Open(path)","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/hugofs/walk.go#L121-L157","documentation":"Emitted by Walkway.walk (hugofs/walk.go) when fs.Stat on a walked path fails and the failure is neither the root-not-exist case nor suppressed by checkErr (FailOnNotExist=false). It formats the raw stat error as 'walk: stat: %s'. This is the generic non-Exist stat failure during recursive directory descent.","triggerScenarios":"Walkway.Walk descends into a path whose Stat returns a non-IsNotExist error (e.g. EACCES permission denied, EIO), OR returns IsNotExist while WalkwayConfig.FailOnNotExist is true. Triggered by any Hugo code path that walks a mounted filesystem (content, layouts, assets, archetypes).","commonSituations":"Content/asset mount points to a directory with restrictive permissions; a file is deleted between the directory listing and the per-entry Stat; a symlink with a broken target on a filesystem that reports it as a stat error rather than not-exist; FailOnNotExist=true set explicitly while the path genuinely is absent.","solutions":["Check the permissions/ownership of the path named in the error and its parents.","If the path is legitimately optional, do not set WalkwayConfig.FailOnNotExist=true (default tolerates absence).","Resolve broken symlinks in the mount or exclude them from the walk root.","Re-run after stabilizing the source tree (stop concurrent file generators that delete mid-walk)."],"exampleFix":"// before\ncfg := hugofs.WalkwayConfig{ Fs: fs, Root: root, FailOnNotExist: true, WalkFn: fn }\n// after\ncfg := hugofs.WalkwayConfig{ Fs: fs, Root: root, FailOnNotExist: false, WalkFn: fn }","handlingStrategy":"validation","validationCode":"info, err := walkFs.Stat(root)\nif err != nil {\n    if herrors.IsNotExist(err) && !cfg.FailOnNotExist { /* ok, will return nil */ }\n    else { /* will become 'walk: stat: %s' — fix permissions/path first */ }\n}","typeGuard":null,"tryCatchPattern":"err := walkway.Walk()\nif err != nil && strings.Contains(err.Error(), \"walk: stat:\") {\n    // re-stat the offending path to classify (perm vs gone) before retry\n}","preventionTips":["Leave FailOnNotExist=false unless the path is mandatory.","Ensure the process user can stat every node under the walk root.","Resolve broken symlinks before building."],"tags":["filesystem","hugofs","walk","stat"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}