{"record":{"id":"70cdf1aa17769cbf","repo":"gitbutlerapp/gitbutler","slug":"command-command-not-found","errorCode":null,"errorMessage":"Command {command} not found!","messagePattern":"Command (.+?) not found!","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-server/src/lib.rs","lineNumber":1232,"sourceCode":"\n        // Zip/Archive commands (need extra)\n        \"get_project_archive_path\" => {\n            #[derive(Deserialize)]\n            #[serde(rename_all = \"camelCase\")]\n            struct GetProjectArchivePathParams {\n                pub project_id: ProjectHandleOrLegacyProjectId,\n            }\n            let params = serde_json::from_value::<GetProjectArchivePathParams>(request.params)?;\n            extra\n                .archival\n                .zip_entire_repository(params.project_id)\n                .map(to_json_or_panic)\n        }\n        \"get_logs_archive_path\" => {\n            let result = extra.archival.zip_logs();\n            result.map(|r| json!(r))\n        }\n        _ => Err(anyhow::anyhow!(\"Command {command} not found!\")),\n    }\n}\n\nfn to_json_or_panic(value: impl serde::Serialize) -> serde_json::Value {\n    serde_json::to_value(value).unwrap()\n}\n\nfn deserialize_json<T: serde::de::DeserializeOwned>(value: serde_json::Value) -> anyhow::Result<T> {\n    Ok(serde_json::from_value(value)?)\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    #[test]\n    fn localhost_origin_accepts_valid() {\n        // Basic schemes","sourceCodeStart":1214,"sourceCodeEnd":1250,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but-server/src/lib.rs#L1214-L1250","documentation":"The command dispatcher `handle_command` in but-server falls through its match on the command name and returns this error for any command it does not recognize. It means the client invoked a command string that has no handler arm in the server's dispatch table.","triggerScenarios":"POSTing to `handle_command` (via post_handle_command_with_path) with a command name that is not one of the handled strings, e.g. a typo like 'get_log_archive_path' or a command from a newer/older client than the server.","commonSituations":"Client/server version mismatch where the app calls a command the server build doesn't implement; typos in custom automation scripts calling the server API; renamed commands after an upgrade.","solutions":["Check the exact command name against the match arms in crates/but-server/src/lib.rs handle_command","Update client and server to matching versions so the command exists on both sides","Add the missing match arm in handle_command if you are extending the server","Fix typos in the calling script or SDK call"],"exampleFix":"// before\nawait server.command(\"get_log_archive_path\"); // typo\n// after\nawait server.command(\"get_logs_archive_path\");","handlingStrategy":"validation","validationCode":"const KNOWN_COMMANDS = new Set(['get_logs_archive_path', /* ... */]);\nif (!KNOWN_COMMANDS.has(command)) throw new Error(`unknown command: ${command}`);","typeGuard":"function isKnownCommand(c: string): c is KnownCommand {\n  return KNOWN_COMMANDS.has(c);\n}","tryCatchPattern":"try {\n  return await server.command(command);\n} catch (e) {\n  if (String(e).includes('not found!')) {\n    console.error(`Command \"${command}\" unavailable in this server build`);\n    return fallbackFor(command);\n  }\n  throw e;\n}","preventionTips":["Generate the client command list from the server's match arms","Pin client and server versions together","Handle unknown-command errors gracefully in automation scripts"],"tags":["command","dispatch","api","not-found"],"backgroundTag":"command-not-found","analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}