{"record":{"id":"6da14ed02072c5f2","repo":"goharbor/harbor","slug":"the-1st-field-indicating-seconds-of-time-of-the","errorCode":null,"errorMessage":"the 1st field (indicating Seconds of time) of the cron setting must be 0","messagePattern":"the 1st field \\(indicating Seconds of time\\) of the cron setting must be 0","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"error","filePath":"src/common/utils/utils.go","lineNumber":310,"sourceCode":"}\n\n// CronParser returns the parser of cron string with format of \"* * * * * *\"\nfunc CronParser() cronlib.Parser {\n\treturn cronlib.NewParser(cronlib.Second | cronlib.Minute | cronlib.Hour | cronlib.Dom | cronlib.Month | cronlib.Dow)\n}\n\n// ValidateCronString check whether it is a valid cron string and whether the 1st field (indicating Seconds of time) of the cron string is a fixed value of 0 or not\nfunc ValidateCronString(cron string) error {\n\tif len(cron) == 0 {\n\t\treturn fmt.Errorf(\"empty cron string is invalid\")\n\t}\n\t_, err := CronParser().Parse(cron)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcronParts := strings.Split(cron, \" \")\n\tif len(cronParts) == 6 && cronParts[0] != \"0\" {\n\t\treturn fmt.Errorf(\"the 1st field (indicating Seconds of time) of the cron setting must be 0\")\n\t}\n\treturn nil\n}\n\n// IsLocalPath checks if path is local, includes the empty path\nfunc IsLocalPath(path string) bool {\n\treturn len(path) == 0 || (strings.HasPrefix(path, \"/\") && !strings.HasPrefix(path, \"//\"))\n}\n","sourceCodeStart":292,"sourceCodeEnd":319,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/common/utils/utils.go#L292-L319","documentation":"Error \"the 1st field (indicating Seconds of time) of the cron setting must be 0\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/common/utils/utils.go:310 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}