crowdsecurity/crowdsec · error
invalid no_ready_check in dsn: %w
Error message
invalid no_ready_check in dsn: %w
What it means
ConfigureByDSN validates the optional 'no_ready_check' DSN boolean with strconv.ParseBool. Only 'true'/'false'/'1'/'0'/'t'/'f'/'T'/'F'/'TRUE'/'FALSE' style values are accepted; anything else triggers this error.
Source
Thrown at pkg/acquisition/modules/loki/config.go:211
l.Config.Limit = limit
} else {
l.Config.Limit = 5000 // max limit allowed by loki
}
if logLevel := params.Get("log_level"); logLevel != "" {
level, err := log.ParseLevel(logLevel)
if err != nil {
return fmt.Errorf("invalid log_level in dsn: %w", err)
}
l.Config.LogLevel = level
l.logger.Logger.SetLevel(level)
}
if noReadyCheck := params.Get("no_ready_check"); noReadyCheck != "" {
noReadyCheck, err := strconv.ParseBool(noReadyCheck)
if err != nil {
return fmt.Errorf("invalid no_ready_check in dsn: %w", err)
}
l.Config.NoReadyCheck = noReadyCheck
}
l.Config.URL = fmt.Sprintf("%s://%s", scheme, u.Host)
if u.User != nil {
l.Config.Auth.Username = u.User.Username()
l.Config.Auth.Password, _ = u.User.Password()
}
clientConfig := lokiclient.Config{
LokiURL: l.Config.URL,
Headers: l.Config.Headers,
Limit: l.Config.Limit,
Query: l.Config.Query,
Since: l.Config.Since,
Username: l.Config.Auth.Username,View on GitHub (pinned to 909b515798)
Solutions
- Use no_ready_check=true or no_ready_check=false in the DSN
- Remove the parameter (the ready check runs by default)
Example fix
// before loki://localhost:3100/?no_ready_check=yes // after loki://localhost:3100/?no_ready_check=true
Defensive patterns
Strategy: validation
Validate before calling
if v := params.Get("no_ready_check"); v != "" {
if _, err := strconv.ParseBool(v); err != nil {
return fmt.Errorf("no_ready_check must be a Go-parseable bool (true/false/1/0/t/f)")
}
} Prevention
- Only use true/false in URL query booleans
- Remember query strings are not YAML — 'yes'/'on' are invalid
When it happens
Trigger: A DSN like loki://host:3100/?no_ready_check=yes or no_ready_check=on is configured.
Common situations: Using YAML-style booleans ('yes'/'no') or 'enabled' in the URL query string.
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
- loki query is mandatory
- delay_for should be a value between 1s and 5s
- empty loki host
- parsing 'follow_stdout' parameters: %s
- parsing 'follow_stderr' parameters: %s
AI-assisted analysis of crowdsecurity/crowdsec@909b515798 (2026-09-06).
Data as JSON: /api/errors/d20d9919afc2464d.
Report an issue: GitHub.