{"record":{"id":"767cf9cba1226fcf","repo":"kubernetes/kops","slug":"type-fixed-did-not-contain-addr-v","errorCode":null,"errorMessage":"Type fixed did not contain addr: %v","messagePattern":"Type fixed did not contain addr: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/openstack/utils.go","lineNumber":119,"sourceCode":"\t\treturn \"\", fmt.Errorf(\"No suitable flavor for role %q\", ig.Spec.Role)\n\t}\n\treturn candidates[0].Name, nil\n}\n\nfunc GetServerFixedIP(server *servers.Server, interfaceName string) (poolAddress string, err error) {\n\tif localAddr, ok := server.Addresses[interfaceName]; ok {\n\t\tif localAddresses, ok := localAddr.([]interface{}); ok {\n\t\t\tfor _, addr := range localAddresses {\n\t\t\t\taddrMap := addr.(map[string]interface{})\n\t\t\t\tif addrType, ok := addrMap[openstackExternalIPType]; ok && addrType == openstackAddressFixed {\n\t\t\t\t\tif fixedIP, ok := addrMap[openstackAddress]; ok {\n\t\t\t\t\t\tif fixedIPStr, ok := fixedIP.(string); ok {\n\t\t\t\t\t\t\tpoolAddress = fixedIPStr\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\terr = fmt.Errorf(\"Fixed IP was not a string: %v\", fixedIP)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\terr = fmt.Errorf(\"Type fixed did not contain addr: %v\", addr)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\terr = fmt.Errorf(\"server `%s` interface name `%s` not found\", server.ID, interfaceName)\n\t}\n\treturn poolAddress, err\n}\n","sourceCodeStart":101,"sourceCodeEnd":129,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/openstack/utils.go#L101-L129","documentation":"Thrown by GetServerFixedIP when an address entry has type 'fixed' but its map lacks the 'addr' key. The code expects every fixed address entry to include an 'addr' field holding the IP; a missing key means the entry is incomplete.","triggerScenarios":"GetServerFixedIP finds a fixed-type entry in server.Addresses[interfaceName] but addrMap[openstackAddress] is absent — partial address data from Nova or a provider plugin emitting entries without addr.","commonSituations":"Networking plugins (OVN or vendor SDN) reporting nonstandard address shapes; API version differences in address payloads; transitional server states where addresses are registered but not yet assigned.","solutions":["Inspect `openstack server show <server-id>` to see the actual address entry shape.","Retry after the server reaches ACTIVE state, when addresses are fully populated.","Update parsing to decode the actual entry shape or use gophercloud's typed address structs."],"exampleFix":"// before\nif fixedIP, ok := addrMap[openstackAddress]; ok {\n    ...\n} else {\n    err = fmt.Errorf(\"Type fixed did not contain addr: %v\", addr)\n}\n// after\nfixedIP, ok := addrMap[openstackAddress]\nif !ok {\n    return \"\", fmt.Errorf(\"fixed address entry missing 'addr' for server %s: %#v\", server.ID, addr)\n}","handlingStrategy":"validation","validationCode":"for _, addr := range addrList {\n    addrMap, ok := addr.(map[string]interface{})\n    if !ok || addrMap[\"addr\"] == nil {\n        return \"\", fmt.Errorf(\"malformed address entry: %#v\", addr)\n    }\n}","typeGuard":"func hasAddr(addr interface{}) bool {\n    m, ok := addr.(map[string]interface{})\n    return ok && m[\"addr\"] != nil\n}","tryCatchPattern":"poolAddress, err := GetServerFixedIP(server, iface)\nif err != nil {\n    return fmt.Errorf(\"resolving fixed IP for server %s: %w\", server.ID, err)\n}","preventionTips":["Wait for instance ACTIVE state before reading addresses","Prefer typed decode (mapstructure into Address structs) over manual map walking","Verify SDN plugins return standard address entries"],"tags":["openstack","nova","networking","missing-field"],"backgroundTag":"missing-json-field","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"}