kubernetes/kops · error

network %q not found

Error message

network %q not found

What it means

When Neutron answers successfully but no network matches cluster.Spec.Networking.NetworkID, FindVPCInfo returns nil and kOps returns "network %q not found". This cleanly separates "the network ID is wrong" from "the API call failed" so the user knows to fix the network identifier.

Source

Thrown at upup/pkg/fi/cloudup/new_cluster.go:948

		res[subnet.Zone] = subnetID
	}
	return res, nil
}

func getOpenstackZoneToSubnetProviderID(cluster *api.Cluster, zones []string, subnetIDs []string) (map[string]string, error) {
	res := make(map[string]string)
	osCloud, err := openstack.NewOpenstackCloud(cluster, "new-cluster-zone-to-subnet")
	if err != nil {
		return res, fmt.Errorf("error loading cloud: %v", err)
	}
	osCloud.UseZones(zones)

	networkInfo, err := osCloud.FindVPCInfo(cluster.Spec.Networking.NetworkID)
	if err != nil {
		return res, fmt.Errorf("error describing Network: %v", err)
	}
	if networkInfo == nil {
		return res, fmt.Errorf("network %q not found", cluster.Spec.Networking.NetworkID)
	}

	subnetByID := make(map[string]*fi.SubnetInfo)
	for _, subnetInfo := range networkInfo.Subnets {
		subnetByID[subnetInfo.ID] = subnetInfo
	}

	for _, subnetID := range subnetIDs {
		subnet, ok := subnetByID[subnetID]
		if !ok {
			return res, fmt.Errorf("subnet %s not found in network %s", subnetID, cluster.Spec.Networking.NetworkID)
		}

		if res[subnet.Zone] != "" {
			return res, fmt.Errorf("subnet %s and %s have the same zone", subnetID, res[subnet.Zone])
		}
		res[subnet.Zone] = subnetID
	}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Confirm the ID: `openstack network list` in the target project and copy the exact UUID for --os-network.
  2. Ensure OS_PROJECT_NAME/OS_PROJECT_ID and OS_REGION_NAME match the project/region owning the network.
  3. If the network was deleted, create/choose another and update the flag.

Example fix

// before
--os-network 0f1e2d3c-wrong-id
// after
--os-network $(openstack network show mynetwork -f value -c id)
Defensive patterns

Strategy: validation

Validate before calling

out, err := exec.Command("openstack", "network", "show", networkID, "-f", "value", "-c", "id").Output()
if err != nil || strings.TrimSpace(string(out)) != networkID {
    return fmt.Errorf("network %s not visible in current project/region", networkID)
}

Try / catch

if strings.Contains(err.Error(), "network \"") && strings.Contains(err.Error(), "not found") {
    // run `openstack network list`, pick the correct UUID, update --os-network and retry
}

Prevention

When it happens

Trigger: `kops create cluster --cloud openstack --os-network net-typo ...` with a mistyped/foreign/deleted network UUID, or a network in a different project/region than the authenticated one.

Common situations: Copying a network ID from another project's dashboard; network deleted after being written into scripts; using a router or subnet UUID by mistake instead of the network UUID; wrong OS_PROJECT_NAME selecting an empty project.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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