{"record":{"id":"e9aee530437c16c4","repo":"kubernetes/kops","slug":"failed-to-create-new-network-object-v","errorCode":null,"errorMessage":"Failed to create new Network object: %v","messagePattern":"Failed to create new Network object: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/openstacktasks/network.go","lineNumber":81,"sourceCode":"\n\tcloud := context.T.Cloud.(openstack.OpenstackCloud)\n\topt := networks.ListOpts{\n\t\tID:   fi.ValueOf(n.ID),\n\t\tName: fi.ValueOf(n.Name),\n\t}\n\tns, err := cloud.ListNetworks(opt)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif ns == nil {\n\t\treturn nil, nil\n\t} else if len(ns) != 1 {\n\t\treturn nil, fmt.Errorf(\"found multiple networks with name: %s\", fi.ValueOf(n.Name))\n\t}\n\tv := ns[0]\n\tactual, err := NewNetworkTaskFromCloud(cloud, n.Lifecycle, &v, n.Tag)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Failed to create new Network object: %v\", err)\n\t}\n\tn.ID = actual.ID\n\treturn actual, nil\n}\n\nfunc (c *Network) Run(context *fi.CloudupContext) error {\n\treturn fi.CloudupDefaultDeltaRunMethod(c, context)\n}\n\nfunc (_ *Network) CheckChanges(a, e, changes *Network) error {\n\tif a == nil {\n\t\tif e.Name == nil {\n\t\t\treturn fi.RequiredField(\"Name\")\n\t\t}\n\t} else {\n\t\tif changes.ID != nil {\n\t\t\treturn fi.CannotChangeField(\"ID\")\n\t\t}","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/openstacktasks/network.go#L63-L99","documentation":"Once exactly one network is found, Network.Find converts it into a task via NewNetworkTaskFromCloud; any error from that constructor is wrapped with this message. The constructor mostly copies fields, so failures here are rare and typically come from unexpected nil/missing data on the returned network object.","triggerScenarios":"NewNetworkTaskFromCloud returns an error while building the Network task from the single listed network — practically only when the network object lacks expected data or a future code path in the constructor fails.","commonSituations":"Corrupted/empty Neutron responses (API extension returning partial objects); API version mismatch where fields expected by the task are absent; bugs after upgrading gophercloud/openstack plugins.","solutions":["Inspect the wrapped inner error to see which field/construction step failed.","Verify the Neutron API version and that required extensions are enabled: openstack extension list.","Re-run with klog verbosity (kops ... -v=4) to see the raw network listing; if the API returns partial objects, upgrade the OpenStack/neutron deployment.","If caused by a kOps/gophercloud version issue, upgrade kops to a release matching your OpenStack version."],"exampleFix":"// before: neutron returns network without expected fields (extension missing)\nFailed to create new Network object: ...\n// after: enable required extension / upgrade, then retry\n$ openstack extension list | grep availability-zone\n$ kops update cluster --name mycluster --yes","handlingStrategy":"retry","validationCode":"net := neutronNetworkGet(networkID)\nif net == nil || net.Name == \"\" || net.ID == \"\" {\n\treturn fmt.Errorf(\"neutron returned an incomplete network object; check API version/extensions\")\n}","typeGuard":null,"tryCatchPattern":"if err := kopsUpdate(); err != nil {\n\tif strings.Contains(err.Error(), \"Failed to create new Network object\") {\n\t\t// usually an API/version issue: refresh discovery and retry once\n\t\trefreshNeutronExtensions()\n\t\treturn retryOnce()\n\t}\n\treturn err\n}","preventionTips":["Keep kops and its gophercloud dependency current with your OpenStack release.","Verify required Neutron extensions (e.g. availability zone hints) are enabled.","Run with -v=4 to capture raw API responses for diagnosing partial objects."],"tags":["openstack","neutron","network","task-construction"],"backgroundTag":"task-construction-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"}