xai-org/grok-build · critical

Auto-update failed: {:#} {}

Error message

Auto-update failed: {:#}

{}

What it means

run_install_script performs the actual auto-update install and records telemetry about the attempt; on failure it wraps the underlying error chain with `{:#}` (all anyhow sources) plus a reinstall_hint containing manual reinstall instructions for the current installer and channel. This is the top-level wrapper, so the root cause is in the nested error text, and the appended hint gives the manual fallback.

Source

Thrown at crates/codegen/xai-grok-update/src/auto_update.rs:976

    };
    let to_version = match &result {
        Ok(Some(installed)) => Some(installed.clone()),
        _ => target.map(str::to_string),
    };
    xai_grok_telemetry::session_ctx::log_event(CliUpdate {
        outcome,
        trigger,
        from_version,
        to_version,
        channel: CliUpdateChannel::from_channel_str(&update_config.channel),
        installer: CliUpdateInstaller::from_installer_str(installer),
        platform: platform_label(),
        rosetta: running_under_rosetta_on_apple_silicon(),
        duration_ms,
        error_kind,
    });
    result.map(|_| ()).map_err(|e| {
        anyhow::anyhow!(
            "Auto-update failed: {:#}\n\n{}",
            e,
            reinstall_hint(installer, &update_config.channel)
        )
    })
}

/// Detect the platform (os, arch) to download binaries for.
///
/// Arch is the compile-time arch with one correction: an x86_64 build on an
/// Apple Silicon host (Rosetta) selects `aarch64`, so every update path —
/// interactive `grok update`, background `--auto` children, the leader's
/// hourly converge, and forced minimum-version installs — converges to the
/// native build instead of perpetuating the translated one. This mirrors
/// install.sh's `hw.optional.arm64` probe; without it, a lingering x86_64
/// process would reinstall x86_64 right over a fresh native install.
pub(crate) fn detect_platform() -> Result<(&'static str, &'static str)> {
    let os = if cfg!(target_os = "macos") {

View on GitHub (pinned to bc7f02eddd)

Solutions

  1. Read the `{:#}` portion of the message for the root-cause error chain first
  2. Follow the reinstall_hint's manual reinstall commands to recover immediately
  3. Check write permissions on the install directory or reinstall with elevated/instructions-based install
  4. Retry after checking network/proxy issues if the root cause was download-related

Example fix

// before
result.map(|_| ()).map_err(|e| {
    anyhow::anyhow!("Auto-update failed: {:#}\n\n{}", e, reinstall_hint(installer, &update_config.channel))
})
// after
result.map(|_| ()).map_err(|e| {
    eprintln!("auto-update failed: {:#}; falling back to manual reinstall", e);
    anyhow::anyhow!("Auto-update failed: {:#}\n\n{}", e, reinstall_hint(installer, &update_config.channel))
})
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-check install dir writability and artifact reachability
let dir = install_dir();
if !is_writable(&dir) { eprintln!("install dir not writable: {}", dir.display()); }
// HEAD the artifact URL before running the update

Try / catch

match ensure_latest_on_disk(&cfg).await {
    Err(e) => {
        eprintln!("{e:#}"); // walk the full source chain for the root cause
        eprintln!("falling back to manual reinstall per hint");
        run_manual_reinstall()?;
    }
    Ok(()) => {}
}

Prevention

When it happens

Trigger: Calling run_update or ensure_latest_on_disk when the install script fails — download integrity failure, script execution error, permission problem writing the install location, or unsupported platform/installer combination.

Common situations: No write permission to the install directory (e.g. system-managed locations); a partially downloaded or corrupted artifact failing checksum; proxy/firewall blocking the artifact download; Rosetta/Apple Silicon edge cases selecting the wrong installer.

Related errors


AI-assisted analysis of xai-org/grok-build@bc7f02eddd (2026-08-31). Data as JSON: /api/errors/e98a77bd7bfb4ab3. Report an issue: GitHub.