{"record":{"id":"a0d03f5068f5f8aa","repo":"kubernetes/kops","slug":"found-multiple-instances-with-instance-id-s-a0d03f","errorCode":null,"errorMessage":"found multiple instances with instance id: %s","messagePattern":"found multiple instances with instance id: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/nodeidentity/aws/identify.go","lineNumber":177,"sourceCode":"\treturn info, nil\n}\n\n// getInstance queries EC2 for the instance with the specified ID, returning an error if not found\nfunc (i *nodeIdentifier) getInstance(ctx context.Context, instanceID string) (*ec2types.Instance, error) {\n\t// Based on node-authorizer code\n\tresp, err := i.ec2Client.DescribeInstances(ctx, &ec2.DescribeInstancesInput{\n\t\tInstanceIds: []string{instanceID},\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error from ec2 DescribeInstances request: %v\", err)\n\t}\n\n\t// @check we found some instances\n\tif len(resp.Reservations) == 0 || len(resp.Reservations[0].Instances) == 0 {\n\t\treturn nil, fmt.Errorf(\"missing instance id: %s\", instanceID)\n\t}\n\tif len(resp.Reservations[0].Instances) > 1 {\n\t\treturn nil, fmt.Errorf(\"found multiple instances with instance id: %s\", instanceID)\n\t}\n\n\tinstance := resp.Reservations[0].Instances[0]\n\treturn &instance, nil\n}\n","sourceCodeStart":159,"sourceCodeEnd":183,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/nodeidentity/aws/identify.go#L159-L183","documentation":"DescribeInstances returned more than one instance for a single instance ID, which EC2 should never do. This is a defensive consistency guard; hitting it usually indicates a mocking/test harness anomaly or an SDK-level inconsistency rather than real AWS behavior.","triggerScenarios":"Thrown at pkg/nodeidentity/aws/identify.go:177 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run identification; if persistent, report as an AWS/SDK anomaly","Verify any custom EC2 client/mocks return a single instance per ID"],"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-12T12:17:11.808Z"}