{"record":{"id":"b14300a54be8991a","repo":"kubernetes/kops","slug":"spotinst-failed-to-update-elastigroup-v","errorCode":null,"errorMessage":"spotinst: failed to update elastigroup: %v","messagePattern":"spotinst: failed to update elastigroup: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/spotinsttasks/elastigroup.go","lineNumber":1372,"sourceCode":"\t\tklog.Warningf(\"Not all changes applied to Elastigroup %q: %v\", *e.Name, changes)\n\t}\n\n\tif !changed {\n\t\tklog.V(2).Infof(\"No changes detected in Elastigroup %q\", *e.Name)\n\t\treturn nil\n\t}\n\n\tklog.V(2).Infof(\"Updating Elastigroup %q (config: %s)\", *e.Name, stringutil.Stringify(group))\n\n\t// Wrap the raw object as an Elastigroup.\n\teg, err := spotinst.NewElastigroup(cloud.ProviderID(), group)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Update the Elastigroup.\n\tif err := cloud.Spotinst().Elastigroup().Update(context.Background(), eg); err != nil {\n\t\treturn fmt.Errorf(\"spotinst: failed to update elastigroup: %v\", err)\n\t}\n\n\treturn nil\n}\n\ntype terraformElastigroup struct {\n\tName                 *string                                 `cty:\"name\"`\n\tDescription          *string                                 `cty:\"description\"`\n\tProduct              *string                                 `cty:\"product\"`\n\tRegion               *string                                 `cty:\"region\"`\n\tSubnetIDs            []*terraformWriter.Literal              `cty:\"subnet_ids\"`\n\tLoadBalancers        []*terraformWriter.Literal              `cty:\"elastic_load_balancers\"`\n\tTargetGroups         []*terraformWriter.Literal              `cty:\"target_group_arns\"`\n\tNetworkInterfaces    []*terraformElastigroupNetworkInterface `cty:\"network_interface\"`\n\tRootBlockDevice      *terraformElastigroupBlockDevice        `cty:\"ebs_block_device\"`\n\tEphemeralBlockDevice []*terraformElastigroupBlockDevice      `cty:\"ephemeral_block_device\"`\n\tIntegration          *terraformElastigroupIntegration        `cty:\"integration_kubernetes\"`\n\tTags                 []*terraformKV                          `cty:\"tags\"`","sourceCodeStart":1354,"sourceCodeEnd":1390,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/spotinsttasks/elastigroup.go#L1354-L1390","documentation":"update() builds the desired Elastigroup object and then calls the Spotinst Update API; any failure is wrapped with this message. The group exists (otherwise find/create path was used), but Spotinst rejected or failed the update request.","triggerScenarios":"createOrUpdate takes the update path; find() returned the existing group, kOps mutates it to match the spec, then cloud.Spotinst().Elastigroup().Update(context.Background(), eg) returns an error.","commonSituations":"Concurrent modification — the group changed in the Spotinst console between find and update; spec changes Spotinst rejects (invalid combination of instance types, removing the only load balancer, resizing constraints); token expiry mid-run; transient Spotinst API 5xx.","solutions":["Read the wrapped error detail for the exact Spotinst validation message and correct the offending field in the cluster spec.","Re-run `kops update cluster` — concurrent-modification style errors often clear on a fresh read/update cycle.","Check whether the group was edited externally (Spotinst console/Spot Ocean UI) and revert conflicting manual changes.","Verify Spotinst API credentials are still valid and the account is connected."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// re-read the group immediately before update to minimize concurrent-modification risk\nlatest, err := e.find(svc)\nif err != nil {\n    return err\n}\napplyDesiredState(latest, e) // patch from latest read, not a stale copy","typeGuard":null,"tryCatchPattern":"if err := cloud.Spotinst().Elastigroup().Update(context.Background(), eg); err != nil {\n    if isTransient(err) { // 429/5xx from Spotinst\n        time.Sleep(backoff)\n        return e.update(cloud) // fresh read + update\n    }\n    return fmt.Errorf(\"spotinst: failed to update elastigroup: %v\", err)\n}","preventionTips":["Avoid concurrent edits from the Spotinst console while kOps runs","Run a single `kops update cluster` at a time","Retry transient API errors with backoff","Diff the group in the Spotinst console when updates repeatedly fail"],"tags":["spotinst","aws","api","update"],"backgroundTag":"cloud-api-update-failed","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"}