AprilNEA/OpenLogi · error

--name must be a nonempty synthetic profile name

Error message

--name must be a nonempty synthetic profile name

What it means

`validate_metadata` rejects an empty (or whitespace-only) `--name` for `openlogi fixture record-profile`. The recorded semantic profile needs a human-readable synthetic display name, and an empty one would produce an unusable fixture entry. The check runs before capture, so nothing is written when it fires.

Solutions

  1. Pass a nonempty quoted name, e.g. `--name "Vertical Mouse Profile"`
  2. Quote the value so shell word-splitting doesn't drop it: --name "$PROFILE_NAME" with the variable set
  3. Verify the variable: : "${PROFILE_NAME:?PROFILE_NAME must be set}"

Example fix

// before
openlogi fixture record-profile --id syn-lift --name ""
// after
openlogi fixture record-profile --id syn-lift --name "Lift Vertical Mouse"
Defensive patterns

Strategy: validation

Validate before calling

#!/bin/sh
: "${SYN_NAME:?--name source variable must be set}"
[ -n "$(echo "$SYN_NAME" | tr -d '[:space:]')" ] || { echo "name is empty"; exit 2; }
openlogi fixture record-profile --id "$SYN_ID" --name "$SYN_NAME"

Try / catch

if let Err(e) = cmd.output() {
    if String::from_utf8_lossy(&e.stderr).contains("--name must be a nonempty synthetic profile name") {
        eprintln!("Pass a quoted nonempty --name, e.g. --name \"Lift Vertical Mouse\"");
    }
}

Prevention

When it happens

Trigger: Running `openlogi fixture record-profile` with `--name ""` or only whitespace, often because the value came from an empty shell variable or an unfilled template.

Common situations: CI scripts parameterizing the profile name with an unset variable; hand-editing a wrapper script and deleting the default name; non-ASCII quoting mistakes leaving the flag value empty.

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/c9cf5ae7e6ba30fa. Report an issue: GitHub.

Appendix: source

Thrown at crates/openlogi-cli/src/cmd/fixture/record_profile.rs:166

    )
    .await
    .map_err(|_| anyhow!("the running Agent timed out while providing its device snapshot"))?
    .map_err(|_| anyhow!("the running Agent disconnected while providing its device snapshot"))?;

    let captured = capture_profile(&connection.client, snapshot, selector, id, name).await?;
    captured
        .profile
        .validate()
        .context("captured semantic profile failed version-1 validation; no profile was written")?;
    Ok(captured)
}

fn validate_metadata(args: &RecordProfileArgs) -> Result<()> {
    if args.id.trim().is_empty() {
        bail!("--id must be a nonempty synthetic identifier");
    }
    if args.name.trim().is_empty() {
        bail!("--name must be a nonempty synthetic profile name");
    }
    Ok(())
}

async fn capture_profile(
    client: &AgentClient,
    snapshot: AgentSnapshot,
    selector: Option<&str>,
    id: String,
    name: String,
) -> Result<CapturedProfile> {
    // Runtime status, camera, foreground-app, and pairing facts are dropped at
    // this boundary and can never enter the serializable profile value.
    let AgentSnapshot {
        inventory,
        standalone,
        ..
    } = snapshot;

View on GitHub (pinned to e846e6f4b4)