{"record":{"id":"ccef5055aa3ac98b","repo":"multica-ai/multica","slug":"poll-interval-must-be-a-go-duration-e-g-10s-500","errorCode":null,"errorMessage":"poll_interval must be a Go duration (e.g. 10s, 500ms): %w","messagePattern":"poll_interval must be a Go duration \\(e\\.g\\. 10s, 500ms\\): %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_config.go","lineNumber":196,"sourceCode":"\t\t\tcfg.MaxConcurrentTasks = 0\n\t\t\treturn nil\n\t\t}\n\t\tn, err := strconv.Atoi(value)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"max_concurrent_tasks must be an integer: %w\", err)\n\t\t}\n\t\tif n < 0 {\n\t\t\treturn fmt.Errorf(\"max_concurrent_tasks must be >= 0 (got %d)\", n)\n\t\t}\n\t\tcfg.MaxConcurrentTasks = n\n\tcase \"poll_interval\":\n\t\tif value == \"\" {\n\t\t\tcfg.PollInterval = \"\"\n\t\t\treturn nil\n\t\t}\n\t\td, err := time.ParseDuration(value)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"poll_interval must be a Go duration (e.g. 10s, 500ms): %w\", err)\n\t\t}\n\t\t// Reject zero and negative durations. Persisting \"0s\" would look\n\t\t// configured in `config show` but be silently ignored at daemon\n\t\t// start (the resolver only substitutes strictly positive values),\n\t\t// which is exactly the trap reported in #3824's review. Empty\n\t\t// string is the one and only way to clear a previously persisted\n\t\t// value.\n\t\tif d <= 0 {\n\t\t\treturn fmt.Errorf(\"poll_interval must be positive (got %s); use `config set poll_interval \\\"\\\"` to clear it\", d)\n\t\t}\n\t\tcfg.PollInterval = value\n\tcase \"heartbeat_interval\":\n\t\tif err := assignPositiveDuration(&cfg.HeartbeatInterval, key, value); err != nil {\n\t\t\treturn err\n\t\t}\n\tcase \"agent_timeout\":\n\t\t// agent_timeout is the one duration knob where \"0s\" is a\n\t\t// meaningful persisted value (it explicitly disables the","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_config.go#L178-L214","documentation":"applyConfigSet parses the poll_interval value with time.ParseDuration, which requires Go duration syntax: a number with a unit suffix (s, ms, m, h). Bare numbers ('10'), wrong units ('10 seconds'), and unrecognized suffixes all fail here. The value is validated at set-time so a bad duration is never persisted.","triggerScenarios":"`multica config set poll_interval 10` (no unit), `... 10sec`, `... 500`, or `... 1m30` (missing unit on the seconds part).","commonSituations":"Users used to seconds-by-default configs (e.g. YAML 'interval: 30'); copying '500ms' style from docs but editing to '500'; European decimal commas ('0,5s').","solutions":["Add a unit suffix: `multica config set poll_interval 10s` (or 500ms, 1m).","Check for hidden characters/commas if a seemingly valid value still fails.","To clear the persisted value, pass an empty string: `multica config set poll_interval \"\"`."],"exampleFix":"# before\nmultica config set poll_interval 30\n# after\nmultica config set poll_interval 30s","handlingStrategy":"validation","validationCode":"# validate Go duration syntax before config set\n[[ \"$VAL\" =~ ^[0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h)+$ ]] || { echo \"bad duration: $VAL\" >&2; exit 2; }\nmultica config set poll_interval \"$VAL\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always write durations with an explicit unit (30s, 500ms, 1m).","In wrappers, normalize inputs with a small toDuration helper that appends 's' to bare numbers before passing them on."],"tags":["cli","config","duration","validation","go"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}