kubernetes/kops · error

found multiple Volumes with name: %s

Error message

found multiple Volumes with name: %s

What it means

Find() expects the name tag filter to match exactly one EBS volume; if multiple volumes carry the same name tag, kOps cannot determine which one the task manages and aborts rather than guessing. This is an ambiguity guard against operating on the wrong volume.

Source

Thrown at upup/pkg/fi/cloudup/awstasks/ebsvolume.go:76

	ctx := c.Context()
	cloud := awsup.GetCloud(c)

	filters := cloud.BuildFilters(e.Name)
	request := &ec2.DescribeVolumesInput{
		Filters: filters,
	}

	response, err := cloud.EC2().DescribeVolumes(ctx, request)
	if err != nil {
		return nil, fmt.Errorf("error listing volumes: %v", err)
	}

	if response == nil || len(response.Volumes) == 0 {
		return nil, nil
	}

	if len(response.Volumes) != 1 {
		return nil, fmt.Errorf("found multiple Volumes with name: %s", *e.Name)
	}
	klog.V(2).Info("found existing volume")
	v := response.Volumes[0]
	actual := &EBSVolume{
		ID:               v.VolumeId,
		AvailabilityZone: v.AvailabilityZone,
		VolumeType:       v.VolumeType,
		SizeGB:           v.Size,
		KmsKeyId:         v.KmsKeyId,
		Encrypted:        v.Encrypted,
		Name:             e.Name,
		VolumeIops:       v.Iops,
		VolumeThroughput: v.Throughput,
	}

	actual.Tags = mapEC2TagsToMap(v.Tags)

	// Avoid spurious changes

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Delete or rename the duplicate volume's name tag so only one match remains
  2. Remove the truly redundant volume after verifying data
  3. Make the task's name tag value unique in the cluster spec
  4. Use `aws ec2 describe-volumes --filters Name=tag:Name,Values=<name>` to list the duplicates

Example fix

// before
aws ec2 create-volume --snapshot-id snap-123 --tag-specifications 'ResourceType=volume,Tags=[{Key=Name,Value=a.etcd-events.mycluster}]'
// after
aws ec2 create-volume --snapshot-id snap-123 --tag-specifications 'ResourceType=volume,Tags=[{Key=Name,Value=restored-copy}]'  // avoid colliding tag
Defensive patterns

Strategy: validation

Validate before calling

// Assert exactly one volume carries the name tag before updating
out, _ := ec2Client.DescribeVolumes(ctx, &ec2.DescribeVolumesInput{Filters: nameTagFilters})
if len(out.Volumes) > 1 {
    return fmt.Errorf("cleanup needed: %d volumes share name %s", len(out.Volumes), name)
}

Prevention

When it happens

Trigger: Two or more EBS volumes in the region share the same value for the kOps name tag (e.g. a volume was duplicated, or the name tag was copied manually or by a snapshot-restore flow).

Common situations: Manually copying a volume and its tags; restoring a snapshot into a new volume retaining the name tag; running multiple clusters whose volume name tags collide.

Related errors


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