{"record":{"id":"976d35e853ae853f","repo":"goharbor/harbor","slug":"precondition-976d35","errorCode":"PRECONDITION","errorMessage":"the execution %d has tasks that aren't in final status, stop the tasks first","messagePattern":"the execution (.+?) has tasks that aren't in final status, stop the tasks first","errorType":"http","errorClass":"errors.Error","httpStatus":412,"severity":"error","filePath":"src/pkg/task/execution.go","lineNumber":278,"sourceCode":"\tif origError != nil {\n\t\treturn e.MarkError(ctx, id, origError.Error())\n\t}\n\treturn nil\n}\n\nfunc (e *executionManager) Delete(ctx context.Context, id int64) error {\n\ttasks, err := e.taskDAO.List(ctx, &q.Query{\n\t\tKeywords: map[string]any{\n\t\t\t\"ExecutionID\": id,\n\t\t},\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor _, task := range tasks {\n\t\tif !job.Status(task.Status).Final() {\n\t\t\treturn errors.New(nil).WithCode(errors.PreconditionCode).\n\t\t\t\tWithMessagef(\"the execution %d has tasks that aren't in final status, stop the tasks first\", id)\n\t\t}\n\n\t\tlog.Debugf(\"delete task %d as execution %d has been deleted\", task.ID, task.ExecutionID)\n\t\tif err = e.taskDAO.Delete(ctx, task.ID); err != nil {\n\t\t\t// the tasks may be deleted by the other execution deletion operation in the same time(e.g. execution sweeper),\n\t\t\t// ignore the not found error for the tasks\n\t\t\tif errors.IsNotFoundErr(err) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn e.executionDAO.Delete(ctx, id)\n}\n\nfunc (e *executionManager) DeleteByVendor(ctx context.Context, vendorType string, vendorID int64) error {","sourceCodeStart":260,"sourceCodeEnd":296,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/task/execution.go#L260-L296","documentation":"Error \"the execution %d has tasks that aren't in final status, stop the tasks first\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/pkg/task/execution.go:278 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"}