{"record":{"id":"b551363c681b7302","repo":"goharbor/harbor","slug":"precondition-b55136","errorCode":"PRECONDITION","errorMessage":"execution %d under the policy %s is running, stop it and retry","messagePattern":"execution (.+?) under the policy (.+?) is running, stop it and retry","errorType":"error_code","errorClass":"*errors.Error","httpStatus":412,"severity":"error","filePath":"src/server/v2.0/handler/preheat.go","lineNumber":361,"sourceCode":"\tdetectRunningExecutions := func(executions []*task.Execution) error {\n\t\tfor _, exec := range executions {\n\t\t\tif exec.Status == job.RunningStatus.String() {\n\t\t\t\treturn fmt.Errorf(\"execution %d under the policy %s is running, stop it and retry\", exec.ID, policy.Name)\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n\texecutions, err := api.executionCtl.List(ctx, &q.Query{Keywords: map[string]any{\n\t\t\"vendor_type\": job.P2PPreheatVendorType,\n\t\t\"vendor_id\":   policy.ID,\n\t}})\n\tif err != nil {\n\t\treturn api.SendError(ctx, err)\n\t}\n\n\t// Detecting running tasks under the policy\n\tif err = detectRunningExecutions(executions); err != nil {\n\t\treturn api.SendError(ctx, errors.New(err).WithCode(errors.PreconditionCode))\n\t}\n\n\terr = api.preheatCtl.DeletePolicy(ctx, policy.ID)\n\tif err != nil {\n\t\treturn api.SendError(ctx, err)\n\t}\n\n\treturn operation.NewDeletePolicyOK()\n}\n\n// ListPolicies is List preheat policies\nfunc (api *preheatAPI) ListPolicies(ctx context.Context, params operation.ListPoliciesParams) middleware.Responder {\n\tif err := api.RequireProjectAccess(ctx, params.ProjectName, rbac.ActionList, rbac.ResourcePreatPolicy); err != nil {\n\t\treturn api.SendError(ctx, err)\n\t}\n\n\tproject, err := api.projectCtl.GetByName(ctx, params.ProjectName)\n\tif err != nil {","sourceCodeStart":343,"sourceCodeEnd":379,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/server/v2.0/handler/preheat.go#L343-L379","documentation":"Error \"execution %d under the policy %s is running, stop it and retry\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/server/v2.0/handler/preheat.go:361 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"}