{"record":{"id":"4f100fe4ecb77500","repo":"goharbor/harbor","slug":"not-found-4f100f","errorCode":"NOT_FOUND","errorMessage":"retention policy is not found","messagePattern":"retention policy is not found","errorType":"http","errorClass":"errors.Error","httpStatus":404,"severity":"error","filePath":"src/server/v2.0/handler/retention.go","lineNumber":298,"sourceCode":"\teid, err := r.retentionCtl.TriggerRetentionExec(ctx, params.ID, task.ExecutionTriggerManual, params.Body.DryRun)\n\tif err != nil {\n\t\treturn r.SendError(ctx, err)\n\t}\n\n\tlocation := fmt.Sprintf(\"%s/%d\", strings.TrimSuffix(params.HTTPRequest.URL.Path, \"/\"), eid)\n\treturn operation.NewTriggerRetentionExecutionCreated().WithLocation(location)\n}\n\nfunc (r *retentionAPI) OperateRetentionExecution(ctx context.Context, params operation.OperateRetentionExecutionParams) middleware.Responder {\n\tif params.Body.Action != \"stop\" {\n\t\treturn r.SendError(ctx, errors.BadRequestError((fmt.Errorf(\"action should be 'stop'\"))))\n\t}\n\tp, err := r.retentionCtl.GetRetention(ctx, params.ID)\n\tif err != nil {\n\t\treturn r.SendError(ctx, errors.BadRequestError(err))\n\t}\n\tif p == nil {\n\t\treturn r.SendError(ctx, errors.New(\"retention policy is not found\").WithCode(errors.NotFoundCode))\n\t}\n\tif err := r.requireAccess(ctx, p, rbac.ActionUpdate); err != nil {\n\t\treturn r.SendError(ctx, err)\n\t}\n\tif err := r.requirePolicyAccess(ctx, p); err != nil {\n\t\treturn r.SendError(ctx, err)\n\t}\n\tif err := r.requireExecutionInProject(ctx, p, params.Eid); err != nil {\n\t\treturn r.SendError(ctx, err)\n\t}\n\tif err := r.retentionCtl.OperateRetentionExec(ctx, params.Eid, params.Body.Action); err != nil {\n\t\treturn r.SendError(ctx, err)\n\t}\n\treturn operation.NewOperateRetentionExecutionOK()\n}\n\nfunc (r *retentionAPI) ListRetentionExecutions(ctx context.Context, params operation.ListRetentionExecutionsParams) middleware.Responder {\n\tquery, err := r.BuildQuery(ctx, nil, nil, params.Page, params.PageSize)","sourceCodeStart":280,"sourceCodeEnd":316,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/server/v2.0/handler/retention.go#L280-L316","documentation":"Error \"retention policy is not found\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/server/v2.0/handler/retention.go:298 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"}