{"record":{"id":"843da17ee7c6d342","repo":"chenhg5/cc-connect","slug":"invalid-value-for-log-max-size-s","errorCode":null,"errorMessage":"invalid value for --log-max-size: %s","messagePattern":"invalid value for --log-max-size: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cc-connect/daemon.go","lineNumber":154,"sourceCode":"\t\tcase arg == \"--no-capture-secrets\":\n\t\t\tcfg.NoCaptureSecrets = true\n\t\tcase arg == \"--log-file\":\n\t\t\tvalue, next, err := daemonInstallFlagValue(args, i, \"--log-file\")\n\t\t\tif err != nil {\n\t\t\t\treturn daemon.Config{}, false, err\n\t\t\t}\n\t\t\tcfg.LogFile = value\n\t\t\ti = next\n\t\tcase strings.HasPrefix(arg, \"--log-file=\"):\n\t\t\tcfg.LogFile = strings.TrimPrefix(arg, \"--log-file=\")\n\t\tcase arg == \"--log-max-size\":\n\t\t\tvalue, next, err := daemonInstallFlagValue(args, i, \"--log-max-size\")\n\t\t\tif err != nil {\n\t\t\t\treturn daemon.Config{}, false, err\n\t\t\t}\n\t\t\tmb, err := strconv.Atoi(value)\n\t\t\tif err != nil {\n\t\t\t\treturn daemon.Config{}, false, fmt.Errorf(\"invalid value for --log-max-size: %s\", value)\n\t\t\t}\n\t\t\tcfg.LogMaxSize = int64(mb) * 1024 * 1024\n\t\t\ti = next\n\t\tcase strings.HasPrefix(arg, \"--log-max-size=\"):\n\t\t\tvalue := strings.TrimPrefix(arg, \"--log-max-size=\")\n\t\t\tmb, err := strconv.Atoi(value)\n\t\t\tif err != nil {\n\t\t\t\treturn daemon.Config{}, false, fmt.Errorf(\"invalid value for --log-max-size: %s\", value)\n\t\t\t}\n\t\t\tcfg.LogMaxSize = int64(mb) * 1024 * 1024\n\t\tcase arg == \"--work-dir\":\n\t\t\tvalue, next, err := daemonInstallFlagValue(args, i, \"--work-dir\")\n\t\t\tif err != nil {\n\t\t\t\treturn daemon.Config{}, false, err\n\t\t\t}\n\t\t\tcfg.WorkDir = value\n\t\t\ti = next\n\t\tcase strings.HasPrefix(arg, \"--work-dir=\"):","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/cmd/cc-connect/daemon.go#L136-L172","documentation":"parseDaemonInstallArgs parses `cc-connect daemon install` flags. When --log-max-size is given in space-separated form, the following token is converted with strconv.Atoi; this error is thrown if it is not a valid integer. The value is interpreted as megabytes (multiplied by 1024*1024 to become bytes).","triggerScenarios":"`cc-connect daemon install --log-max-size 10MB` (suffix not allowed), `--log-max-size 2.5` (float rejected), `--log-max-size abc`, or `--log-max-size` followed by another flag such as `--log-max-size --config x.toml` (the flag name itself fails Atoi).","commonSituations":"Users copy sizes like '10MB' or '5m' from documentation of other tools, or forget the value after the flag so the next flag is consumed as the number.","solutions":["Pass a bare integer number of megabytes, e.g. --log-max-size 10","Remove unit suffixes (MB, MiB, m) from the value","Ensure --log-max-size is followed by its numeric value before other flags"],"exampleFix":"// before\ncc-connect daemon install --log-max-size 10MB --config app.toml\n// after\ncc-connect daemon install --log-max-size 10 --config app.toml","handlingStrategy":"validation","validationCode":"func validLogMaxSize(v string) bool { _, err := strconv.Atoi(v); return err == nil }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember the unit is fixed: the number is megabytes","Never place another flag immediately after --log-max-size","Validate numeric flag values in wrapper scripts"],"tags":["cli","daemon","validation"],"backgroundTag":"invalid-flag-value","analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}