{"record":{"id":"c90b6446c3f5fd8a","repo":"rancher/rancher","slug":"the-object-has-been-modified-please-apply-your-ch","errorCode":null,"errorMessage":"the object has been modified; please apply your changes to the latest version and try again","messagePattern":"the object has been modified; please apply your changes to the latest version and try again","errorType":"http","errorClass":"apierrors.StatusError","httpStatus":409,"severity":"error","filePath":"pkg/ext/stores/kubeconfig/errors.go","lineNumber":40,"sourceCode":"\t}\n\treturn status.Status().Details\n}\n\n// mapBackingError re-scopes an error from a backing object (ConfigMap or token)\n// to the Kubeconfig GroupResource, preserving the apierrors classification so\n// clients see 404/409/403/422 instead of an opaque 500. Every branch rebuilds\n// the error: a backing error passed through verbatim would leak the backing\n// resource's identity in its details and message. Unexpected errors are logged\n// at Error level; client-side errors (Invalid, BadRequest) at Warn level.\nfunc mapBackingError(err error, resource string) error {\n\tswitch {\n\tcase err == nil:\n\t\treturn nil\n\tcase apierrors.IsNotFound(err):\n\t\treturn apierrors.NewNotFound(gvr.GroupResource(), resource)\n\tcase apierrors.IsConflict(err):\n\t\treturn apierrors.NewConflict(gvr.GroupResource(), resource,\n\t\t\terrors.New(registry.OptimisticLockErrorMsg))\n\tcase apierrors.IsAlreadyExists(err):\n\t\treturn apierrors.NewAlreadyExists(gvr.GroupResource(), resource)\n\tcase apierrors.IsForbidden(err):\n\t\trebuilt := apierrors.NewForbidden(gvr.GroupResource(), resource, errors.New(\"backing store denied the request\"))\n\t\tif details := statusDetails(err); details != nil && len(details.Causes) > 0 {\n\t\t\trebuilt.ErrStatus.Details.Causes = details.Causes\n\t\t}\n\t\treturn rebuilt\n\tcase apierrors.IsInvalid(err):\n\t\tlogrus.Warnf(\"invalid backing object for kubeconfig %s: %v\", resource, err)\n\t\tvar errs field.ErrorList\n\t\tif details := statusDetails(err); details != nil {\n\t\t\tfor _, c := range details.Causes {\n\t\t\t\terrs = append(errs, &field.Error{\n\t\t\t\t\tType:   field.ErrorType(c.Type),\n\t\t\t\t\tField:  c.Field,\n\t\t\t\t\tDetail: c.Message,\n\t\t\t\t})","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/rancher/rancher/blob/932558d4e68565aff2d2f36e89ec4a391b06e7c5/pkg/ext/stores/kubeconfig/errors.go#L22-L58","documentation":"Error \"the object has been modified; please apply your changes to the latest version and try again\" thrown in rancher/rancher.","triggerScenarios":"Thrown at pkg/ext/stores/kubeconfig/errors.go:40 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":"932558d4e68565aff2d2f36e89ec4a391b06e7c5","analyzedAt":"2026-08-16T04:37:02.125Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}