{"record":{"id":"de79eadb865dd558","repo":"Hmbown/CodeWhale","slug":"127","errorCode":"127","errorMessage":"lane log proxy requires a command","messagePattern":"lane log proxy requires a command","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/lane/src/runtime.rs","lineNumber":451,"sourceCode":"/// hidden CLI should propagate to tmux.\npub fn run_lane_log_proxy(spec: LaneLogProxySpec) -> Result<i32> {\n    let LaneLogProxySpec {\n        command,\n        log_path,\n        receipt_path,\n        receipt_tmp_path,\n        environment_path,\n        lane_id,\n    } = spec;\n\n    let fail = |error: anyhow::Error, exit_code: i32| -> Result<i32> {\n        append_proxy_failure(&log_path, &lane_id, &error)?;\n        write_lane_exit_receipt(&receipt_path, &receipt_tmp_path, &lane_id, exit_code)?;\n        Ok(exit_code)\n    };\n\n    if command.is_empty() {\n        return fail(anyhow::anyhow!(\"lane log proxy requires a command\"), 127);\n    }\n\n    let environment = if let Some(path) = environment_path.as_deref() {\n        let loaded = read_lane_environment(path);\n        let removed = remove_file_if_present(path);\n        match (loaded, removed) {\n            (Ok(environment), Ok(())) => environment,\n            (Err(error), Ok(())) => return fail(error, LANE_PROXY_FAILURE_EXIT_CODE),\n            (Ok(_), Err(error)) | (Err(_), Err(error)) => return Err(error),\n        }\n    } else {\n        Vec::new()\n    };\n\n    let mut child_command = Command::new(&command[0]);\n    child_command.args(&command[1..]);\n    child_command.envs(environment);\n    child_command.stdout(Stdio::piped()).stderr(Stdio::piped());","sourceCodeStart":433,"sourceCodeEnd":469,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/lane/src/runtime.rs#L433-L469","documentation":"run_lane_log_proxy in crates/lane/src/runtime.rs validates its command argument before doing any work; an empty command string cannot be spawned, so the proxy fails immediately with exit code 127 (the shell's 'command not found' code), appends the failure to the lane log, and writes the exit receipt. This turns a bad invocation into a clean, logged failure instead of a spawn panic.","triggerScenarios":"Calling run_lane_log_proxy with command == \"\" — e.g. the lane configuration's command field is unset/empty, an environment substitution produced an empty string, or a caller passed a blank command programmatically.","commonSituations":"Lane config file has command = \"\" or a missing command key resolved to empty; a template variable (like $BIN) was unbound at spawn time; CI passes an optional command that is empty in that job.","solutions":["Set a non-empty command in the lane configuration (or pass one to run_lane_log_proxy).","Check for unexpanded variables in the command (e.g. $MY_BIN was empty in the environment) and export the variable or hardcode the binary path.","Verify the config file section feeding the proxy actually defines the command key rather than defaulting it to empty.","If the command is intentionally optional, guard the call site: skip launching the proxy when the command is blank instead of invoking it."],"exampleFix":"// before (lane config)\ncommand = \"\"            # or command = \"$LANE_BIN\" with LANE_BIN unset\n// after\ncommand = \"/usr/local/bin/my-lane-worker\"","handlingStrategy":"validation","validationCode":"let command = lane_config.command.as_deref().unwrap_or(\"\");\nif command.trim().is_empty() {\n    // fail fast at config load, before invoking the proxy\n    return Err(\"lane command is empty; set command in lane config\");\n}","typeGuard":null,"tryCatchPattern":"let code = run_lane_log_proxy(...)?;\nif code == 127 {\n    eprintln!(\"lane log proxy got an empty/missing command; check lane config command field\");\n}","preventionTips":["Always set a concrete, non-empty command in lane configuration; avoid bare variable substitutions that can expand to empty.","Validate lane config at load time (fail loud) rather than discovering empty commands at spawn.","In CI, skip the proxy call entirely when the command is intentionally absent instead of passing \"\"."],"tags":["lane","process-spawn","configuration","exit-code"],"backgroundTag":"missing-required-argument","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}