{"record":{"id":"124d37cecfc91820","repo":"kataras/iris","slug":"walk-stat-s-w","errorCode":null,"errorMessage":"walk stat: %s: %w","messagePattern":"walk stat: (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"view/fs.go","lineNumber":33,"sourceCode":"\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfileSystem = sub\n\t}\n\n\tif root == \"\" {\n\t\troot = \".\"\n\t}\n\n\treturn fs.WalkDir(fileSystem, root, func(path string, d fs.DirEntry, err error) error {\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"walk: %s: %w\", path, err)\n\t\t}\n\n\t\tinfo, err := d.Info()\n\t\tif err != nil {\n\t\t\tif err != filepath.SkipDir {\n\t\t\t\treturn fmt.Errorf(\"walk stat: %s: %w\", path, err)\n\t\t\t}\n\n\t\t\treturn nil\n\t\t}\n\n\t\tif info.IsDir() {\n\t\t\treturn nil\n\t\t}\n\n\t\twalkFnErr := walkFn(path, info, err)\n\t\tif walkFnErr != nil {\n\t\t\treturn fmt.Errorf(\"walk: walkFn: %w\", walkFnErr)\n\t\t}\n\n\t\treturn nil\n\t})\n\n}","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/kataras/iris/blob/7bedaf55a0b64bbb2248a5845a2c60d81a30996a/view/fs.go#L15-L51","documentation":"During the same fs.WalkDir traversal, the walker calls d.Info() to stat each entry. If Info fails for a reason other than filepath.SkipDir (which is intentionally tolerated), the error is wrapped as 'walk stat: <path>: <err>' so the caller knows statting — not walking — failed on that specific path.","triggerScenarios":"fs.DirEntry.Info() returns an error mid-walk, typically when a file is deleted or a symlink target vanishes between directory read and stat, or on permission-restricted entries in some custom FS implementations.","commonSituations":"Racing template hot-reload while files are being replaced/removed; broken symlinks inside the views folder; virtual/embedded FS implementations that can't resolve an entry.","solutions":["Re-run the load after the file churn settles (or disable hot reload during deploys).","Remove or fix broken symlinks in the views tree.","Grant read permissions on all entries under the root.","If the inner error is genuinely transient, retry; otherwise fix the FS contents as reported by the path."],"exampleFix":"// before (views contains broken symlink)\nln -s /nonexistent views/missing.html\n// after\nrm views/missing.html","handlingStrategy":"retry","validationCode":"entries, err := os.ReadDir(root)\nif err != nil { return err }\nfor _, e := range entries {\n    if e.Type()&fs.ModeSymlink != 0 { // broken symlink guard\n        if _, err := os.Stat(filepath.Join(root, e.Name())); err != nil {\n            return fmt.Errorf(\"broken entry %s: %w\", e.Name(), err)\n        }\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := loadViews(); err != nil {\n    if strings.Contains(err.Error(), \"walk stat:\") {\n        time.Sleep(200 * time.Millisecond) // transient during deploys\n        return loadViews()\n    }\n    return err\n}","preventionTips":["Don't delete/replace template files while the app loads views; use atomic renames.","Remove broken symlinks from the views tree.","Run deploys so template updates happen before the app (re)starts."],"tags":["filesystem","view","stat"],"backgroundTag":"path-not-found","analyzedSha":"7bedaf55a0b64bbb2248a5845a2c60d81a30996a","analyzedAt":"2026-08-30T20:38:16.250Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}