crowdsecurity/crowdsec · error

parsing 'follow_stderr' parameters: %s

Error message

parsing 'follow_stderr' parameters: %s

What it means

Identical mechanism to follow_stdout but for `follow_stderr`: strconv.ParseBool must accept the value as a Go boolean string, otherwise ConfigureByDSN returns this error with the parse failure embedded.

Source

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

			}
			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]))
		}
	}

	d.Client, err = client.New(opts...)
	if err != nil {
		return err
	}

	d.backoffFactory = newDockerBackOffFactory()

View on GitHub (pinned to 909b515798)

Solutions

  1. Set the value to `true` or `false`.
  2. Ensure the variable providing the value expands to a boolean string.
  3. Keep the parameter unique — repeated follow_stderr entries are rejected earlier.
  4. For non-boolean needs, use the YAML configuration instead of DSN parameters.

Example fix

// before
docker://mycontainer?follow_stderr=enabled
// after
docker://mycontainer?follow_stderr=true
Defensive patterns

Strategy: validation

Validate before calling

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

Prevention

When it happens

Trigger: ConfigureByDSN seeing `?follow_stderr=<v>` where v is not one of 1/t/T/true/True/TRUE/0/f/F/false/False/FALSE — e.g. follow_stderr=enabled or follow_stderr=.

Common situations: yes/no style booleans from shell habits; empty value after `=` when a variable was unset; duplicated parameter or stray quoting in the DSN.

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/f970f340976766be. Report an issue: GitHub.