block/buzz · error · anyhow::Error

invalid --channel UUID

Error message

invalid --channel UUID: {e}

What it means

reconcile-channels parses its --channel argument with uuid::Uuid::parse_str, which accepts only the canonical 8-4-4-4-12 lowercase-or-uppercase hexadecimal form. Braces, a 'urn:uuid:' prefix, a '0x' prefix, missing hyphens, or a non-hex character all fail and are wrapped as 'invalid --channel UUID'. The value expected is the channel's database UUID (the same string used in the events' d tags), not the channel name.

Solutions

  1. Get the exact id: SELECT id, name FROM channels; or use the channels list command output.
  2. Pass the hyphenated 36-char form: --channel 6f1c2e34-....
  3. Strip surrounding quotes/braces/whitespace from the copied value.
  4. If you meant a whole-community reconcile, omit --channel entirely.

Example fix

# before
buzz-admin reconcile-channels --channel general
buzz-admin reconcile-channels --channel "{6f1c2e34-...}"
# after
buzz-admin reconcile-channels --channel 6f1c2e34-9ab1-4c2e-8d3f-000000000000
Defensive patterns

Strategy: type-guard

Type guard

fn is_canonical_uuid(s: &str) -> bool {
    let h = s.trim().trim_matches(|c| c == '{' || c == '}');
    h.len() == 36
        && h.as_bytes().iter().enumerate().all(|(i, b)| match i {
            8 | 13 | 18 | 23 => *b == b'-',
            _ => b.is_ascii_hexdigit(),
        })
}

Prevention

When it happens

Trigger: Passing --channel general (a name), --channel {6f1c...} (braces), --channel 6f1c... without hyphens, or an id copied with a leading/trailing space.

Common situations: Confusing channel names with channel ids; ids pasted from JSON with quotes; UUIDs reformatted by spreadsheets (hyphens stripped).

Related errors


AI-assisted analysis of block/buzz@ef2aa1ae38 (2026-08-20). Data as JSON: /api/errors/74eda9fff16a163c. Report an issue: GitHub.

Appendix: source

Thrown at crates/buzz-admin/src/main.rs:662

        }
        None => {
            let k = Keys::generate();
            eprintln!(
                "Warning: no relay key provided — using ephemeral key {}",
                k.public_key().to_hex()
            );
            eprintln!("Events signed with this key won't be verifiable after this run.");
            eprintln!("Pass --relay-key or set BUZZ_RELAY_PRIVATE_KEY for production use.");
            k
        }
    };

    let tenant = resolve_admin_tenant(&db).await?;
    let target_channel = channel_arg
        .as_deref()
        .map(uuid::Uuid::parse_str)
        .transpose()
        .map_err(|e| anyhow::anyhow!("invalid --channel UUID: {e}"))?;
    let channels = if let Some(target) = target_channel {
        vec![db
            .get_channel(tenant.community(), target)
            .await
            .map_err(|_| {
                anyhow::anyhow!("channel {target} not found in community {}", tenant.host())
            })?]
    } else {
        db.list_channels(tenant.community(), None).await?
    };
    if channels.is_empty() {
        println!("No channels in database.");
        return Ok(());
    }

    let mut reconciled = 0u32;
    let mut skipped = 0u32;

View on GitHub (pinned to ef2aa1ae38)