zeroclaw-labs/zeroclaw · warning · anyhow::Error

No log files found in {}. Is the service installed?

Error message

No log files found in {}. Is the service installed?

What it means

logs_macos resolves the daemon log directory (derived from the running executable's layout, e.g. the Homebrew var/log prefix) and expects the launchd StandardErrorPath/StandardOutPath files to exist. If neither the stderr nor the stdout log file is present, it assumes the service was never installed or never started and bails.

Source

Thrown at crates/zeroclaw-runtime/src/service/mod.rs:975

        var_dir.join("logs")
    } else {
        config
            .config_path
            .parent()
            .map_or_else(|| PathBuf::from("."), PathBuf::from)
            .join("logs")
    };

    let stderr_log = logs_dir.join("daemon.stderr.log");
    let stdout_log = logs_dir.join("daemon.stdout.log");

    // Prefer stderr log (most informative), fall back to stdout
    let log_file = if stderr_log.exists() {
        stderr_log
    } else if stdout_log.exists() {
        stdout_log
    } else {
        bail!(
            "No log files found in {}. Is the service installed?",
            logs_dir.display()
        );
    };

    if follow {
        let status = Command::new("tail")
            .args(["-n", &lines.to_string(), "-f"])
            .arg(&log_file)
            .status()
            .context("Failed to run tail")?;
        if !status.success() {
            bail!("tail exited with non-zero status");
        }
    } else {
        let status = Command::new("tail")
            .args(["-n", &lines.to_string()])
            .arg(&log_file)

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Run 'zeroclaw service status' to confirm the install state
  2. Install and start the service ('zeroclaw service install && zeroclaw service start'), then retry logs
  3. Inspect the plist's StandardOutPath/StandardErrorPath values and check that directory directly
Defensive patterns

Strategy: validation

Validate before calling

// check the derived log dir before calling service::logs on macOS
let logs_dir = daemon_log_dir(); // same derivation the runtime uses (exe-relative var/log)
let has_logs = logs_dir.join("stderr.log").exists() || logs_dir.join("stdout.log").exists();
if !has_logs {
    // install/start the service first instead of letting logs() bail
}

Prevention

When it happens

Trigger: Running 'zeroclaw service logs' on macOS before the daemon has written anything: service not installed, installed but never started, or the log directory was cleaned.

Common situations: Fresh machine where logs runs before the first start; 'brew cleanup' removing var/log contents; custom install prefix whose log dir differs from the derived one.

Related errors


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/b4c29950cc5fa0ec. Report an issue: GitHub.