{"record":{"id":"77157662ff0ffc9d","repo":"kubernetes/kubernetes","slug":"duration-time-must-be-greater-than-one-second-as-s","errorCode":null,"errorMessage":"duration time must be greater than one second as set via command line option reconcile-sync-loop-period","messagePattern":"duration time must be greater than one second as set via command line option reconcile-sync-loop-period","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kube-controller-manager/app/options/attachdetachcontroller.go","lineNumber":65,"sourceCode":"\t}\n\n\tcfg.DisableAttachDetachReconcilerSync = o.DisableAttachDetachReconcilerSync\n\tcfg.ReconcilerSyncLoopPeriod = o.ReconcilerSyncLoopPeriod\n\tcfg.DisableForceDetachOnTimeout = o.DisableForceDetachOnTimeout\n\n\treturn nil\n}\n\n// Validate checks validation of AttachDetachControllerOptions.\nfunc (o *AttachDetachControllerOptions) Validate() []error {\n\tif o == nil {\n\t\treturn nil\n\t}\n\n\terrs := []error{}\n\n\tif o.ReconcilerSyncLoopPeriod.Duration < time.Second {\n\t\terrs = append(errs, fmt.Errorf(\"duration time must be greater than one second as set via command line option reconcile-sync-loop-period\"))\n\t}\n\n\treturn errs\n}\n","sourceCodeStart":47,"sourceCodeEnd":70,"githubUrl":"https://github.com/kubernetes/kubernetes/blob/b882c60b4023bdf09264c2d5d30a2cadebc240fb/cmd/kube-controller-manager/app/options/attachdetachcontroller.go#L47-L70","documentation":"Validation error from AttachDetachControllerOptions.Validate() when the --attach-detach-reconcile-sync-period flag is set to a duration less than one second. The attach-detach controller periodically reconciles volume attach/detach state against pods; a sub-second period would cause excessive reconcile loops and is rejected at startup. The check compares o.ReconcilerSyncLoopPeriod.Duration against time.Second.","triggerScenarios":"Starting kube-controller-manager with --attach-detach-reconcile-sync-period set to a value < 1s (e.g. 500ms, 0s, or a negative duration). The Validate() method runs during options validation before any controller starts.","commonSituations":"Operator sets the sync period too low trying to speed up volume reconciliation; a config file or Helm chart injects a small duration value; unit confusion (passing a bare integer interpreted as nanoseconds); typo where the value is omitted and defaults to zero.","solutions":["Set --attach-detach-reconcile-sync-period to at least 1s (default is typically 60s for production stability).","Use explicit time units in the flag value, e.g. --attach-detach-reconcile-sync-period=1m or =30s.","If loading from a config file, verify the ReconcilerSyncLoopPeriod field parses as a valid Go duration >= 1s.","Remove the flag entirely to accept the default, which always passes validation."],"exampleFix":"# before\nkube-controller-manager --attach-detach-reconcile-sync-period=500ms\n\n# after\nkube-controller-manager --attach-detach-reconcile-sync-period=60s","handlingStrategy":"validation","validationCode":"// Validate the reconcile sync period before passing it to the controller manager options:\nif o.ReconcilerSyncLoopPeriod.Duration < time.Second {\n    return fmt.Errorf(\"attach-detach-reconcile-sync-period must be >= 1s, got %v\", o.ReconcilerSyncLoopPeriod.Duration)\n}\n// Accept the value only after this passes.","typeGuard":"func isValidReconcileSyncPeriod(d time.Duration) bool {\n    return d >= time.Second\n}","tryCatchPattern":null,"preventionTips":["Always use explicit time units (e.g. 60s, 1m) in flag values rather than bare numbers.","Validate durations in deployment automation (Ansible, Helm, kubeadm) before applying."],"tags":["kubernetes","kube-controller-manager","storage","attach-detach","configuration","flags","validation"],"analyzedSha":"b882c60b4023bdf09264c2d5d30a2cadebc240fb","analyzedAt":"2026-08-07T04:07:48.144Z","schemaVersion":2},"datasetVersion":"2026-08-07T07:17:06.508Z"}