{"record":{"id":"889a80395bc98dc4","repo":"gitbutlerapp/gitbutler","slug":"executable-must-be-specified-for-non-built-ins","errorCode":null,"errorMessage":"executable must be specified for non built-ins","messagePattern":"executable must be specified for non built-ins","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-api/src/open/program.rs","lineNumber":745,"sourceCode":"                    .map(Into::into)\n                    .unwrap_or_else(|| builtin.executable.clone()),\n                category: self\n                    .category\n                    .map(Into::into)\n                    .unwrap_or_else(|| builtin.category.clone()),\n                cli_arg_supplier,\n                extensions,\n            })\n        } else {\n            let (name, id) = match (self.name, self.id) {\n                (Some(name), Some(id)) => (name, id),\n                (Some(name), None) => (name.clone(), name),\n                (None, Some(id)) => (id.clone(), id),\n                (None, None) => anyhow::bail!(\"id or name must be specified\"),\n            };\n\n            let Some(executable) = self.executable else {\n                anyhow::bail!(\"executable must be specified for non built-ins\")\n            };\n\n            Ok(ProgramSpec {\n                id,\n                name,\n                executable: executable.into(),\n                category: self.category.map(Into::into).unwrap_or_default(),\n                cli_arg_supplier: CliArgumentSupplier::Custom(CustomCliArgumentSupplier {\n                    open_args: self.open_args,\n                    open_at_line_args: self.open_at_line_args,\n                }),\n                extensions,\n            })\n        }\n    }\n}\n\n/// The executable to invoke for a program.","sourceCodeStart":727,"sourceCodeEnd":763,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but-api/src/open/program.rs#L727-L763","documentation":"For programs that are not one of the recognized built-ins, an `executable` path/command is mandatory — without it there is nothing to launch. Validation rejects the spec as soon as the name/id pairing succeeds but `executable` is None.","triggerScenarios":"Building a ProgramSpec where the program is not a built-in, `name`/`id` are provided, but `executable` is None.","commonSituations":"API payloads that only carry a display name for a custom editor, stale client caches referencing removed custom programs, or UI flows that defer executable selection.","solutions":["Set `executable` to the absolute path of the program binary","Verify the program is registered as a built-in if no executable should be needed","Update the client to always send executable for non built-in programs"],"exampleFix":"// before\nProgramSpecInput { name: Some(\"MyEditor\".into()), id: None, executable: None }\n// after\nProgramSpecInput { name: Some(\"MyEditor\".into()), id: None, executable: Some(\"/usr/local/bin/myeditor\".into()) }","handlingStrategy":"validation","validationCode":"if (!isBuiltin(program) && program.executable == null) throw new Error('executable must be specified for non built-ins');","typeGuard":"function hasExecutable(p: {executable?: string|null}): p is {executable: string} { return typeof p.executable === 'string' && p.executable.length > 0; }","tryCatchPattern":"try { await resolveProgram(program); } catch (e) { if (String(e).includes('executable must be specified')) { /* ask user to pick the binary */ } else { throw e; } }","preventionTips":["Require executable selection in the UI before submitting custom programs","Check the built-in list first to see if a spec needs no executable","Store absolute executable paths in app config"],"tags":["validation","missing-field","program-spec"],"backgroundTag":"missing-required-argument","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"}