{"record":{"id":"0a420725667e92c6","repo":"goharbor/harbor","slug":"bad-request-0a4207","errorCode":"BAD_REQUEST","errorMessage":"invalid cron %s: %v","messagePattern":"invalid cron (.+?): (.+?)","errorType":"validation","errorClass":"errors.Error","httpStatus":400,"severity":"error","filePath":"src/pkg/scheduler/scheduler.go","lineNumber":101,"sourceCode":"}\n\ntype scheduler struct {\n\tdao     DAO\n\texecMgr task.ExecutionManager\n\ttaskMgr task.Manager\n}\n\nfunc (s *scheduler) CountSchedules(ctx context.Context, query *q.Query) (int64, error) {\n\treturn s.dao.Count(ctx, query)\n}\n\nfunc (s *scheduler) Schedule(ctx context.Context, vendorType string, vendorID int64, cronType string,\n\tcron string, callbackFuncName string, callbackFuncParams any, extraAttrs map[string]any) (int64, error) {\n\tif len(vendorType) == 0 {\n\t\treturn 0, fmt.Errorf(\"empty vendor type\")\n\t}\n\tif _, err := utils.CronParser().Parse(cron); err != nil {\n\t\treturn 0, errors.New(nil).WithCode(errors.BadRequestCode).\n\t\t\tWithMessagef(\"invalid cron %s: %v\", cron, err)\n\t}\n\tif !callbackFuncExist(callbackFuncName) {\n\t\treturn 0, fmt.Errorf(\"callback function %s not found\", callbackFuncName)\n\t}\n\n\tnow := time.Now()\n\tsched := &schedule{\n\t\tVendorType:       vendorType,\n\t\tVendorID:         vendorID,\n\t\tCRONType:         cronType,\n\t\tCRON:             cron,\n\t\tCallbackFuncName: callbackFuncName,\n\t\tCreationTime:     now,\n\t\tUpdateTime:       now,\n\t}\n\n\tparamsData, err := json.Marshal(callbackFuncParams)","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/scheduler/scheduler.go#L83-L119","documentation":"Error \"invalid cron %s: %v\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/pkg/scheduler/scheduler.go:101 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"}