block/buzz · error · anyhow::Error

channel not found in community

Error message

channel {target} not found in community {}

What it means

After parsing the UUID, reconcile-channels calls db.get_channel(community, target). A miss is reported as 'channel {target} not found in community {host}'. Note the mapping is lossy: map_err(|_| ...) collapses any DB error into the same message, so a genuine database failure masquerades as a missing channel. The community is the one resolved from RELAY_URL (see error 26), so a valid channel in a different community is invisible here.

Solutions

  1. Confirm which community you are on: SELECT id, host FROM communities; and match it to RELAY_URL's authority (host + port).
  2. List the channels that ARE visible: SELECT id, name FROM channels WHERE community_id = '<that id>'; and use one of those ids.
  3. If the list query also fails, suspect the DB itself — check DATABASE_URL connectivity (this error text cannot distinguish the two).
  4. Omit --channel to reconcile every channel in the resolved community.

Example fix

# before
RELAY_URL=ws://relay.example:8443 buzz-admin reconcile-channels --channel <uuid-from-local-dev>
# after
RELAY_URL=ws://localhost:3000 buzz-admin reconcile-channels --channel <uuid-from-SELECT-id,name-FROM-channels>
Defensive patterns

Strategy: validation

Validate before calling

-- prove the channel exists in the community you are about to operate on
SELECT c.id, c.name FROM channels c
JOIN communities m ON m.id = c.community_id
WHERE c.id = '<uuid>' AND m.host = 'localhost:3000'; -- = authority of RELAY_URL
-- zero rows => wrong community or wrong id; do not run reconcile

Prevention

When it happens

Trigger: The UUID is syntactically valid but no channels row has that id in the resolved community; RELAY_URL points at community A while the channel lives in community B; or the underlying Postgres query errored (connectivity, permissions) and got the same message.

Common situations: Copying a channel id from a staging relay and running the CLI against local; running after switching RELAY_URL/DATABASE_URL; two communities sharing a host prefix.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


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

Appendix: source

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

            );
            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;

    for channel in &channels {
        let channel_id_str = channel.id.to_string();

        // Check if kind:39000 already exists
        let existing = db
            .query_events(&EventQuery {

View on GitHub (pinned to ef2aa1ae38)