crowdsecurity/crowdsec · error
unknown parameter %s
Error message
unknown parameter %s
What it means
ConfigureByDSN iterates the DSN query parameters and rejects any key it does not recognize with this error. Only the S3 source's supported parameters (e.g. log_level, max_buffer_size, and other documented keys) are allowed.
Source
Thrown at pkg/acquisition/modules/s3/config.go:247
if err != nil {
return fmt.Errorf("unknown level %s: %w", value[0], err)
}
s.logger.Logger.SetLevel(lvl)
case "max_buffer_size":
if len(value) != 1 {
return errors.New("expected zero or one value for 'max_buffer_size'")
}
maxBufferSize, err := strconv.Atoi(value[0])
if err != nil {
return fmt.Errorf("invalid value for 'max_buffer_size': %w", err)
}
s.logger.Debugf("Setting max buffer size to %d", maxBufferSize)
s.Config.MaxBufferSize = maxBufferSize
default:
return fmt.Errorf("unknown parameter %s", key)
}
}
}
s.Config.Labels = labels
s.Config.Mode = configuration.CAT_MODE
s.Config.UniqueId = uuid
pathParts := strings.Split(args[0], "/")
s.logger.Debugf("pathParts: %v", pathParts)
// FIXME: handle s3://bucket/
if len(pathParts) == 1 {
s.Config.BucketName = pathParts[0]
s.Config.Prefix = ""
} else if len(pathParts) > 1 {
s.Config.BucketName = pathParts[0]
if args[0][len(args[0])-1] == '/' {View on GitHub (pinned to 909b515798)
Solutions
- Remove the unknown parameter from the DSN.
- Check the S3 acquisition documentation for the exact supported parameter names.
- Check for typos or renamed options (e.g. max_buffer_size vs maxBufferSize).
Example fix
// before crowdsec-s3://mybucket?bufffer_size=1024 // after crowdsec-s3://mybucket?max_buffer_size=1024
Defensive patterns
Strategy: validation
Validate before calling
allowed := map[string]bool{"log_level":true, "max_buffer_size":true /* + other supported keys */}
for key := range params {
if !allowed[key] { return fmt.Errorf("unsupported S3 DSN parameter %q", key) }
} Prevention
- Copy DSN parameters only from the same source type's documentation.
- Validate DSNs in CI with a config parse step.
- Re-check parameter names after upgrading crowdsec.
When it happens
Trigger: A DSN such as crowdsec-s3://bucket?region=us-east-1&foo=bar where a key is not in the source's switch statement — either a genuinely unsupported option, a renamed option, or a typo.
Common situations: Copy-pasting DSN options from another data source (e.g. kafka or cloudwatch options); guessing parameter names; options removed or renamed in a newer crowdsec version.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- invalid DSN %s for S3 source
- invalid DSN %s for S3 source, must start with s3://
- unknown level %s: %w
- invalid value for 'max_buffer_size': %w
- empty host
AI-assisted analysis of crowdsecurity/crowdsec@909b515798 (2026-09-06).
Data as JSON: /api/errors/754bab3a0b445d81.
Report an issue: GitHub.