{"record":{"id":"35fe08a1f82d7ee4","repo":"kubernetes/kops","slug":"error-creating-cloud-instance-group-member-v","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":"pkg/resources/spotinst/resources.go","lineNumber":386,"sourceCode":"\t\t}\n\n\t\t// If the instance was created before the last update, mark it as `NeedUpdate`.\n\t\tnewInstanceGroupName := currentInstanceGroupName\n\t\tif instance.CreatedAt().Before(instanceGroupUpdatedAt) {\n\t\t\tnewInstanceGroupName = fmt.Sprintf(\"%s:%d\", currentInstanceGroupName, time.Now().Nanosecond())\n\t\t}\n\n\t\tklog.V(2).Infof(\"Adding instance %q (created at: %s) to instance group: %q (updated at: %s)\",\n\t\t\tinstance.Id(), instance.CreatedAt().Format(time.RFC3339),\n\t\t\tcurrentInstanceGroupName, instanceGroupUpdatedAt.Format(time.RFC3339))\n\n\t\tstatus := cloudinstances.CloudInstanceStatusUpToDate\n\t\tif newInstanceGroupName != currentInstanceGroupName {\n\t\t\tstatus = cloudinstances.CloudInstanceStatusNeedsUpdate\n\t\t}\n\t\tif _, err := instanceGroup.NewCloudInstance(\n\t\t\tinstance.Id(), status, nodeMap[instance.Id()]); err != nil {\n\t\t\treturn fmt.Errorf(\"error creating cloud instance group member: %v\", err)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc findInstanceGroupFromResource(cluster *kops.Cluster, instanceGroups []*kops.InstanceGroup,\n\tresource *resources.Resource) (*kops.InstanceGroup, error,\n) {\n\tvar instanceGroup *kops.InstanceGroup\n\tfor _, ig := range instanceGroups {\n\t\tname := getGroupNameByRole(cluster, ig)\n\t\tif name == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\tif name == resource.Name {\n\t\t\tif instanceGroup != nil {","sourceCodeStart":368,"sourceCodeEnd":404,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/resources/spotinst/resources.go#L368-L404","documentation":"Fires in registerCloudInstances when adding an instance to the CloudInstanceGroup member list fails (the wrapped error comes from cloudinstances.NewCloudInstanceGroupMember, e.g. a nil node where the master flag disagrees) while registering spotinst instances into instance groups.","triggerScenarios":"Thrown at pkg/resources/spotinst/resources.go:386 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped %v error for the specific member-construction cause","Verify the instance's node exists in nodeMap when expected to be a master/non-master","Re-run GetCloudGroups so nodes and instances are re-synced"],"exampleFix":null,"handlingStrategy":"try-catch","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"}