kubernetes/kops · error

cannot apply changes to backend service: %v

Error message

cannot apply changes to backend service: %v

What it means

Returned from BackendService.RenderGCE when the backend service already exists (a != nil). The task implements no update path — any diff between actual and expected is reported as unappliable via this error.

Source

Thrown at upup/pkg/fi/cloudup/gcetasks/backend_service.go:138

		Protocol:            *e.Protocol,
		HealthChecks:        hcs,
		LoadBalancingScheme: *e.LoadBalancingScheme,
		Backends:            backends,
	}

	if a == nil {
		klog.V(2).Infof("Creating BackendService: %q", bs.Name)

		op, err := cloud.Compute().RegionBackendServices().Insert(cloud.Project(), cloud.Region(), bs)
		if err != nil {
			return fmt.Errorf("error creating backend service: %v", err)
		}

		if err := cloud.WaitForOp(op); err != nil {
			return fmt.Errorf("error waiting for backend service: %v", err)
		}
	} else {
		return fmt.Errorf("cannot apply changes to backend service: %v", changes)
	}

	return nil
}

func (a *BackendService) URL(cloud gce.GCECloud) string {
	return fmt.Sprintf("https://www.googleapis.com/compute/v1/projects/%s/regions/%s/backendServices/%s",
		cloud.Project(),
		cloud.Region(),
		*a.Name)
}

type terraformBackend struct {
	BalancingMode *terraformWriter.Literal `cty:"balancing_mode"`
	Group         *terraformWriter.Literal `cty:"group"`
}

type terraformBackendService struct {

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Compare the printed changes against the cluster spec and reconcile the drift manually
  2. Update the kOps cluster spec to match the live backend service if it was changed intentionally
  3. Delete and let kOps recreate the backend service if managed config must win
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at upup/pkg/fi/cloudup/gcetasks/backend_service.go:138 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/4f58db2aed90754c. Report an issue: GitHub.