kubernetes/kops · error

error fetching instance list: %v

Error message

error fetching instance list: %v

What it means

RenderOpenstack returns this during ServerGroup scale-down when listing instances via t.Cloud.ListInstances(servers.ListOpts{Name: "^<igName>"}) fails. The task needs the current member instances of the group to decide which to delete; without the list the scale-down cannot proceed. The wrapped error is the underlying OpenStack compute API failure.

Source

Thrown at upup/pkg/fi/cloudup/openstacktasks/servergroup.go:172

			return fmt.Errorf("error creating ServerGroup: %v", err)
		}
		e.ID = new(g.ID)
		return nil
	} else if changes.IGMap != nil {
		for igName, maxSize := range changes.IGMap {
			actualIG := a.IGMap[igName]
			if fi.ValueOf(actualIG) > fi.ValueOf(maxSize) {
				currentLastIndex := fi.ValueOf(actualIG)

				for currentLastIndex > fi.ValueOf(maxSize) {
					iName := strings.ToLower(fmt.Sprintf("%s-%d.%s", igName, currentLastIndex, fi.ValueOf(a.ClusterName)))
					instanceName := strings.ReplaceAll(iName, ".", "-")
					opts := servers.ListOpts{
						Name: fmt.Sprintf("^%s", igName),
					}
					allInstances, err := t.Cloud.ListInstances(opts)
					if err != nil {
						return fmt.Errorf("error fetching instance list: %v", err)
					}

					instances := []servers.Server{}
					for _, server := range allInstances {
						val, ok := server.Metadata["k8s"]
						if !ok || val != fi.ValueOf(a.ClusterName) {
							continue
						}
						metadataName := ""
						val, ok = server.Metadata[openstack.TagKopsName]
						if ok {
							metadataName = val
						}
						// name or metadata tag should match to instance name
						// this is needed for backwards compatibility
						if server.Name == instanceName || metadataName == instanceName {
							instances = append(instances, server)
						}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Verify list works out-of-band: 'openstack server list --name ^<igName>' with the same credentials.
  2. Re-check OpenStack auth environment/credentials for the kOps cloud client.
  3. Retry the kops apply/upgrade — transient Nova 5xx or throttling is a frequent cause.
  4. If the regex filter is rejected by your cloud, confirm Nova microversion supports regex name filters or list by prefix manually.
Defensive patterns

Strategy: retry

Validate before calling

// Confirm the API is listable with the same credentials before scaling
curl -sf -H "X-Auth-Token: $OS_TOKEN" "$OS_COMPUTE_ENDPOINT/servers/detail" >/dev/null || echo "compute list API unavailable"

Try / catch

// Wrap scale-down operations with bounded retry for transient Nova 5xx
if err := scaleDownServerGroup(...); err != nil {
    if isTransient(err) { backoffRetry(3) } else { return err }
}

Prevention

When it happens

Trigger: During the scale-down path (changes.IGMap with a decreased maxSize), ListInstances with a regex Name filter returns an error: Nova API unreachable, authentication/authorization failure, or a malformed/unsupported regex name filter rejected by the compute API.

Common situations: Credentials lost/expired mid-cluster-operation; the Nova endpoint is behind a proxy that blocks the servers list; compute API throttling; cloud rejecting the '^name' regex (older Nova versions or non-default filtering backends).

Related errors


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