{"record":{"id":"8255cb43b9a9fea7","repo":"risingwavelabs/risingwave","slug":"topic-not-found","errorCode":null,"errorMessage":"topic {} not found","messagePattern":"topic (.+?) not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/connector/src/source/kafka/enumerator.rs","lineNumber":628,"sourceCode":"\n    pub async fn check_reachability(&self) -> ConnectorResult<()> {\n        let _ = self\n            .client\n            .fetch_metadata(Some(self.topic.as_str()), self.sync_call_timeout)\n            .await?;\n        Ok(())\n    }\n\n    async fn fetch_topic_partition(&self) -> ConnectorResult<Vec<i32>> {\n        // for now, we only support one topic\n        let metadata = self\n            .client\n            .fetch_metadata(Some(self.topic.as_str()), self.sync_call_timeout)\n            .await?;\n\n        let topic_meta = match metadata.topics() {\n            [meta] => meta,\n            _ => bail!(\"topic {} not found\", self.topic),\n        };\n\n        if topic_meta.partitions().is_empty() {\n            bail!(\"topic {} not found\", self.topic);\n        }\n\n        Ok(topic_meta\n            .partitions()\n            .iter()\n            .map(|partition| partition.id())\n            .collect())\n    }\n}\n\n/// Drops cached start offsets of partitions that are no longer present and returns the\n/// partitions whose start offset still has to be resolved.\nfn sync_resolved_partitions(\n    resolved: &mut HashMap<i32, Option<i64>>,","sourceCodeStart":610,"sourceCodeEnd":646,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/source/kafka/enumerator.rs#L610-L646","documentation":"Raised when Kafka metadata for the configured topic cannot be resolved into exactly one topic entry. This bail fires in `fetch_topic_partition` when the metadata response does not contain exactly one topic (e.g. the topic was deleted, or the broker returned an error/unknown-topic-response), so partition enumeration cannot proceed.","triggerScenarios":"`fetch_topic_partition` (called by `list_splits`/`list_splits_batch` during source startup or split discovery) fetches metadata for `self.topic` and the response's `topics()` slice is not exactly one element — typically a `None` topic (auto topic creation disabled and topic missing) rather than a single entry.","commonSituations":"Typo in the topic name in WITH options; topic deleted after source creation; Kafka broker with auto.create.topics.enable=false returning unknown topic; wrong cluster (staging vs prod bootstrap servers); topic name case mismatch.","solutions":["Verify the topic exists: `kafka-topics.sh --bootstrap-server <broker> --describe --topic <topic>`","Fix the `topic` option in the WITH clause (typos, case sensitivity)","Confirm bootstrap_servers points at the intended cluster","If relying on auto-creation, enable auto.create.topics.enable on the broker or pre-create the topic"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// before creating the source\nkafka_topics(&bootstrap_servers).contains(&topic)\n  .then_some(())\n  .ok_or(format!(\"topic {} missing on cluster\", topic))?;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify topic existence with kafka-topics.sh before DDL","Check for typos and case in the topic option","Pre-create topics instead of relying on auto-creation","Confirm bootstrap_servers points to the right cluster"],"tags":["kafka","topic","metadata","not-found"],"backgroundTag":"entity-not-found","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}