kubernetes/kops · error
creating front-end for load-balancer
Error message
creating front-end for load-balancer %s: %w
What it means
kOps wraps failures from `lbService.CreateFrontend` when no matching front-end exists and one must be created (LBID, name, inbound port, default backend) in RenderScw of LoadBalancerFrontend. The underlying error is from the Scaleway LB Zoned API.
Solutions
- Rerun `kops update cluster` once the LB is in ready state
- Check for an existing front-end with the same name/port on the LB in the Scaleway console
- Validate InboundPort and LBID values before creation
- Verify credentials and LB quotas for the project/zone
- Inspect the wrapped scw error code to distinguish conflict vs validation vs auth
Example fix
// before: create immediately
frontendCreated, err := lbService.CreateFrontend(req)
// after: wait for LB ready first
if _, err := lbService.WaitForLb(&lb.ZonedAPIWaitForLBRequest{LBID: lbID, Zone: zone}); err != nil {
return fmt.Errorf("waiting for load-balancer before frontend creation: %w", err)
}
frontendCreated, err := lbService.CreateFrontend(req) Defensive patterns
Strategy: validation
Validate before calling
// pre-create checks
lbs, err := lbService.ListLBs(&lb.ZonedAPIListLBsRequest{Zone: zone, Name: lbName}, scw.WithAllPages())
if err != nil || lbs.TotalCount != 1 { return fmt.Errorf("LB %s not ready in %s", lbName, zone) }
port := fi.ValueOf(expected.InboundPort)
if port < 1 || port > 65535 { return fmt.Errorf("invalid inbound port %d", port) }
if fi.ValueOf(expected.LBBackend.ID) == "" { return errors.New("cannot create frontend without backend") } Try / catch
var serr *scw.ResponseError
if errors.As(err, &serr) && serr.Status == 409 {
// conflicting frontend name/port: re-run Find and take update path
} Prevention
- Create back-ends before front-ends on a new LB
- Use unique front-end names per LB
- Ensure the LB is in ready state before adding front-ends
- Check per-zone LB quotas
When it happens
Trigger: RenderScw's else branch calls CreateFrontend with Zone, LBID, Name, InboundPort, BackendID; the API rejects — LBID invalid or LB not ready, name conflict, invalid port, quota, or auth failure.
Common situations: Front-end name conflicts with an existing front-end on the same LB; creating frontend before the LB finished provisioning; invalid port from cluster spec; expired credentials.
Related errors
- updating front-end for load-balancer
- creating back-end for load-balancer
- deleting load-balancer
- getting cluster servers for load-balancer's back-end
- getting load-balancer
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/bfb06939e48dc972.
Report an issue: GitHub.
Appendix: source
Thrown at upup/pkg/fi/cloudup/scalewaytasks/lb_frontend.go:157
Name: fi.ValueOf(actual.Name),
InboundPort: fi.ValueOf(expected.InboundPort),
BackendID: fi.ValueOf(actual.LBBackend.ID),
})
if err != nil {
return fmt.Errorf("updating front-end for load-balancer %s: %w", fi.ValueOf(actual.LoadBalancer.Name), err)
}
} else {
frontendCreated, err := lbService.CreateFrontend(&lb.ZonedAPICreateFrontendRequest{
Zone: scw.Zone(fi.ValueOf(expected.Zone)),
LBID: fi.ValueOf(expected.LoadBalancer.LBID),
Name: fi.ValueOf(expected.Name),
InboundPort: fi.ValueOf(expected.InboundPort),
BackendID: fi.ValueOf(expected.LBBackend.ID),
})
if err != nil {
return fmt.Errorf("creating front-end for load-balancer %s: %w", fi.ValueOf(expected.LoadBalancer.Name), err)
}
expected.ID = &frontendCreated.ID
}
_, err := lbService.WaitForLb(&lb.ZonedAPIWaitForLBRequest{
LBID: fi.ValueOf(expected.LoadBalancer.LBID),
Zone: scw.Zone(fi.ValueOf(expected.Zone)),
})
if err != nil {
return fmt.Errorf("waiting for load-balancer %s: %w", fi.ValueOf(expected.LoadBalancer.Name), err)
}
return nil
}
type terraformLBFrontend struct {View on GitHub (pinned to 4c8573c808)