kubernetes/kops · error

error creating network task from cloud: %v

Error message

error creating network task from cloud: %v

What it means

After resolving the parent network, NewSubnetTaskFromCloud calls NewNetworkTaskFromCloud to build the corresponding Network task. This error wraps any failure from constructing that Network task (e.g. failure to fetch the network's router:external info or tags), so the Subnet task cannot be assembled. It is raised during Find reconciliation of subnet state.

Source

Thrown at upup/pkg/fi/cloudup/openstacktasks/subnet.go:65

		}
	}
	return deps
}

var _ fi.CompareWithID = (*Subnet)(nil)

func (s *Subnet) CompareWithID() *string {
	return s.ID
}

func NewSubnetTaskFromCloud(cloud openstack.OpenstackCloud, lifecycle fi.Lifecycle, subnet *subnets.Subnet, find *Subnet) (*Subnet, error) {
	network, err := cloud.GetNetwork(subnet.NetworkID)
	if err != nil {
		return nil, fmt.Errorf("NewSubnetTaskFromCloud: Failed to get network with ID %s: %v", subnet.NetworkID, err)
	}
	networkTask, err := NewNetworkTaskFromCloud(cloud, lifecycle, network, find.Tag)
	if err != nil {
		return nil, fmt.Errorf("error creating network task from cloud: %v", err)
	}

	nameservers := make([]*string, len(subnet.DNSNameservers))
	for i, ns := range subnet.DNSNameservers {
		nameservers[i] = new(ns)
	}

	tag := ""
	if find != nil && fi.ArrayContains(subnet.Tags, fi.ValueOf(find.Tag)) {
		tag = fi.ValueOf(find.Tag)
	}

	actual := &Subnet{
		ID:         new(subnet.ID),
		Name:       new(subnet.Name),
		Network:    networkTask,
		CIDR:       new(subnet.CIDR),
		Lifecycle:  lifecycle,

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Check kOps logs for the wrapped inner error from NewNetworkTaskFromCloud to identify the underlying Neutron failure.
  2. Verify the credentials' role can read network extensions: `openstack network show <id> -f json` and confirm router:external is present.
  3. If the Neutron extension is missing/disallowed, grant the kOps user a role with network extension visibility (e.g. admin or reader on the project).
  4. Upgrade/downgrade kOps so its gophercloud Neutron client matches the cloud's API version; retry after any transient Neutron 5xx.

Example fix

# inspect what the API returns
$ openstack network show <networkID> -f json | grep -i external
# if absent due to policy, grant visibility to the kOps user, then re-run:
kops update cluster
Defensive patterns

Strategy: try-catch

Validate before calling

// Confirm the Neutron router:external extension is readable before reconcile:
network, _ := cloud.GetNetwork(subnet.NetworkID)
ext, err := cloud.GetNetworkExternal(network.ID) // or inspect network show output
if err != nil {
	return fmt.Errorf("cannot read router:external attribute for network %s; check role/extension support: %w", network.ID, err)
}

Try / catch

networkTask, err := NewNetworkTaskFromCloud(cloud, lifecycle, network, find.Tag)
if err != nil {
	return nil, fmt.Errorf("error creating network task from cloud: %w", err)
}
// On failure, verify with: openstack extension list | grep router
// and ensure the kOps user role can read network extensions before retrying.

Prevention

When it happens

Trigger: Subnet.Find -> NewSubnetTaskFromCloud -> NewNetworkTaskFromCloud returns an error — the network object retrieved from GetNetwork could not be converted into a Network task, e.g. an error fetching extended network attributes (external router info) from Neutron or an unexpected nil/invalid network payload.

Common situations: Neutron lacks the router:external extension or the policy hides that attribute for the caller's role; Neutron returned a partially-populated network object (5xx degraded response); kOps/gophercloud version mismatch with the cloud's Neutron API microversion.

Related errors


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