gitbutlerapp/gitbutler · error

Command {command} not found!

Error message

Command {command} not found!

What it means

but-server's command dispatcher (a large match on the incoming command string) fell through to the default arm, meaning the request named a command the server build does not implement. The server is versioned independently of clients (desktop, Electron/N-API, CLI, SDK), so this is almost always a client/server version skew or a typo in the command name.

Source

Thrown at crates/but-server/src/lib.rs:1237

        // Zip/Archive commands (need extra)
        "get_project_archive_path" => {
            #[derive(Deserialize)]
            #[serde(rename_all = "camelCase")]
            struct GetProjectArchivePathParams {
                pub project_id: ProjectHandleOrLegacyProjectId,
            }
            let params = serde_json::from_value::<GetProjectArchivePathParams>(request.params)?;
            extra
                .archival
                .zip_entire_repository(params.project_id)
                .map(to_json_or_panic)
        }
        "get_logs_archive_path" => {
            let result = extra.archival.zip_logs();
            result.map(|r| json!(r))
        }
        _ => Err(anyhow::anyhow!("Command {command} not found!")),
    }
}

fn to_json_or_panic(value: impl serde::Serialize) -> serde_json::Value {
    serde_json::to_value(value).unwrap()
}

fn deserialize_json<T: serde::de::DeserializeOwned>(value: serde_json::Value) -> anyhow::Result<T> {
    Ok(serde_json::from_value(value)?)
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn localhost_origin_accepts_valid() {
        // Basic schemes

View on GitHub (pinned to caf1f223d3)

Solutions

  1. Check the exact command string sent by the client for typos/casing against the match arms in crates/but-server/src/lib.rs
  2. Verify client and server are the same release (restart the app/server so both run the current build)
  3. If you control the caller, confirm the command exists in your server version's dispatcher before sending

Example fix

// before
let resp = client.request("get_logs_archive_path", json!({})).send();
// after — verify the command is supported by this server build first
const KNOWN = await client.listCommands(); // or check server version
if (!KNOWN.includes("get_logs_archive_path")) {
  throw new Error(`server ${client.serverVersion} lacks command 'get_logs_archive_path' — update server`);
}
Defensive patterns

Strategy: validation

Validate before calling

// before sending, confirm the command exists in this server build
const supported = await client.invoke("list_commands"); // or pin client/server versions
if (!supported.includes(commandName)) {
  throw new Error(`Command ${commandName} not supported by server — upgrade server or fix name`);
}

Try / catch

catch (e) { if (/Command .* not found/.test(e.message)) { /* version skew: report upgrade needed */ } throw e; }

Prevention

When it happens

Trigger: Sending a JSON request whose `command` string is not one of the matched arms (e.g. 'get_projct_archive_path' misspelled), or a newer client calling a command (e.g. 'get_logs_archive_path') against an older but-server binary that predates it.

Common situations: Mixed-version setups: an updated app front end talking to a stale background server process; copying command names from newer docs or changelogs into scripts targeting an older release; leftover server process still running after an upgrade.

Related errors


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