{"record":{"id":"88e1e439f86e5554","repo":"goharbor/harbor","slug":"bad-request-88e1e4","errorCode":"BAD_REQUEST","errorMessage":"the immutable_rule_id doesn't match the id in the payload body of ImmutableRule","messagePattern":"the immutable_rule_id doesn't match the id in the payload body of ImmutableRule","errorType":"validation","errorClass":"BadRequestError","httpStatus":400,"severity":"error","filePath":"src/server/v2.0/handler/immutable.go","lineNumber":99,"sourceCode":"\tprojectID, err := ia.getProjectID(ctx, projectNameOrID)\n\tif err != nil {\n\t\treturn ia.SendError(ctx, err)\n\t}\n\n\tif err := ia.requireRuleAccess(ctx, projectID, params.ImmutableRuleID); err != nil {\n\t\treturn ia.SendError(ctx, err)\n\t}\n\n\tif err := ia.immuCtl.DeleteImmutableRule(ctx, params.ImmutableRuleID); err != nil {\n\t\treturn ia.SendError(ctx, err)\n\t}\n\n\treturn operation.NewDeleteImmuRuleOK()\n}\n\nfunc (ia *immutableAPI) UpdateImmuRule(ctx context.Context, params operation.UpdateImmuRuleParams) middleware.Responder {\n\tif params.ImmutableRuleID != params.ImmutableRule.ID {\n\t\treturn ia.SendError(ctx, errors.BadRequestError(fmt.Errorf(\"the immutable_rule_id doesn't match the id in the payload body of ImmutableRule\")))\n\t}\n\tprojectNameOrID := parseProjectNameOrID(params.ProjectNameOrID, params.XIsResourceName)\n\tif err := ia.RequireProjectAccess(ctx, projectNameOrID, rbac.ActionUpdate, rbac.ResourceImmutableTag); err != nil {\n\t\treturn ia.SendError(ctx, err)\n\t}\n\n\tmetadata := model.Metadata{}\n\tif err := lib.JSONCopy(&metadata, params.ImmutableRule); err != nil {\n\t\tlog.Warningf(\"failed to call JSONCopy into Metadata of the immutable rule when UpdateImmuRule, error: %v\", err)\n\t}\n\n\tprojectID, err := ia.getProjectID(ctx, projectNameOrID)\n\tif err != nil {\n\t\treturn ia.SendError(ctx, err)\n\t}\n\tmetadata.ProjectID = projectID\n\n\tif err = ia.requireRuleAccess(ctx, projectID, metadata.ID); err != nil {","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/server/v2.0/handler/immutable.go#L81-L117","documentation":"Error \"the immutable_rule_id doesn't match the id in the payload body of ImmutableRule\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/server/v2.0/handler/immutable.go:99 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"}