AprilNEA/OpenLogi · error

--id must be a nonempty synthetic identifier

Error message

--id must be a nonempty synthetic identifier

What it means

`validate_metadata` checks that the `--id` passed to `openlogi fixture record-profile` is a nonempty synthetic identifier before any capture runs. Synthetic fixture data must never embed real hardware identity, so an empty (or whitespace-only) id is rejected up front. This is a CLI argument guard, raised before the agent connection is used for capture.

Solutions

  1. Pass a nonempty synthetic id, e.g. `--id syn-mx-master-3s`
  2. Check the shell variable feeding --id is actually set: `${SYN_ID:?SYN_ID must be set}`
  3. Use a slug-style identifier (lowercase, hyphens) consistent with existing fixture ids

Example fix

// before
openlogi fixture record-profile --id "$SYN_ID" --name "Profile"   # SYN_ID empty
// after
openlogi fixture record-profile --id "syn-lift-vertical" --name "Profile"
Defensive patterns

Strategy: validation

Validate before calling

#!/bin/sh
: "${SYN_ID:?--id source variable must be set}"
[ -n "$(echo "$SYN_ID" | tr -d '[:space:]')" ] || { echo "id 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("--id must be a nonempty synthetic identifier") {
        eprintln!("Pass a nonempty synthetic --id, e.g. --id syn-my-device");
    }
}

Prevention

When it happens

Trigger: Running `openlogi fixture record-profile` with `--id ""` or `--id " "` (trim-to-empty), or omitting a meaningful id value.

Common situations: Scripting the command with a shell variable that resolves to empty (unset env var, failed substitution); copy-pasting a template command without filling in the placeholder id.

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

Appendix: source

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

    let snapshot = tokio::time::timeout(
        SNAPSHOT_TIMEOUT,
        connection.client.snapshot(context::current()),
    )
    .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,

View on GitHub (pinned to e846e6f4b4)