crowdsecurity/crowdsec · error

parsing 'follow_stdout' parameters: %s

Error message

parsing 'follow_stdout' parameters: %s

What it means

The `follow_stdout` DSN parameter must be a boolean parsed with strconv.ParseBool (accepts 1/t/T/true/TRUE/True and 0/f/F/false/FALSE/False). Any other value aborts configuration with this error, embedding the strconv error message.

Source

Thrown at pkg/acquisition/modules/docker/config.go:271

			}
			d.logger.Logger.SetLevel(lvl)
		case "until":
			if len(v) != 1 {
				return errors.New("only one 'until' parameters is required, not many")
			}
			d.containerLogsOptions.Until = v[0]
		case "since":
			if len(v) != 1 {
				return errors.New("only one 'since' parameters is required, not many")
			}
			d.containerLogsOptions.Since = v[0]
		case "follow_stdout":
			if len(v) != 1 {
				return errors.New("only one 'follow_stdout' parameters is required, not many")
			}
			followStdout, err := strconv.ParseBool(v[0])
			if err != nil {
				return fmt.Errorf("parsing 'follow_stdout' parameters: %s", err)
			}
			d.Config.FollowStdout = followStdout
			d.containerLogsOptions.ShowStdout = followStdout
		case "follow_stderr":
			if len(v) != 1 {
				return errors.New("only one 'follow_stderr' parameters is required, not many")
			}
			followStdErr, err := strconv.ParseBool(v[0])
			if err != nil {
				return fmt.Errorf("parsing 'follow_stderr' parameters: %s", err)
			}
			d.Config.FollowStdErr = followStdErr
			d.containerLogsOptions.ShowStderr = followStdErr
		case "docker_host":
			if len(v) != 1 {
				return errors.New("only one 'docker_host' parameters is required, not many")
			}
			opts = append(opts, client.WithHost(v[0]))

View on GitHub (pinned to 909b515798)

Solutions

  1. Change the value to `true` or `false` (or 1/0).
  2. Remove quotes/whitespace accidentally included in the DSN parameter.
  3. Remember the parameter can appear at most once (`only one ... is required, not many`).

Example fix

// before
docker://mycontainer?follow_stdout=yes
// after
docker://mycontainer?follow_stdout=true
Defensive patterns

Strategy: validation

Validate before calling

if v := dsnQuery.Get("follow_stdout"); v != "" {
    if _, err := strconv.ParseBool(v); err != nil {
        return fmt.Errorf("follow_stdout must be a Go bool string, got %q", v)
    }
}

Prevention

When it happens

Trigger: ConfigureByDSN seeing `?follow_stdout=<v>` where strconv.ParseBool fails — e.g. follow_stdout=yes, on, 2, or an empty value from `follow_stdout=`.

Common situations: Using yes/no or on/off style booleans in the DSN; trailing whitespace or quotes captured into the value; templated config inserting a non-boolean.

Understand the failure class

Background: "unknown output mode", "invalid value for flag", "expects true/false": fixing invalid flag value errors in CLI tools — this error's family across 24 libraries.

Related errors


AI-assisted analysis of crowdsecurity/crowdsec@909b515798 (2026-09-06). Data as JSON: /api/errors/17ea7b26f1a99a4b. Report an issue: GitHub.