{"record":{"id":"b4c29950cc5fa0ec","repo":"zeroclaw-labs/zeroclaw","slug":"no-log-files-found-in-is-the-service-installed","errorCode":null,"errorMessage":"No log files found in {}. Is the service installed?","messagePattern":"No log files found in (.+?)\\. Is the service installed\\?","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"warning","filePath":"crates/zeroclaw-runtime/src/service/mod.rs","lineNumber":975,"sourceCode":"        var_dir.join(\"logs\")\n    } else {\n        config\n            .config_path\n            .parent()\n            .map_or_else(|| PathBuf::from(\".\"), PathBuf::from)\n            .join(\"logs\")\n    };\n\n    let stderr_log = logs_dir.join(\"daemon.stderr.log\");\n    let stdout_log = logs_dir.join(\"daemon.stdout.log\");\n\n    // Prefer stderr log (most informative), fall back to stdout\n    let log_file = if stderr_log.exists() {\n        stderr_log\n    } else if stdout_log.exists() {\n        stdout_log\n    } else {\n        bail!(\n            \"No log files found in {}. Is the service installed?\",\n            logs_dir.display()\n        );\n    };\n\n    if follow {\n        let status = Command::new(\"tail\")\n            .args([\"-n\", &lines.to_string(), \"-f\"])\n            .arg(&log_file)\n            .status()\n            .context(\"Failed to run tail\")?;\n        if !status.success() {\n            bail!(\"tail exited with non-zero status\");\n        }\n    } else {\n        let status = Command::new(\"tail\")\n            .args([\"-n\", &lines.to_string()])\n            .arg(&log_file)","sourceCodeStart":957,"sourceCodeEnd":993,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-runtime/src/service/mod.rs#L957-L993","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Run 'zeroclaw service status' to confirm the install state","Install and start the service ('zeroclaw service install && zeroclaw service start'), then retry logs","Inspect the plist's StandardOutPath/StandardErrorPath values and check that directory directly"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// check the derived log dir before calling service::logs on macOS\nlet logs_dir = daemon_log_dir(); // same derivation the runtime uses (exe-relative var/log)\nlet has_logs = logs_dir.join(\"stderr.log\").exists() || logs_dir.join(\"stdout.log\").exists();\nif !has_logs {\n    // install/start the service first instead of letting logs() bail\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always start the service at least once before asking for logs","Check 'zeroclaw service status' before 'service logs' in scripts","Keep the Homebrew var/log prefix intact so the derived log dir matches"],"tags":["macos","logs","service","file-not-found"],"backgroundTag":"log-file-not-found","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}