gitbutlerapp/gitbutler · error

Platform {} not found in release

Error message

Platform {} not found in release

What it means

Thrown in crates/but-installer/src/lib.rs when release.platforms (a map keyed by platform string) has no entry for config.platform. This fails earlier than the per-OS URL errors: the release metadata does not describe this platform at all, so no PlatformInfo exists to pass to download_and_install_app.

Source

Thrown at crates/but-installer/src/lib.rs:150

            Some(Channel::Nightly)
        }
        VersionRequest::Specific(version) => {
            info(&format!("Installing version: {version}"));
            None
        }
        VersionRequest::Release => {
            info(&format!(
                "Installing latest release version: {}",
                release.version
            ));
            Some(Channel::Release)
        }
    };

    let platform_info = release
        .platforms
        .get(&config.platform)
        .ok_or_else(|| anyhow::anyhow!("Platform {} not found in release", config.platform))?;

    download_and_install_app(&config, platform_info, &release, channel)?;

    if interactive {
        info("Checking shell configuration");
        configure_shell(&config.home_dir)?;
    }

    ui::println_empty();
    success(&format!(
        "✓ GitButler CLI installation completed! ({}{})",
        channel
            .map(|c| format!("{} ", c.display_name()))
            .unwrap_or_default(),
        release.version
    ));
    ui::println_empty();

View on GitHub (pinned to caf1f223d3)

Solutions

  1. Log the keys of release.platforms to see which platforms the release actually ships, then align config.platform with one of them.
  2. Install the latest release, which publishes the widest set of platform keys.
  3. Remove any platform override so auto-detection picks the canonical key.
  4. If your platform is genuinely absent from every recent release, file a support request — it is a publishing gap, not a client bug.

Example fix

// before
let platform_info = release
    .platforms
    .get(&config.platform)
    .ok_or_else(|| anyhow::anyhow!("Platform {} not found in release", config.platform))?;

// after: fail with the actionable list of supported platforms
let platform_info = release.platforms.get(&config.platform).ok_or_else(|| {
    let available = release.platforms.keys().cloned().collect::<Vec<_>>().join(", ");
    anyhow::anyhow!(
        "Platform {} not found in release {} (available: {available})",
        config.platform,
        release.version
    )
})?;
Defensive patterns

Strategy: validation

Validate before calling

// Before resolving platform_info
if !release.platforms.contains_key(&config.platform) {
    let available: Vec<_> = release.platforms.keys().cloned().collect();
    eprintln!("platform {} not in release; available: {:?}", config.platform, available);
    return Ok(());
}

Type guard

fn release_supports_platform(release: &Release, platform: &str) -> bool {
    release.platforms.contains_key(platform)
}

Try / catch

let platform_info = match release.platforms.get(&config.platform) {
    Some(info) => info,
    None => {
        // log available keys, re-fetch latest release, or bail with context
        anyhow::bail!("platform {} unsupported; available: {:?}", config.platform, release.platforms.keys().collect::<Vec<_>>())
    }
};

Prevention

When it happens

Trigger: config.platform (auto-detected or user-set platform string) not matching any key in the fetched release's platforms map; installing a release that predates support for the platform (e.g. an ARM/variant key added later); nightly metadata temporarily omitting a platform.

Common situations: Running on uncommon hardware/OS variants whose platform key the release does not list; forcing a platform override the API does not know; very old pinned releases that only shipped macos/windows keys.

Understand the failure class

Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.

Related errors


AI-assisted analysis of gitbutlerapp/gitbutler@caf1f223d3 (2026-08-20). Data as JSON: /api/errors/5240a445344d4140. Report an issue: GitHub.