kubernetes/kops · error

error waiting for Subnet creation to complete: %w

Error message

error waiting for Subnet creation to complete: %w

What it means

Wrapped error from cloud.WaitForOp after a successful Subnetworks.Insert submit. The subnet-create operation failed asynchronously (or polling errored) — the subnet may not exist even though the request was accepted; the %w carries the operation-level failure.

Source

Thrown at upup/pkg/fi/cloudup/gcetasks/subnet.go:147

			Name:           *e.Name,
			Network:        e.Network.URL(project),
			StackType:      fi.ValueOf(e.StackType),
			Ipv6AccessType: fi.ValueOf(e.Ipv6AccessType),
		}

		for k, v := range e.SecondaryIpRanges {
			subnet.SecondaryIpRanges = append(subnet.SecondaryIpRanges, &compute.SubnetworkSecondaryRange{
				RangeName:   k,
				IpCidrRange: v,
			})
		}

		op, err := cloud.Compute().Subnetworks().Insert(t.Cloud.Project(), t.Cloud.Region(), subnet)
		if err != nil {
			return fmt.Errorf("error creating Subnet: %v", err)
		}
		if err := t.Cloud.WaitForOp(op); err != nil {
			return fmt.Errorf("error waiting for Subnet creation to complete: %w", err)
		}
	} else {
		if changes.SecondaryIpRanges != nil {
			// Update is split into two calls as GCE does not allow us to add and remove ranges in the same call
			if err := updateSecondaryRanges(cloud, "add", e); err != nil {
				return err
			}

			if !shared {
				if err := updateSecondaryRanges(cloud, "remove", e); err != nil {
					return err
				}
			}

			changes.SecondaryIpRanges = nil
		}

		if changes.StackType != nil {

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Inspect the operation error in the %w chain
  2. Check whether the subnet exists (gcloud compute networks subnets describe) before retrying
  3. Fix the underlying cause (overlap, quota) and re-run the apply
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at upup/pkg/fi/cloudup/gcetasks/subnet.go:147 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/5d6e0c89b48cfef0. Report an issue: GitHub.