{"record":{"id":"796bb9c5e07e6190","repo":"zeroclaw-labs/zeroclaw","slug":"missing-channels-telegram-section-run-zeroc","errorCode":null,"errorMessage":"Missing [channels.telegram.{}] section. Run `zeroclaw config set channels.telegram.<alias>.bot_token <token>` to configure.","messagePattern":"Missing \\[channels\\.telegram\\.(.+?)\\] section\\. Run `zeroclaw config set channels\\.telegram\\.<alias>\\.bot_token <token>` to configure\\.","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-channels/src/telegram.rs","lineNumber":1114,"sourceCode":"                WARN,\n                ::zeroclaw_log::Event::new(module_path!(), ::zeroclaw_log::Action::Note)\n                    .with_outcome(::zeroclaw_log::EventOutcome::Unknown)\n                    .with_attrs(::serde_json::json!({\"identity\": identity})),\n                \"paired identity not persisted (no persistence handle wired)\"\n            );\n            return Ok(());\n        };\n        let normalized = Self::normalize_identity(identity);\n        if normalized.is_empty() {\n            anyhow::bail!(\"Cannot persist empty Telegram identity\");\n        }\n        let group_name = format!(\"telegram_{}\", self.alias);\n        let channel_ref: zeroclaw_config::providers::ChannelRef =\n            format!(\"telegram.{}\", self.alias).into();\n        let snapshot = {\n            let mut cfg = config.write();\n            if !cfg.channels.telegram.contains_key(&self.alias) {\n                anyhow::bail!(\n                    \"Missing [channels.telegram.{}] section. Run `zeroclaw config set channels.telegram.<alias>.bot_token <token>` to configure.\",\n                    self.alias\n                );\n            }\n            let group = cfg\n                .peer_groups\n                .entry(group_name)\n                .or_insert_with(|| PeerGroupConfig {\n                    channel: channel_ref,\n                    ..PeerGroupConfig::default()\n                });\n            if group\n                .external_peers\n                .iter()\n                .any(|p| Self::normalize_identity(p.as_str()) == normalized)\n            {\n                return Ok(());\n            }","sourceCodeStart":1096,"sourceCodeEnd":1132,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-channels/src/telegram.rs#L1096-L1132","documentation":"persist_identity() takes a write lock on the live config and requires the [channels.telegram.<alias>] table to already exist before attaching the paired identity group. If the running channel's alias has no matching TOML section (no bot_token ever configured under that exact key), the write aborts and tells you the command to run.","triggerScenarios":"Runtime handling a telegram alias supplied via env/CLI that was never materialized into the config file; alias key mismatch (lookup is an exact, case-sensitive contains_key) such as 'Default' vs 'default'; config file deleted or rotated after startup while the in-memory channel keeps running under the old alias.","commonSituations":"Fresh installs where bot_token was set for one alias but the bot runs under a second alias; renaming an alias in one place only; pairing before completing first-run configuration; hand-edited TOML with the table under a different name.","solutions":["Run `zeroclaw config set channels.telegram.<alias>.bot_token <token>` for the exact alias named in the error, then re-run pairing.","Diff the alias in the error against the keys under [channels.telegram.*] in the config — they must match exactly, including case.","If the section exists under a different alias, point the channel at that alias instead of duplicating config.","Restart the runtime after fixing config so the in-memory channel and the file agree."],"exampleFix":"# before\n[channels.telegram.default]\nbot_token = \"...\"\n# bot runs as alias \"work\" -> no [channels.telegram.work]\n\n# after\n[channels.telegram.default]\nbot_token = \"...\"\n\n[channels.telegram.work]\nbot_token = \"...\"","handlingStrategy":"validation","validationCode":"let alias = channel.alias();\n{\n    let cfg = config.read();\n    if !cfg.channels.telegram.contains_key(alias) {\n        anyhow::bail!(\"run first: zeroclaw config set channels.telegram.{alias}.bot_token <token>\");\n    }\n}\nchannel.persist_identity(identity).await?;","typeGuard":null,"tryCatchPattern":"match channel.persist_identity(identity).await {\n    Err(e) if e.to_string().contains(\"Missing [channels.telegram\") => {\n        eprintln!(\"configure the alias section, then re-run pairing\");\n    }\n    other => other?,\n}","preventionTips":["Create the [channels.telegram.<alias>] section during channel bootstrap so persistence always has a target.","Validate at startup that every running telegram alias exists in config, not only when pairing.","Keep alias names lower-case and defined in exactly one place."],"tags":["telegram","config","toml","pairing","bootstrap"],"backgroundTag":"missing-config-section","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}