{"record":{"id":"77c05e63d22d8aa1","repo":"block/buzz","slug":"channel-target-not-found-in-community","errorCode":null,"errorMessage":"channel {target} not found in community {}","messagePattern":"channel (.+?) not found in community (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/buzz-admin/src/main.rs","lineNumber":520,"sourceCode":"            );\n            eprintln!(\"Events signed with this key won't be verifiable after this run.\");\n            eprintln!(\"Pass --relay-key or set BUZZ_RELAY_PRIVATE_KEY for production use.\");\n            k\n        }\n    };\n\n    let tenant = resolve_admin_tenant(&db).await?;\n    let target_channel = channel_arg\n        .as_deref()\n        .map(uuid::Uuid::parse_str)\n        .transpose()\n        .map_err(|e| anyhow::anyhow!(\"invalid --channel UUID: {e}\"))?;\n    let channels = if let Some(target) = target_channel {\n        vec![db\n            .get_channel(tenant.community(), target)\n            .await\n            .map_err(|_| {\n                anyhow::anyhow!(\"channel {target} not found in community {}\", tenant.host())\n            })?]\n    } else {\n        db.list_channels(tenant.community(), None).await?\n    };\n    if channels.is_empty() {\n        println!(\"No channels in database.\");\n        return Ok(());\n    }\n\n    let mut reconciled = 0u32;\n    let mut skipped = 0u32;\n\n    for channel in &channels {\n        let channel_id_str = channel.id.to_string();\n\n        // Check if kind:39000 already exists\n        let existing = db\n            .query_events(&EventQuery {","sourceCodeStart":502,"sourceCodeEnd":538,"githubUrl":"https://github.com/block/buzz/blob/f956e6fe06a76e50cbd8fba1a162482e752e7f1a/crates/buzz-admin/src/main.rs#L502-L538","documentation":"reconcile_channels() parsed the --channel UUID but db.get_channel(community, target) returned an error/not-found for the community resolved from RELAY_URL. The channel id is syntactically valid but no row with that id exists in THIS community — either the channel was deleted, it belongs to a different community in a shared database, or RELAY_URL resolved to the wrong tenant. The message interpolates the channel UUID and the resolved community host so you can see the mismatch.","triggerScenarios":"Passing a channel UUID copied from another environment (staging id used against prod DB); the channel was deleted before reconcile ran; RELAY_URL points at a different relay whose community has no such channel; a re-generated database where old channel ids no longer exist.","commonSituations":"Runbooks with hard-coded channel UUIDs that drift between environments; operating against a shared Postgres with multiple communities and an unset/wrong RELAY_URL so the wrong tenant is resolved; retrying an old task after the channel was removed.","solutions":["List channels in the target community to confirm the id exists there: `SELECT id, name FROM channels WHERE community = (…);` or use the admin channel listing, then re-run with the correct UUID.","Verify RELAY_URL points at the relay whose community actually owns the channel — the error message names the host it searched, so compare that host with where the channel lives.","If the channel was intentionally deleted, drop --channel to reconcile all remaining channels, or skip the command.","If the UUID came from another environment, re-copy it from THIS deployment's database/CLI output."],"exampleFix":"# before: staging UUID used against the dev community\nbuzz-admin reconcile-channels --channel 11111111-2222-3333-4444-555555555555\n# error: channel 11111111-... not found in community localhost:3000\n\n# after: look up the real id, then reconcile\npsql $DATABASE_URL -c \"SELECT id, name FROM channels;\"\nbuzz-admin reconcile-channels --channel <real-uuid-for-this-community>","handlingStrategy":"validation","validationCode":"-- confirm the channel exists in the community your RELAY_URL resolves to\nSELECT id, name FROM channels\nWHERE id = '<uuid>'\n  AND community = (SELECT id FROM communities WHERE host = 'localhost:3000');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never hard-code channel UUIDs across environments — look them up per deployment.","After deleting a channel, prune stale ids from runbooks and scheduled jobs.","Set RELAY_URL explicitly in scripts so the community resolution is deterministic."],"tags":["buzz-admin","channel","not-found","multi-tenant","reconcile"],"backgroundTag":"resource-not-found","analyzedSha":"f956e6fe06a76e50cbd8fba1a162482e752e7f1a","analyzedAt":"2026-08-16T22:11:40.750Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}