{"record":{"id":"0d705d76e3509e9c","repo":"getzola/zola","slug":"can-t-watch-entry-for-changes-in-folder","errorCode":null,"errorMessage":"Can't watch `{entry}` for changes in folder `{}`. Does it exist, and do you have correct permissions?","messagePattern":"Can't watch `(.+?)` for changes in folder `(.+?)`\\. Does it exist, and do you have correct permissions\\?","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmd/serve.rs","lineNumber":615,"sourceCode":"    // watchers will contain the paths we're actually watching\n    let mut watchers = Vec::new();\n    for (entry, watch_mode, recursive_mode) in watch_this {\n        let watch_path = root_dir.join(entry);\n        let should_watch = match watch_mode {\n            WatchMode::Required => true,\n            WatchMode::Optional => watch_path.exists(),\n            WatchMode::Condition(b) => b && watch_path.exists(),\n        };\n        if should_watch {\n            debouncer\n                .watch(root_dir.join(entry), recursive_mode)\n                .map_err(|e| {\n                    match e.kind {\n                        ErrorKind::MaxFilesWatch => {\n                            // https://github.com/getzola/zola/issues/1803\n                            anyhow!(\"Can't watch `{entry}`: OS file watch limit reached. Check how to raise it for your OS.\")\n                        }\n                        _ => anyhow!(\"Can't watch `{entry}` for changes in folder `{}`. Does it exist, and do you have correct permissions?\", root_dir.display())\n                    }\n                })?;\n            watchers.push(entry.to_string());\n        }\n    }\n\n    let output_path = site.output_path.clone();\n    create_directory(&output_path)?;\n\n    // static_root needs to be canonicalized because we do the same for the http server.\n    let static_root = std::fs::canonicalize(&output_path).unwrap();\n\n    // Create broadcast channel for WebSocket live reload\n    let (reload_tx, _) = broadcast::channel::<String>(100);\n    let broadcaster = reload_tx.clone();\n\n    // Start Axum server in a separate thread\n    thread::spawn(move || {","sourceCodeStart":597,"sourceCodeEnd":633,"githubUrl":"https://github.com/getzola/zola/blob/61d30828217957120309db657950224edf9707e2/src/cmd/serve.rs#L597-L633","documentation":"When the watcher fails to watch an entry for any reason other than the max-files limit (path missing, permission denied, generic notify error), serve converts it into this error naming the entry and the root folder. It asks whether the directory exists and permissions are correct.","triggerScenarios":"zola serve with a watched path (root dir, themes/, config, static/, content/, etc., including user-added watch paths) that does not exist, was deleted mid-run, or is not readable due to file permissions.","commonSituations":"Running zola serve in a directory missing expected subfolders (e.g. no themes dir with a theme configured); symlinked or network-mounted directories that notify cannot watch; restrictive permissions after copying a project; watch path configured in config pointing outside the project.","solutions":["Verify the named directory exists relative to the project root and create it if missing (e.g. mkdir themes static content)","Check and fix filesystem permissions (chmod/chown) so the user running zola can read the directory","If the path is a broken symlink or network mount, repair or remove it","Confirm config.toml does not reference extra watch/output directories that don't exist"],"exampleFix":"// before\n$ zola serve  # project lacks themes/ referenced by config\n// Can't watch `themes` for changes ...\n// after\n$ mkdir themes  # or install the theme into themes/<name>\n$ zola serve","handlingStrategy":"validation","validationCode":"// Verify required directories exist and are readable before serving:\n// for d in content static themes sass templates; do\n//   [ -d \"$d\" ] && [ -r \"$d\" ] || echo \"missing/unreadable: $d\"\n// done","typeGuard":null,"tryCatchPattern":"// shell\nzola serve 2>&1 | tee /tmp/zola-serve.log || {\n  grep -q \"Can't watch\" /tmp/zola-serve.log && echo \"Fix watched path per error message\"\n}","preventionTips":["Initialize projects with `zola init` so all expected directories exist","Repair broken symlinks and avoid watching network mounts","Keep project directories owned/readable by the user running zola"],"tags":["rust","filesystem","watcher","permissions"],"backgroundTag":"watch-path-not-found","analyzedSha":"61d30828217957120309db657950224edf9707e2","analyzedAt":"2026-09-03T14:39:09.727Z","contentChangedAt":"2026-09-03T14:39:09.727Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}