{"record":{"id":"492631186b5b463b","repo":"crowdsecurity/crowdsec","slug":"cannot-list-shards-w","errorCode":null,"errorMessage":"cannot list shards: %w","messagePattern":"cannot list shards: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/kinesis/run.go","lineNumber":398,"sourceCode":"\t\tcase <-s.shardReaderTomb.Dying():\n\t\t\tlogger.Infof(\"shardReaderTomb is dying, exiting ReadFromShard\")\n\t\t\tticker.Stop()\n\n\t\t\treturn nil\n\t\t}\n\t}\n}\n\nfunc (s *Source) ReadFromStream(ctx context.Context, out chan pipeline.Event, t *tomb.Tomb) error {\n\ts.logger = s.logger.WithField(\"stream\", s.Config.StreamName)\n\ts.logger.Info(\"starting kinesis acquisition from shards\")\n\n\tfor {\n\t\tshards, err := s.kClient.ListShards(ctx, &kinesis.ListShardsInput{\n\t\t\t\tStreamName: aws.String(s.Config.StreamName),\n\t\t\t})\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"cannot list shards: %w\", err)\n\t\t}\n\n\t\ts.shardReaderTomb = &tomb.Tomb{}\n\n\t\tfor _, shard := range shards.Shards {\n\t\t\tshardID := *shard.ShardId\n\n\t\t\ts.shardReaderTomb.Go(func() error {\n\t\t\t\tdefer trace.ReportPanic()\n\t\t\t\treturn s.ReadFromShard(ctx, out, shardID)\n\t\t\t})\n\t\t}\n\n\t\tselect {\n\t\tcase <-t.Dying():\n\t\t\ts.logger.Info(\"kinesis source is dying\")\n\t\t\ts.shardReaderTomb.Kill(nil)\n\t\t\t_ = s.shardReaderTomb.Wait() // we don't care about the error as we kill the tomb ourselves","sourceCodeStart":380,"sourceCodeEnd":416,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/kinesis/run.go#L380-L416","documentation":"ReadFromStream enumerates shards with kinesis ListShards before spawning per-shard readers; the AWS call failed (credentials, permissions, missing/throttled stream), so stream acquisition aborts with the wrapped AWS error.","triggerScenarios":"Thrown at pkg/acquisition/modules/kinesis/run.go:398 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check AWS credentials, region and network connectivity","Verify IAM permissions for kinesis:ListShards","Confirm the stream name and that the stream is ACTIVE"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"909b5157986a2b2c2163300fdaef5ed01289f7d2","analyzedAt":"2026-09-06T12:27:26.012Z","contentChangedAt":"2026-09-06T12:27:26.012Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}