{"record":{"id":"94c37ff67c23df41","repo":"risingwavelabs/risingwave","slug":"no-shards-in-stream","errorCode":null,"errorMessage":"no shards in stream {}","messagePattern":"no shards in stream (.+?)","errorType":"exception","errorClass":"ConnectorError","httpStatus":null,"severity":"error","filePath":"src/connector/src/source/kinesis/enumerator/client.rs","lineNumber":77,"sourceCode":"                req = req.stream_name(&self.stream_name);\n            }\n\n            let list_shard_output = match req.send().await {\n                Ok(output) => output,\n                Err(e) => {\n                    if let Some(e_inner) = e.as_service_error()\n                        && e_inner.is_expired_next_token_exception()\n                    {\n                        tracing::info!(\"Kinesis ListShard token expired, retrying...\");\n                        next_token = None;\n                        continue;\n                    }\n                    return Err(anyhow!(e).context(\"failed to list kinesis shards\").into());\n                }\n            };\n            match list_shard_output.shards {\n                Some(shard) => shard_collect.extend(shard),\n                None => bail!(\"no shards in stream {}\", &self.stream_name),\n            }\n\n            match list_shard_output.next_token {\n                Some(token) => next_token = Some(token),\n                None => break,\n            }\n        }\n        Ok(shard_collect\n            .into_iter()\n            .map(|x| KinesisSplit {\n                shard_id: x.shard_id().to_owned().into(),\n                // handle start with position in reader part\n                next_offset: KinesisOffset::None,\n                end_offset: KinesisOffset::None,\n            })\n            .collect())\n    }\n}","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/source/kinesis/enumerator/client.rs#L59-L95","documentation":"In the Kinesis split enumerator client (`list_splits`, src/connector/src/source/kinesis/enumerator/client.rs:77), the `ListShards` API succeeded but returned `shards: None`, meaning Kinesis reported no shards for the stream. The enumerator treats this as a hard error via `bail!(\"no shards in stream {}\", &self.stream_name)` rather than returning an empty split list.","triggerScenarios":"Calling `list_splits` against a Kinesis stream that exists but has zero shards — e.g. a freshly created stream whose shard list has not propagated, or a stream drained/closed with no active shards.","commonSituations":"Creating a RisingWave source immediately after `create-stream` before Kinesis metadata is consistent, or pointing at an empty/test stream with no shards; also possible with a stream name pointing at the wrong region's stream.","solutions":["Confirm the stream actually has shards: run `aws kinesis list-shards --stream-name <name>`.","If the stream was just created, wait a few seconds for shard metadata to propagate, then create the source.","Verify the stream name and region in the source WITH options match the intended stream.","If the stream is empty by design, create at least one shard (e.g. via put-record on an open shard or resize the stream) before sourcing from it."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Ensure the stream has shards before creating the source\nconst { KinesisClient, ListShardsCommand } = require('@aws-sdk/client-kinesis');\nconst out = await client.send(new ListShardsCommand({ StreamName: streamName }));\nif (!out.Shards || out.Shards.length === 0) {\n  throw new Error(`stream ${streamName} has no shards yet; wait or add a shard`);\n}","typeGuard":null,"tryCatchPattern":"match enumerator.list_splits().await {\n    Err(e) if e.to_string().starts_with(\"no shards in stream\") => {\n        // stream exists but has no shards: wait and re-check the stream\n    }\n    other => other?,\n}","preventionTips":["Verify the stream has open shards (`aws kinesis list-shards`) before sourcing","Allow a short delay after stream creation for shard metadata to propagate","Double-check stream name and region to avoid matching an unrelated empty stream"],"tags":["kinesis","aws","empty-result","stream"],"backgroundTag":"empty-result-set","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"}