kubernetes/kops · error

creating back-end for load-balancer %s: %w

Error message

creating back-end for load-balancer %s: %w

What it means

kOps wraps any failure from `lbService.CreateBackend` when no matching back-end exists and one must be created for the Scaleway load-balancer, including the backend name, health-check config, server IPs and proxy-protocol settings. The underlying error is from the Scaleway LB Zoned API. Thrown in RenderScw of the LoadBalancerBackend task.

Source

Thrown at upup/pkg/fi/cloudup/scalewaytasks/lb_backend.go:187

			Zone:                 zone,
			LBID:                 fi.ValueOf(expected.LoadBalancer.LBID),
			Name:                 fi.ValueOf(expected.Name),
			ForwardProtocol:      lb.Protocol(fi.ValueOf(expected.ForwardProtocol)),
			ForwardPort:          fi.ValueOf(expected.ForwardPort),
			ForwardPortAlgorithm: lb.ForwardPortAlgorithm(fi.ValueOf(expected.ForwardPortAlgorithm)),
			StickySessions:       lb.StickySessionsType(fi.ValueOf(expected.StickySessions)),
			HealthCheck: &lb.HealthCheck{
				CheckMaxRetries: 5,
				TCPConfig:       &lb.HealthCheckTCPConfig{},
				Port:            fi.ValueOf(expected.ForwardPort),
				CheckTimeout:    scw.TimeDurationPtr(3000),
				CheckDelay:      scw.TimeDurationPtr(1001),
			},
			ServerIP:      controlPlanesIPs,
			ProxyProtocol: lb.ProxyProtocol(fi.ValueOf(expected.ProxyProtocol)),
		})
		if err != nil {
			return fmt.Errorf("creating back-end for load-balancer %s: %w", fi.ValueOf(expected.LoadBalancer.Name), err)
		}

		expected.ID = &backendCreated.ID

	}

	_, err = lbService.WaitForLb(&lb.ZonedAPIWaitForLBRequest{
		LBID: fi.ValueOf(expected.LoadBalancer.LBID),
		Zone: zone,
	})
	if err != nil {
		return fmt.Errorf("waiting for load-balancer %s: %w", fi.ValueOf(expected.LoadBalancer.Name), err)
	}

	return nil
}

type terraformLBBackend struct {

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Rerun `kops update cluster` after the LB reaches 'ready' state
  2. Validate cluster-spec LB config (forwardPort, healthCheck settings, proxyProtocol) against Scaleway API constraints
  3. Check Scaleway console/API for LB state and quotas in the zone
  4. Verify Scaleway credentials and project has LB service enabled
  5. Inspect the wrapped SDK error (scw.StatusError) for the exact 4xx/5xx code

Example fix

// before: create immediately after LB creation
backendCreated, err := lbService.CreateBackend(req)
// after: ensure LB is ready first
if _, err := lbService.WaitForLb(&lb.ZonedAPIWaitForLBRequest{LBID: lbID, Zone: zone}); err != nil {
    return fmt.Errorf("waiting for load-balancer before backend creation: %w", err)
}
backendCreated, err := lbService.CreateBackend(req)
Defensive patterns

Strategy: validation

Validate before calling

// pre-validate backend creation inputs
name := fi.ValueOf(expected.Name)
port := fi.ValueOf(expected.ForwardPort)
if name == "" { return errors.New("backend name is empty") }
if port < 1 || port > 65535 { return fmt.Errorf("invalid forward port %d", port) }
if len(controlPlanesIPs) == 0 { return errors.New("no control-plane IPs resolved; refusing to create empty backend") }
if _, err := lbService.WaitForLb(&lb.ZonedAPIWaitForLBRequest{Zone: zone, LBID: lbID}); err != nil { return err }

Try / catch

var serr *scw.ResponseError
if errors.As(err, &serr) && serr.Status == 409 {
    // name conflict: re-run Find and switch to the update path
}

Prevention

When it happens

Trigger: RenderScw's `else` branch (no existing back-end found) calls CreateBackend with zone, name, forward-port, health-check (CheckDelay etc.), ServerIP=controlPlanesIPs and ProxyProtocol; the API rejects it (invalid health check params, name conflicts, LB not ready, quota, auth).

Common situations: Invalid proxy protocol or port config from cluster spec; LB still in creating state so backend creation fails; hitting Scaleway LB backend quotas; expired credentials; typos in zone.

Related errors


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