{"record":{"id":"dd69432b4ed21089","repo":"goharbor/harbor","slug":"no-such-retention-policy-with-id-v","errorCode":null,"errorMessage":"no such Retention policy with id %v","messagePattern":"no such Retention policy with id (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/retention/manager.go","lineNumber":91,"sourceCode":"\tp.ID = 0\n\tdata, _ := json.Marshal(p)\n\tp.ID = p1.ID\n\tp1.Data = string(data)\n\tp1.UpdateTime = time.Now()\n\treturn dao.UpdatePolicy(ctx, p1, \"scope_level\", \"trigger_kind\", \"data\", \"update_time\")\n}\n\n// DeletePolicy Delete Policy\nfunc (d *DefaultManager) DeletePolicy(ctx context.Context, id int64) error {\n\treturn dao.DeletePolicy(ctx, id)\n}\n\n// GetPolicy Get Policy\nfunc (d *DefaultManager) GetPolicy(ctx context.Context, id int64) (*policy.Metadata, error) {\n\tp1, err := dao.GetPolicy(ctx, id)\n\tif err != nil {\n\t\tif err == orm.ErrNoRows {\n\t\t\treturn nil, fmt.Errorf(\"no such Retention policy with id %v\", id)\n\t\t}\n\t\treturn nil, err\n\t}\n\tp := &policy.Metadata{}\n\tif err = json.Unmarshal([]byte(p1.Data), p); err != nil {\n\t\treturn nil, err\n\t}\n\tp.ID = id\n\tif p.Trigger.Kind == policy.TriggerKindSchedule {\n\t\tcron, ok := p.Trigger.Settings[policy.TriggerSettingsCron]\n\t\tif ok {\n\t\t\tif cronStr, isStr := cron.(string); isStr && len(cronStr) > 0 {\n\t\t\t\tp.Trigger.Settings[policy.TriggerSettingNextScheduledTime] = strfmt.DateTime(utils.NextSchedule(cronStr, time.Now()))\n\t\t\t}\n\t\t}\n\t}\n\treturn p, nil\n}","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/retention/manager.go#L73-L109","documentation":"Error \"no such Retention policy with id %v\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/pkg/retention/manager.go:91 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"}