{"record":{"id":"efe12a2caf662cf9","repo":"gohugoio/hugo","slug":"walk-open-path-q-filename-q-s","errorCode":null,"errorMessage":"walk: open: path: %q filename: %q: %s","messagePattern":"walk: open: path: %q filename: %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"hugofs/walk.go","lineNumber":162,"sourceCode":"\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)\n\t\tif err != nil {\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: open: path: %q filename: %q: %s\", path, info.Meta().Filename, err)\n\t\t}\n\t\tfis, newCtx, err := ReadDirWithContext(ctx, f, -1)\n\t\tctx = newCtx\n\n\t\tf.Close()\n\t\tif err != nil {\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: Readdir: %w\", err)\n\t\t}\n\n\t\tdirEntries = DirEntriesToFileMetaInfos(fis)\n\t\tfor _, fi := range dirEntries {\n\t\t\tif fi.Meta().PathInfo == nil {\n\t\t\t\tfi.Meta().PathInfo = w.cfg.PathParser.Parse(\"\", filepath.Join(pathRel, fi.Name()))\n\t\t\t}\n\t\t}","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/hugofs/walk.go#L144-L180","documentation":"Emitted by Walkway.walk when fs.Open on a directory it is about to descend into fails, after checkErr declines to swallow it. The message includes both the logical path and the resolved Meta().Filename so the caller can tell which mount/overlay file refused to open. Format: 'walk: open: path: %q filename: %q: %s'.","triggerScenarios":"During a recursive walk, a directory entry identified by Stat cannot be Opened — e.g. it was removed between Stat and Open, permission denied on Open despite readable Stat, or an overlay/mount layer that Stats but cannot Open a synthetic directory. FailOnNotExist=true turns a vanished dir into this error instead of a skip.","commonSituations":"Build server running under a different user than the content checkout (Stat ok, Open denied); a content mount backed by an afero overlay whose source dir was swapped; editor/IDE renaming a directory mid `hugo server` watch rebuild.","solutions":["Compare the logical path vs filename in the message to find which mount layer refused Open.","Ensure the process user has open/execute permission on every directory in the walked tree.","Leave FailOnNotExist at its false default so transiently-absent dirs are skipped and logged rather than fatal.","Pause file generators (sync, rsync, IDE indexers) that rename/remove directories during the build."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"for _, d := range requiredDirs {\n    f, err := fs.Open(d)\n    if err != nil { /* preflight: fix perms/availability before Walk */ }\n    f.Close()\n}","typeGuard":null,"tryCatchPattern":"if err := walkway.Walk(); err != nil {\n    if strings.Contains(err.Error(), \"walk: open:\") {\n        // parse the path/filename fields, verify perms, then optionally retry once\n    }\n}","preventionTips":["Preflight-open every directory in the walk root before building.","Run the build as a user with traverse+open rights on all content mount dirs.","Avoid concurrent directory renames during `hugo server`."],"tags":["filesystem","hugofs","walk","open","permissions"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}