{"record":{"id":"f53644ae55f7bdfe","repo":"kubernetes/kops","slug":"unable-to-resolve-ip-for-instance-v","errorCode":null,"errorMessage":"unable to resolve IP for instance: %v","messagePattern":"unable to resolve IP for instance: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gcetasks/instance.go","lineNumber":241,"sourceCode":"\tif e.Tags != nil {\n\t\ttags = &compute.Tags{\n\t\t\tItems: e.Tags,\n\t\t}\n\t}\n\n\tvar networkInterfaces []*compute.NetworkInterface\n\t{\n\t\tnetworkInterface := &compute.NetworkInterface{\n\t\t\tAccessConfigs: []*compute.AccessConfig{{\n\t\t\t\tType: \"ONE_TO_ONE_NAT\",\n\t\t\t}},\n\t\t\tNetwork: e.Network.URL(project),\n\t\t}\n\n\t\tif e.IPAddress != nil {\n\t\t\taddr, err := ipAddressResolver(e.IPAddress)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"unable to resolve IP for instance: %v\", err)\n\t\t\t}\n\t\t\tif addr == nil {\n\t\t\t\treturn nil, fmt.Errorf(\"instance IP address has not yet been created\")\n\t\t\t}\n\t\t\tnetworkInterface.AccessConfigs[0].NatIP = *addr\n\t\t}\n\t\tif e.Subnet != nil {\n\t\t\tnetworkInterface.Subnetwork = *e.Subnet.Name\n\t\t}\n\t\tif e.StackType != nil {\n\t\t\tnetworkInterface.StackType = *e.StackType\n\t\t}\n\t\tnetworkInterfaces = append(networkInterfaces, networkInterface)\n\t}\n\n\tvar serviceAccounts []*compute.ServiceAccount\n\tif e.ServiceAccount != nil {\n\t\tif e.Scopes != nil {","sourceCodeStart":223,"sourceCodeEnd":259,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gcetasks/instance.go#L223-L259","documentation":"mapToGCE resolves the instance's static IP by invoking the caller-provided ipAddressResolver on e.IPAddress (typically finding a GCE Address task). If resolution fails — the address resource can't be looked up or an error occurred while finding it — this error wraps the cause. A nil addr with no error is handled separately as 'instance IP address has not yet been created'.","triggerScenarios":"ipAddressResolver(e.IPAddress) returns an error during RenderGCE or RenderTerraform: the referenced Address task failed to render, the address name doesn't exist in the project/region, or the address lookup API call failed.","commonSituations":"Instance spec references an ipAddress whose Address task was removed or renamed; reserved address exists in a different region; dependency ordering so the Address task errors out first; typo in the address name.","solutions":["Verify the referenced address name matches an existing GCE static address in the correct region: `gcloud compute addresses list`","Fix or remove the ipAddress field on the instance spec so the instance uses an ephemeral IP","Ensure the Address task is still defined in the cluster spec and renders successfully","Retry `kops update cluster` after correcting the address reference"],"exampleFix":"// before (instance spec)\nipAddress: old-removed-address\n// after\nipAddress: my-reserved-ip   # matching an existing Address task in the same region\n# or remove the ipAddress field entirely for an ephemeral IP\n","handlingStrategy":"validation","validationCode":"// Ensure the referenced address exists (in the right region) before rendering the instance\nfunc assertAddressExists(svc *compute.Service, project, region, name string) error {\n\t_, err := svc.Addresses.Get(project, region, name).Do()\n\treturn err\n}","typeGuard":"func resolvableAddress(e *Instance, resolver func(*Address) (*string, error)) bool {\n\tif e.IPAddress == nil { return true }\n\taddr, err := resolver(e.IPAddress)\n\treturn err == nil && addr != nil\n}","tryCatchPattern":"addr, err := ipAddressResolver(e.IPAddress)\nif err != nil {\n\treturn nil, fmt.Errorf(\"unable to resolve IP for instance: %v\", err)\n}\nif addr == nil {\n\treturn nil, fmt.Errorf(\"instance IP address has not yet been created\")\n}","preventionTips":["Keep the ipAddress reference in the instance spec in sync with a defined Address task in the same region","Never delete a GCE static address that specs reference; rename only with spec updates","Use ephemeral IPs (omit ipAddress) when no static IP is required","Run kops update cluster in --dry-run/target mode to catch unresolved address references before apply"],"tags":["gce","instance","ip-address","resolution"],"backgroundTag":"ip-address-resolution-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"}