{"record":{"id":"7296b938f917f2dd","repo":"alibaba/open-code-review","slug":"invalid-boolean-for-telemetry-content-logging-w","errorCode":null,"errorMessage":"invalid boolean for telemetry.content_logging: %w","messagePattern":"invalid boolean for telemetry\\.content_logging: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/opencodereview/config_cmd.go","lineNumber":585,"sourceCode":"\tcase \"language\", \"Language\":\n\t\tcfg.Language = value\n\tcase \"telemetry.enabled\", \"telemetry.Enabled\":\n\t\tb, err := strconv.ParseBool(value)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"invalid boolean for telemetry.enabled: %w\", err)\n\t\t}\n\t\tcfg.ensureTelemetry()\n\t\tcfg.Telemetry.Enabled = b\n\tcase \"telemetry.exporter\", \"telemetry.Exporter\":\n\t\tcfg.ensureTelemetry()\n\t\tcfg.Telemetry.Exporter = value\n\tcase \"telemetry.otlp_endpoint\", \"telemetry.OTLPEndpoint\":\n\t\tcfg.ensureTelemetry()\n\t\tcfg.Telemetry.OTLPEndpoint = value\n\tcase \"telemetry.content_logging\", \"telemetry.ContentLog\":\n\t\tb, err := strconv.ParseBool(value)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"invalid boolean for telemetry.content_logging: %w\", err)\n\t\t}\n\t\tcfg.ensureTelemetry()\n\t\tcfg.Telemetry.ContentLog = b\n\tcase \"llm.extra_body\", \"llm.ExtraBody\":\n\t\tvar m map[string]any\n\t\tif err := json.Unmarshal([]byte(value), &m); err != nil {\n\t\t\treturn fmt.Errorf(\"invalid JSON for llm.extra_body: %w\", err)\n\t\t}\n\t\tcfg.Llm.ExtraBody = m\n\tcase \"llm.retry_codes\", \"llm.RetryCodes\":\n\t\tcodes, warnings, err := llm.ParseRetryCodes(value)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor _, w := range warnings {\n\t\t\tfmt.Fprintf(os.Stderr, \"[ocr] WARNING: %s\\n\", w)\n\t\t}\n\t\tcfg.Llm.RetryCodes = codes","sourceCodeStart":567,"sourceCodeEnd":603,"githubUrl":"https://github.com/alibaba/open-code-review/blob/5cf97d0d15cbd41b602513c4be3bfec3cee5bf7f/cmd/opencodereview/config_cmd.go#L567-L603","documentation":"The telemetry.content_logging key is parsed with strconv.ParseBool; a value Go cannot interpret as a boolean produces \"invalid boolean for telemetry.content_logging: %w\" with the strconv parse error attached.","triggerScenarios":"`ocr config set telemetry.content_logging yes|on|\"\"|1.0` — anything outside strconv.ParseBool's accepted set.","commonSituations":"Trying to turn content logging on with \"yes\"; templated config where the placeholder was never substituted; copy-pasting YAML conventions into the CLI.","solutions":["Use `ocr config set telemetry.content_logging true` (or false)","Use 1/0 in scripts","Quote the value so the shell doesn't split or drop it","Confirm with `ocr config get` that the value took effect"],"exampleFix":"// before\nocr config set telemetry.content_logging on\n// after\nocr config set telemetry.content_logging true","handlingStrategy":"validation","validationCode":"if _, err := strconv.ParseBool(v); err != nil {\n    return fmt.Errorf(\"telemetry.content_logging must be true/false, got %q\", v)\n}\n_ = runConfigSet(\"telemetry.content_logging\", v)","typeGuard":null,"tryCatchPattern":"if err := runConfigSet(\"telemetry.content_logging\", v); err != nil {\n    if strings.Contains(err.Error(), \"invalid boolean for telemetry.content_logging\") {\n        fmt.Fprintf(os.Stderr, \"expected true/false, got %q\\n\", v)\n    }\n}","preventionTips":["Pass true/false or 1/0 only","Quote the argument so the shell doesn't alter it","Validate template placeholders are substituted before running","Check the resulting value with `ocr config get`"],"tags":["config","telemetry","boolean","cli"],"backgroundTag":"invalid-boolean-value","analyzedSha":"5cf97d0d15cbd41b602513c4be3bfec3cee5bf7f","analyzedAt":"2026-09-02T02:08:09.116Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}