{"record":{"id":"b94333e51f575281","repo":"kubernetes/kops","slug":"error-creating-cloud-instance-group-member-v-b94333","errorCode":null,"errorMessage":"error creating cloud instance group member: %v","messagePattern":"error creating cloud instance group member: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awsup/aws_cloud.go","lineNumber":1044,"sourceCode":"\t\t\treturn nil, err\n\t\t}\n\t}\n\tvar detached []*string\n\tfor id, instance := range instances {\n\t\tfor _, tag := range instance.Tags {\n\t\t\tif aws.ToString(tag.Key) == tagNameDetachedInstance {\n\t\t\t\tdetached = append(detached, aws.String(id))\n\t\t\t}\n\t\t}\n\t}\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error searching for detached instances: %v\", err)\n\t}\n\tfor _, id := range detached {\n\t\tif id != nil && *id != \"\" && !instanceSeen[*id] {\n\t\t\tcm, err := cg.NewCloudInstance(*id, cloudinstances.CloudInstanceStatusDetached, nodeMap[*id])\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"error creating cloud instance group member: %v\", err)\n\t\t\t}\n\t\t\tinstanceSeen[*id] = true\n\t\t\taddCloudInstanceData(cm, instances[aws.ToString(id)])\n\t\t}\n\t}\n\n\treturn cg, nil\n}\n\nfunc buildCloudInstance(i autoscalingtypes.Instance, instances map[string]*ec2types.Instance, instanceSeen map[string]bool, nodeMap map[string]*v1.Node, cg *cloudinstances.CloudInstanceGroup, newConfigName string) error {\n\tid := aws.ToString(i.InstanceId)\n\tif id == \"\" {\n\t\tklog.Warningf(\"ignoring instance with no instance id: %s in autoscaling group: %s\", id, cg.HumanName)\n\t\treturn nil\n\t}\n\tinstanceSeen[id] = true\n\t// @step: check if the instance is terminating\n\tif i.LifecycleState == autoscalingtypes.LifecycleStateTerminating {","sourceCodeStart":1026,"sourceCodeEnd":1062,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awsup/aws_cloud.go#L1026-L1062","documentation":"CloudInstanceGroup.NewCloudInstance rejected a detached EC2 instance ID (duplicate member or invalid ID) while registering instances tagged with the kOps detached-instance tag. The instance ID that failed registration is in the wrapped error.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/awsup/aws_cloud.go:1044 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped error for duplicate instance registration and remove stale detached-instance tags from terminated instances","Verify the detached instance still exists in EC2"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}