rancher/rancher · error · apierrors.StatusError

the object has been modified; please apply your changes to t

Error message

the object has been modified; please apply your changes to the latest version and try again

What it means

Error "the object has been modified; please apply your changes to the latest version and try again" thrown in rancher/rancher.

Source

Thrown at pkg/ext/stores/kubeconfig/errors.go:40

	}
	return status.Status().Details
}

// mapBackingError re-scopes an error from a backing object (ConfigMap or token)
// to the Kubeconfig GroupResource, preserving the apierrors classification so
// clients see 404/409/403/422 instead of an opaque 500. Every branch rebuilds
// the error: a backing error passed through verbatim would leak the backing
// resource's identity in its details and message. Unexpected errors are logged
// at Error level; client-side errors (Invalid, BadRequest) at Warn level.
func mapBackingError(err error, resource string) error {
	switch {
	case err == nil:
		return nil
	case apierrors.IsNotFound(err):
		return apierrors.NewNotFound(gvr.GroupResource(), resource)
	case apierrors.IsConflict(err):
		return apierrors.NewConflict(gvr.GroupResource(), resource,
			errors.New(registry.OptimisticLockErrorMsg))
	case apierrors.IsAlreadyExists(err):
		return apierrors.NewAlreadyExists(gvr.GroupResource(), resource)
	case apierrors.IsForbidden(err):
		rebuilt := apierrors.NewForbidden(gvr.GroupResource(), resource, errors.New("backing store denied the request"))
		if details := statusDetails(err); details != nil && len(details.Causes) > 0 {
			rebuilt.ErrStatus.Details.Causes = details.Causes
		}
		return rebuilt
	case apierrors.IsInvalid(err):
		logrus.Warnf("invalid backing object for kubeconfig %s: %v", resource, err)
		var errs field.ErrorList
		if details := statusDetails(err); details != nil {
			for _, c := range details.Causes {
				errs = append(errs, &field.Error{
					Type:   field.ErrorType(c.Type),
					Field:  c.Field,
					Detail: c.Message,
				})

View on GitHub (pinned to 932558d4e6)

When it happens

Trigger: Thrown at pkg/ext/stores/kubeconfig/errors.go:40 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of rancher/rancher@932558d4e6 (2026-08-16). Data as JSON: /api/errors/c90b6446c3f5fd8a. Report an issue: GitHub.