kubernetes/kops · error

found multiple AutoscalingGroups with name: %q

Error message

found multiple AutoscalingGroups with name: %q

What it means

kOps expects exactly one AutoScalingGroup to match the task name (the kops-generated ASG name). After listing, if more than one group matched, the state is ambiguous so it refuses to guess and returns this error.

Source

Thrown at upup/pkg/fi/cloudup/awstasks/autoscalinggroup.go:324

				continue
			}

			if aws.ToString(g.AutoScalingGroupName) == name {
				found = append(found, &g)
			} else {
				klog.Warningf("Got ASG with unexpected name %q", fi.ValueOf(g.AutoScalingGroupName))
			}
		}
	}

	switch len(found) {
	case 0:
		return nil, nil
	case 1:
		return found[0], nil
	}

	return nil, fmt.Errorf("found multiple AutoscalingGroups with name: %q", name)
}

func (e *AutoscalingGroup) Normalize(c *fi.CloudupContext) error {
	sort.Strings(e.Metrics)
	awsup.GetCloud(c).AddTags(e.Name, e.Tags)

	return nil
}

// Run is responsible for running the task
func (e *AutoscalingGroup) Run(c *fi.CloudupContext) error {
	return fi.CloudupDefaultDeltaRunMethod(e, c)
}

// CheckChanges is responsible for checking for changes??
func (e *AutoscalingGroup) CheckChanges(a, ex, changes *AutoscalingGroup) error {
	if a != nil {
		if ex.Name == nil {

View on GitHub (pinned to 4c8573c808)

Solutions

  1. List ASGs (`aws autoscaling describe-auto-scaling-groups --filters Name=tag:Name,Values=<name>`) and identify the duplicate
  2. Delete the unwanted duplicate ASG (or the stale one from the old cluster)
  3. Verify the kops cluster spec instance group name hasn't been reused across clusters sharing one account
  4. Re-run `kops update cluster --yes`

Example fix

// before
$ aws autoscaling create-auto-scaling-group --auto-scaling-group-name nodes-eu-west-1a ... // duplicate
// after: delete the duplicate, then
$ kops update cluster --name mycluster --yes
Defensive patterns

Strategy: validation

Validate before calling

aws autoscaling describe-auto-scaling-groups \
  --query 'AutoScalingGroups[?AutoScalingGroupName==`nodes-<zone>`]' | jq 'length'
# must return 1 before running kops update

Type guard

null

Try / catch

null

Prevention

When it happens

Trigger: Two or more AutoScalingGroups with the same name exist in the account/region being queried — typically created by re-importing a cluster, manual duplication in the console, or stale groups left by a previous apply in a different region/account view.

Common situations: A developer manually copied an ASG for testing, or an interrupted delete left a duplicate; kops apply then fails during Find instead of silently updating the wrong group.

Related errors


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