kubernetes/kops · error

subnet with id %q not found

Error message

subnet with id %q not found

What it means

The subnet is marked shared (externally managed), so kOps will not create it, but the find phase returned no match — the referenced subnet ID does not exist or is not visible with the configured credentials/VPC.

Source

Thrown at upup/pkg/fi/cloudup/awstasks/subnet.go:242

	return nil
}

func (_ *Subnet) ShouldCreate(a, e, changes *Subnet) (bool, error) {
	if fi.ValueOf(e.Shared) {
		changes.ResourceBasedNaming = nil
		return changes.Tags != nil, nil
	}
	return true, nil
}

func (_ *Subnet) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *Subnet) error {
	ctx := context.TODO()
	shared := fi.ValueOf(e.Shared)
	if shared {
		// Verify the subnet was found
		if a == nil {
			return fmt.Errorf("subnet with id %q not found", fi.ValueOf(e.ID))
		}
	}

	if strings.HasPrefix(aws.ToString(e.IPv6CIDR), "/") {
		vpcIPv6CIDR := e.VPC.IPv6CIDR
		if vpcIPv6CIDR == nil {
			cidr, err := findVPCIPv6CIDR(t.Cloud, e.VPC.ID)
			if err != nil {
				return err
			}
			if cidr == nil {
				return fi.NewTryAgainLaterError("waiting for the VPC IPv6 CIDR to be assigned")
			}
			vpcIPv6CIDR = cidr
		}

		subnetIPv6CIDR, err := calculateSubnetCIDR(vpcIPv6CIDR, e.IPv6CIDR)
		if err != nil {

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Verify the subnet id exists in the right account/VPC and region
  2. Check the AWS credentials kOps uses can see the shared subnet
  3. Fix the id in the cluster spec or stop marking the subnet as shared
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at upup/pkg/fi/cloudup/awstasks/subnet.go:242 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/910235326f1162b0. Report an issue: GitHub.