{"record":{"id":"f970f340976766be","repo":"crowdsecurity/crowdsec","slug":"parsing-follow-stderr-parameters-s","errorCode":null,"errorMessage":"parsing 'follow_stderr' parameters: %s","messagePattern":"parsing 'follow_stderr' parameters: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/docker/config.go","lineNumber":281,"sourceCode":"\t\t\t}\n\t\t\td.containerLogsOptions.Since = v[0]\n\t\tcase \"follow_stdout\":\n\t\t\tif len(v) != 1 {\n\t\t\t\treturn errors.New(\"only one 'follow_stdout' parameters is required, not many\")\n\t\t\t}\n\t\t\tfollowStdout, err := strconv.ParseBool(v[0])\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"parsing 'follow_stdout' parameters: %s\", err)\n\t\t\t}\n\t\t\td.Config.FollowStdout = followStdout\n\t\t\td.containerLogsOptions.ShowStdout = followStdout\n\t\tcase \"follow_stderr\":\n\t\t\tif len(v) != 1 {\n\t\t\t\treturn errors.New(\"only one 'follow_stderr' parameters is required, not many\")\n\t\t\t}\n\t\t\tfollowStdErr, err := strconv.ParseBool(v[0])\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"parsing 'follow_stderr' parameters: %s\", err)\n\t\t\t}\n\t\t\td.Config.FollowStdErr = followStdErr\n\t\t\td.containerLogsOptions.ShowStderr = followStdErr\n\t\tcase \"docker_host\":\n\t\t\tif len(v) != 1 {\n\t\t\t\treturn errors.New(\"only one 'docker_host' parameters is required, not many\")\n\t\t\t}\n\t\t\topts = append(opts, client.WithHost(v[0]))\n\t\t}\n\t}\n\n\td.Client, err = client.New(opts...)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\td.backoffFactory = newDockerBackOffFactory()\n","sourceCodeStart":263,"sourceCodeEnd":299,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/docker/config.go#L263-L299","documentation":"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.","triggerScenarios":"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=.","commonSituations":"yes/no style booleans from shell habits; empty value after `=` when a variable was unset; duplicated parameter or stray quoting in the DSN.","solutions":["Set the value to `true` or `false`.","Ensure the variable providing the value expands to a boolean string.","Keep the parameter unique — repeated follow_stderr entries are rejected earlier.","For non-boolean needs, use the YAML configuration instead of DSN parameters."],"exampleFix":"// before\ndocker://mycontainer?follow_stderr=enabled\n// after\ndocker://mycontainer?follow_stderr=true","handlingStrategy":"validation","validationCode":"if v := dsnQuery.Get(\"follow_stderr\"); v != \"\" {\n    if _, err := strconv.ParseBool(v); err != nil {\n        return fmt.Errorf(\"follow_stderr must be a Go bool string, got %q\", v)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use true/false (or 1/0) only — strconv.ParseBool's accepted set.","Ensure the value source (env var, template) always yields a boolean string.","Validate the whole DSN query with strconv.ParseBool for each boolean param before loading config."],"tags":["config","boolean","dsn"],"backgroundTag":"invalid-flag-value","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"}