FyroxEngine/Fyrox · error

Unable to create resource watcher. Reason

Error message

Unable to create resource watcher. Reason {e:?}

What it means

In fyrox-impl's Executor::run, the engine optionally creates a FileSystemWatcher for the current directory to enable hot resource reloading. If watcher creation fails (notify API error, unsupported platform, permission issue), this error is logged and the engine continues running without hot reloading — resources won't auto-reload on file changes.

Solutions

  1. Raise Linux inotify limits: sysctl fs.inotify.max_user_watches=524288 and max_user_instances
  2. Check you have read permission on the working directory being watched
  3. Continue without hot reload if the feature isn't needed (engine already does this — verify resource_manager watcher is None is acceptable)
  4. Run outside containers/mounts that block file watching, or mount with inotify support
Defensive patterns

Strategy: fallback

Validate before calling

match FileSystemWatcher::new(".", Duration::from_secs(1)) {
    Ok(w) => engine.resource_manager.state().set_watcher(Some(w)),
    Err(e) => Log::warn(format!("hot reload disabled: {e:?}")),
}

Try / catch

if let Err(e) = FileSystemWatcher::new(".", Duration::from_secs(1)) {
    Log::warn(format!("watcher unavailable, continuing without hot reload: {e:?}"));
}

Prevention

When it happens

Trigger: FileSystemWatcher::new(".", Duration::from_secs(1)) returns Err — e.g. inotify watch limits exhausted on Linux, no permission to watch the directory, or the notify backend unavailable on the target platform.

Common situations: Running in containers with restricted inotify (Docker default limits), sysctl fs.inotify.max_user_watches/max_user_instances exhausted on Linux, running from a read-only or network mount, unsupported embedded/WASM targets.

Related errors


AI-assisted analysis of FyroxEngine/Fyrox@76c91aad8e (2026-09-10). Data as JSON: /api/errors/cd5a4bdcbd531640. Report an issue: GitHub.

Appendix: source

Thrown at fyrox-impl/src/engine/executor.rs:230

        Log::info("Initializing resource registry.");
        self.engine.resource_manager.update_or_load_registry();

        let engine = self.engine;
        let event_loop = self.event_loop;
        let throttle_threshold = self.throttle_threshold;
        let throttle_frame_interval = self.throttle_frame_interval;

        if self.resource_hot_reloading {
            #[cfg(any(target_os = "windows", target_os = "linux", target_os = "macos"))]
            {
                use crate::core::watcher::FileSystemWatcher;
                use std::time::Duration;
                match FileSystemWatcher::new(".", Duration::from_secs(1)) {
                    Ok(watcher) => {
                        engine.resource_manager.state().set_watcher(Some(watcher));
                    }
                    Err(e) => {
                        Log::err(format!("Unable to create resource watcher. Reason {e:?}"));
                    }
                }
            }
        }

        let args = Args::try_parse().unwrap_or_default();

        match event_loop {
            Some(event_loop) => run_normal(
                engine,
                args.override_scene.as_deref(),
                event_loop,
                throttle_threshold,
                throttle_frame_interval,
                self.desired_update_rate,
            ),
            None => run_headless(
                engine,

View on GitHub (pinned to 76c91aad8e)