{"record":{"id":"a7e8ddf0822673a2","repo":"rancher/rancher","slug":"the-object-has-been-modified-please-apply-your-ch-a7e8dd","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/store.go","lineNumber":1633,"sourceCode":"\t// single-condition upsert was introduced.\n\tif c := meta.FindStatusCondition(newKubeconfig.Status.Conditions, UpdatedCond); c != nil {\n\t\tc.LastTransitionTime = metav1.NewTime(time.Now())\n\t}\n\n\t// Note: [Store.toConfigMap] takes care of enforcing [KindLabel] label and [UIDAnnotation] annotation.\n\tnewConfigMap, err := s.toConfigMap(newKubeconfig)\n\tif err != nil {\n\t\treturn nil, false, apierrors.NewInternalError(fmt.Errorf(\"error converting kubeconfig %s to configmap: %v\", name, err))\n\t}\n\n\tdryRun := options != nil && len(options.DryRun) > 0\n\n\t// Enforce the client's resourceVersion precondition even on dry-run, so a\n\t// preview predicts the real conflict outcome.\n\tif newKubeconfig.ResourceVersion != \"\" &&\n\t\tnewKubeconfig.ResourceVersion != oldKubeconfig.ResourceVersion {\n\t\treturn nil, false, apierrors.NewConflict(gvr.GroupResource(), name,\n\t\t\terrors.New(genericregistry.OptimisticLockErrorMsg))\n\t}\n\n\tif !dryRun {\n\t\tnewConfigMap, err = s.configMapClient.Update(newConfigMap)\n\t\tif err != nil {\n\t\t\treturn nil, false, mapBackingError(err, name)\n\t\t}\n\t}\n\n\tnewKubeconfig, err = s.fromConfigMap(newConfigMap)\n\tif err != nil {\n\t\treturn nil, false, apierrors.NewInternalError(fmt.Errorf(\"error converting configmap %s to kubeconfig: %v\", name, err))\n\t}\n\n\treturn newKubeconfig, false, nil\n}\n\n// GetSingularName implements [rest.SingularNameProvider].","sourceCodeStart":1615,"sourceCodeEnd":1651,"githubUrl":"https://github.com/rancher/rancher/blob/932558d4e68565aff2d2f36e89ec4a391b06e7c5/pkg/ext/stores/kubeconfig/store.go#L1615-L1651","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/store.go:1633 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"}