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

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

Error message

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

What it means

For OpenRC installs, logs_linux expects logs under the OpenRC log dir (defaulting to /var/log/<service>/) with error.log preferred and access.log as fallback. If neither file exists it bails, assuming the OpenRC service was never installed or has not run yet.

Source

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

        InitSystem::Systemd => {
            let args = linux_journalctl_args(config, lines, follow);
            let status = Command::new("journalctl")
                .args(&args)
                .status()
                .context("Failed to run journalctl")?;
            if !status.success() {
                bail!("journalctl exited with non-zero status");
            }
        }
        InitSystem::Openrc => {
            // OpenRC logs go to /var/log/<service>/error.log (as configured in the init script).
            let log_dir = linux_openrc_log_dir(config);
            let log_file = log_dir.join("error.log");
            if !log_file.exists() {
                // Fall back to access log
                let access_log = log_dir.join("access.log");
                if !access_log.exists() {
                    bail!(
                        "No log files found at {}. Is the service installed?",
                        log_dir.display()
                    );
                }
                return tail_file(&access_log, lines, follow);
            }
            tail_file(&log_file, lines, follow)?;
        }
        InitSystem::Auto => unreachable!("Auto should be resolved before this point"),
    }
    Ok(())
}

fn logs_windows(config: &Config, lines: usize, follow: bool) -> Result<()> {
    let logs_dir = config
        .config_path
        .parent()
        .map_or_else(|| PathBuf::from("."), PathBuf::from)

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Install and start the service: zeroclaw service install --service-init openrc && zeroclaw service start
  2. Verify state with rc-service <name> status and check the log dir directly
  3. Confirm the init script's daemon logging paths match linux_openrc_log_dir's derivation
Defensive patterns

Strategy: validation

Validate before calling

let log_dir = openrc_log_dir(); // /var/log/<service> per the init script
if !log_dir.join("error.log").exists() && !log_dir.join("access.log").exists() {
    // service never ran: start it before requesting logs
}

Prevention

When it happens

Trigger: 'zeroclaw service logs --service-init openrc' before the daemon wrote any logs: service not installed, installed but not started, or the init script writing to a different log dir.

Common situations: Gentu/Alpine-style hosts where logs runs before the first start; custom init script with a relocated log dir; permissions preventing log creation under /var/log.

Related errors


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