AprilNEA/OpenLogi · error

--name must not be empty

Error message

--name must not be empty

What it means

`validate_metadata` rejects a `record-case` invocation whose `--name` value is empty or only whitespace, before any device I/O happens. The name identifies the recorded fixture case on disk, so an empty name is invalid.

Solutions

  1. Pass a non-empty `--name` value, e.g. `--name dpi-cycle-smartshift`
  2. In scripts, guard the variable: `: "${CASE_NAME:?CASE_NAME must be set}"` before invoking the CLI
  3. Trim user-supplied names before passing them through

Example fix

// before
openlogi fixture record-case --name "$CASE_NAME"   # CASE_NAME empty
// after
: "${CASE_NAME:?CASE_NAME must be set}"
openlogi fixture record-case --name "$CASE_NAME"
Defensive patterns

Strategy: validation

Validate before calling

if name.trim().is_empty() {
    return Err("--name must be a non-empty fixture case name");
}

Prevention

When it happens

Trigger: Invoking `openlogi fixture record-case --name ""` or `--name " "` (e.g. a shell variable that expanded to nothing, like `--name "$CASE_NAME"` with CASE_NAME unset).

Common situations: Scripting the recorder with an unset or typo'd environment variable; piping names from a file with blank lines; forgetting the flag entirely so a default empty value is used.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of AprilNEA/OpenLogi@e846e6f4b4 (2026-09-13). Data as JSON: /api/errors/6767ee489c85b854. Report an issue: GitHub.

Appendix: source

Thrown at crates/openlogi-cli/src/cmd/fixture/record_case.rs:297

    })
}

pub(super) async fn capture_for_contribution(
    operation: FixtureOperation,
    target: &CaptureTarget,
    name: &str,
    channel: &str,
    capacity: usize,
    identity_plan: &HidCassetteIdentityPlan,
) -> Result<HidCassette> {
    let (recording, observation) = capture(operation, target.route(), capacity).await?;
    let candidates = audit::sanitize_recording_with_plan(recording, name, channel, identity_plan)?;
    replay::select_self_replaying(operation, &target.target, &observation, candidates).await
}

fn validate_metadata(args: &RecordCaseArgs) -> Result<()> {
    if args.name.trim().is_empty() {
        bail!("--name must not be empty");
    }
    if args.channel.trim().is_empty() {
        bail!("--channel must not be empty");
    }
    Ok(())
}

async fn acquire_capture_ownership() -> Result<InstanceGuard> {
    // The agent acquires this same lock before any HID I/O. An endpoint probe
    // alone misses both early startup and a relaunch after the probe returns.
    let guard = single_instance::acquire("agent.lock").context(
        "refusing direct fixture capture: could not acquire agent.lock; \
         stop the OpenLogi agent and any other fixture capture before retrying",
    )?;
    match tokio::time::timeout(AGENT_PROBE_TIMEOUT, client::connect()).await {
        Ok(Err(ConnectError::Endpoint(error))) if endpoint_is_unreachable(&error) => Ok(guard),
        Ok(Ok(_) | Err(ConnectError::Handshake(_) | ConnectError::Endpoint(_))) | Err(_) => bail!(
            "refusing direct fixture capture because the agent endpoint is active or accepted a \

View on GitHub (pinned to e846e6f4b4)