AprilNEA/OpenLogi · error

--id and --name must match the in-progress contribution

Error message

--id and --name must match the in-progress contribution

What it means

The `finish` step verifies that `--id`/`--name` on the command line match the fixture id, profile id (`{id}-profile`), and profile name recorded in the in-progress contribution state. A mismatch means you are trying to finish a different (or renamed) contribution than the one whose state exists. `validate_state` rejects it.

Solutions

  1. Re-run finish with the exact same `--id` and `--name` used when the contribution was started.
  2. If you intentionally renamed the device, discard the old state (remove the output dir) and start a fresh contribution with the new name.
  3. Check the state file's `fixture_id`/`profile_name` fields to confirm the original values before re-running.

Example fix

// before
openlogi fixture contribute finish --id mx-master --name "MX Master 3S" ...
// after (state was started with the old name)
openlogi fixture contribute finish --id mx-master --name "MX Master" ...
Defensive patterns

Strategy: validation

Validate before calling

stored=$(python3 -c "import json;s=json.load(open('out/$ID/state.json'));print(s['fixture_id'], s['profile_name'])")
[ "$stored" = "$ID $NAME" ] || { echo "--id/--name do not match in-progress contribution: $stored" >&2; exit 1; }

Prevention

When it happens

Trigger: Run finish with an `--id` different from the one used at contribution start, or a `--name` that was changed since start; the state stores `profile_id = "{id}-profile"` and `profile_name = name`, and any divergence bails.

Common situations: Renaming a device between start and finish; finishing several contributions in a loop but passing the same id each time; typos in the id.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


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

Appendix: source

Thrown at crates/openlogi-cli/src/cmd/fixture/contribute.rs:472

    }
    if args.name.trim().is_empty() {
        bail!("--name must be a nonempty synthetic device name");
    }
    if args.output.file_name() != Some(OsStr::new(&args.id)) {
        bail!("--output directory name must exactly equal --id");
    }
    Ok(())
}

fn validate_state(args: &ContributeArgs, state: &ContributionState) -> Result<()> {
    if state.version != STATE_VERSION {
        bail!("unsupported contribution state version {}", state.version);
    }
    if state.fixture_id != args.id
        || state.profile_id != format!("{}-profile", args.id)
        || state.profile_name != args.name
    {
        bail!("--id and --name must match the in-progress contribution");
    }
    Ok(())
}

fn read_json<T: serde::de::DeserializeOwned>(path: &Path, asset: &str) -> Result<T> {
    let bytes = fs::read(path).with_context(|| format!("could not read {asset}"))?;
    serde_json::from_slice(&bytes).with_context(|| format!("could not parse {asset}"))
}

fn require_directory(path: &Path, asset: &str) -> Result<()> {
    let metadata =
        fs::symlink_metadata(path).with_context(|| format!("could not inspect {asset}"))?;
    if metadata.file_type().is_symlink() || !metadata.is_dir() {
        bail!("{asset} must be a non-symlink directory");
    }
    Ok(())
}

View on GitHub (pinned to e846e6f4b4)