{"record":{"id":"bc3080bcdb5e3bb0","repo":"goharbor/harbor","slug":"bad-request-bc3080","errorCode":"BAD_REQUEST","errorMessage":"the retention_id in the request's payload when updating a project should be omitted, alternatively passing the one that has already been associated to this project","messagePattern":"the retention_id in the request's payload when updating a project should be omitted, alternatively passing the one that has already been associated to this project","errorType":"validation","errorClass":"*errors.Error","httpStatus":400,"severity":"error","filePath":"src/server/v2.0/handler/project.go","lineNumber":601,"sourceCode":"\tif params.Project.Metadata != nil && p.IsProxy() {\n\t\tparams.Project.Metadata.EnableContentTrust = nil\n\t\tif err := validateProxyCacheRepositoryFilter(params.Project.Metadata); err != nil {\n\t\t\treturn a.SendError(ctx, err)\n\t\t}\n\t}\n\tif err := lib.JSONCopy(&p.Metadata, params.Project.Metadata); err != nil {\n\t\tlog.Warningf(\"failed to call JSONCopy on project metadata when UpdateProject, error: %v\", err)\n\t}\n\n\t// validate retention_id\n\tif ridParam, ok := p.Metadata[\"retention_id\"]; ok {\n\t\tmd, err := a.metadataMgr.Get(ctx, p.ProjectID)\n\t\tif err != nil {\n\t\t\treturn a.SendError(ctx, err)\n\t\t}\n\t\tif rid, ok := md[\"retention_id\"]; !ok || rid != ridParam {\n\t\t\terrMsg := \"the retention_id in the request's payload when updating a project should be omitted, alternatively passing the one that has already been associated to this project\"\n\t\t\treturn a.SendError(ctx, errors.New(nil).WithMessage(errMsg).WithCode(errors.BadRequestCode))\n\t\t}\n\t}\n\n\tif err := a.projectCtl.Update(ctx, p); err != nil {\n\t\treturn a.SendError(ctx, err)\n\t}\n\n\treturn operation.NewUpdateProjectOK()\n}\n\nfunc (a *projectAPI) GetScannerOfProject(ctx context.Context, params operation.GetScannerOfProjectParams) middleware.Responder {\n\tif err := a.RequireAuthenticated(ctx); err != nil {\n\t\treturn a.SendError(ctx, err)\n\t}\n\n\tprojectNameOrID := parseProjectNameOrID(params.ProjectNameOrID, params.XIsResourceName)\n\tif err := a.RequireProjectAccess(ctx, projectNameOrID, rbac.ActionRead, rbac.ResourceScanner); err != nil {\n\t\treturn a.SendError(ctx, err)","sourceCodeStart":583,"sourceCodeEnd":619,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/server/v2.0/handler/project.go#L583-L619","documentation":"Error \"the retention_id in the request's payload when updating a project should be omitted, alternatively passing the one that has already been associated to this project\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/server/v2.0/handler/project.go:601 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"}