{"record":{"id":"46673c9daa461d00","repo":"goharbor/harbor","slug":"bad-request-46673c","errorCode":"BAD_REQUEST","errorMessage":"invalid cron string for scheduled log rotation purge: %s, error: %v","messagePattern":"invalid cron string for scheduled log rotation purge: (.+?), error: (.+?)","errorType":"validation","errorClass":"errors.Error","httpStatus":400,"severity":"error","filePath":"src/server/v2.0/handler/purge.go","lineNumber":145,"sourceCode":"\t\treturn 0, err\n\t}\n\tpolicy.RetentionHour = retHour\n\n\tswitch scheType {\n\tcase ScheduleManual:\n\t\tid, err = p.purgeCtr.Start(ctx, policy, taskPkg.ExecutionTriggerManual)\n\tcase ScheduleNone:\n\t\t// delete the schedule of purge\n\t\terr = p.schedulerCtl.Delete(ctx, vendorType)\n\tcase ScheduleHourly, ScheduleDaily, ScheduleWeekly, ScheduleCustom:\n\t\terr = p.updateSchedule(ctx, vendorType, scheType, cron, policy, parameters)\n\t}\n\treturn id, err\n}\n\nfunc (p *purgeAPI) updateSchedule(ctx context.Context, vendorType, cronType, cron string, policy pg.JobPolicy, extraParams map[string]any) error {\n\tif err := utils.ValidateCronString(cron); err != nil {\n\t\treturn errors.New(nil).WithCode(errors.BadRequestCode).\n\t\t\tWithMessagef(\"invalid cron string for scheduled log rotation purge: %s, error: %v\", cron, err)\n\t}\n\tif err := p.schedulerCtl.Delete(ctx, vendorType); err != nil {\n\t\treturn err\n\t}\n\treturn p.createSchedule(ctx, vendorType, cronType, cron, policy, extraParams)\n}\n\nfunc (p *purgeAPI) GetPurgeHistory(ctx context.Context, params purge.GetPurgeHistoryParams) middleware.Responder {\n\tif err := p.RequireSystemAccess(ctx, rbac.ActionList, rbac.ResourcePurgeAuditLog); err != nil {\n\t\treturn p.SendError(ctx, err)\n\t}\n\tquery, err := p.BuildQuery(ctx, params.Q, params.Sort, params.Page, params.PageSize)\n\tquery.Keywords[\"VendorType\"] = job.PurgeAuditVendorType\n\tif err != nil {\n\t\treturn p.SendError(ctx, err)\n\t}\n\ttotal, err := p.executionCtl.Count(ctx, query)","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/server/v2.0/handler/purge.go#L127-L163","documentation":"Error \"invalid cron string for scheduled log rotation purge: %s, error: %v\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/server/v2.0/handler/purge.go:145 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"}