{"record":{"id":"0683222846b27f97","repo":"crowdsecurity/crowdsec","slug":"consumer-name-is-mandatory-when-use-enhanced-fanou","errorCode":null,"errorMessage":"consumer_name is mandatory when use_enhanced_fanout is true","messagePattern":"consumer_name is mandatory when use_enhanced_fanout is true","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/kinesis/config.go","lineNumber":85,"sourceCode":"\t\treturn err\n\t}\n\n\ts.Config = cfg\n\n\treturn nil\n}\n\nfunc (c *Configuration) Validate() error {\n\tif c.StreamName == \"\" && !c.UseEnhancedFanOut {\n\t\treturn errors.New(\"stream_name is mandatory when use_enhanced_fanout is false\")\n\t}\n\n\tif c.StreamARN == \"\" && c.UseEnhancedFanOut {\n\t\treturn errors.New(\"stream_arn is mandatory when use_enhanced_fanout is true\")\n\t}\n\n\tif c.ConsumerName == \"\" && c.UseEnhancedFanOut {\n\t\treturn errors.New(\"consumer_name is mandatory when use_enhanced_fanout is true\")\n\t}\n\n\tif c.StreamARN != \"\" && c.StreamName != \"\" {\n\t\treturn errors.New(\"stream_arn and stream_name are mutually exclusive\")\n\t}\n\n\treturn nil\n}\n\nfunc (s *Source) Configure(ctx context.Context, yamlConfig []byte, logger *log.Entry, metricsLevel metrics.AcquisitionMetricsLevel) error {\n\ts.logger = logger\n\ts.metricsLevel = metricsLevel\n\n\terr := s.UnmarshalConfig(yamlConfig)\n\tif err != nil {\n\t\treturn err\n\t}\n","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/kinesis/config.go#L67-L103","documentation":"Enhanced fan-out requires a named, registered consumer on the stream. Configuration.Validate() rejects fan-out configs without consumer_name because the Kinesis SubscribeToShard API must be called against a specific consumer ARN derived from that name.","triggerScenarios":"Calling Validate() on a kinesis Configuration where UseEnhancedFanOut is true and ConsumerName is empty.","commonSituations":"Users enable use_enhanced_fanout: true and provide stream_arn but forget consumer_name, not realizing fan-out registers a dedicated consumer distinct from the default shared iterator.","solutions":["Set consumer_name in the acquisition config (the consumer must be registered on the stream, e.g. via aws kinesis register-stream-consumer).","If a dedicated consumer is not wanted, set use_enhanced_fanout: false and identify the stream with stream_name instead.","Ensure the consumer name matches a registered consumer; the SDK does not create it automatically."],"exampleFix":"// before (yaml)\nsource: kinesis\nuse_enhanced_fanout: true\nstream_arn: arn:aws:kinesis:us-east-1:123456789012:stream/logs\n\n// after (yaml)\nsource: kinesis\nuse_enhanced_fanout: true\nstream_arn: arn:aws:kinesis:us-east-1:123456789012:stream/logs\nconsumer_name: crowdsec-consumer","handlingStrategy":"validation","validationCode":"if cfg.UseEnhancedFanOut && cfg.ConsumerName == \"\" {\n    return fmt.Errorf(\"kinesis: consumer_name is required when use_enhanced_fanout is true\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Register the consumer first: `aws kinesis register-stream-consumer --stream-arn <arn> --consumer-name <name>`.","Use the same consumer name in config and in AWS.","Document that fan-out requires all three: stream_arn, consumer_name, use_enhanced_fanout."],"tags":["aws","kinesis","config-validation","enhanced-fanout"],"backgroundTag":"missing-required-config-field","analyzedSha":"909b5157986a2b2c2163300fdaef5ed01289f7d2","analyzedAt":"2026-09-06T12:27:26.012Z","contentChangedAt":"2026-09-06T12:27:26.012Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}