{"record":{"id":"38bc424220664f09","repo":"kubernetes/kops","slug":"error-creating-network-v-38bc42","errorCode":null,"errorMessage":"Error creating network: %v","messagePattern":"Error creating network: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/openstacktasks/network.go","lineNumber":129,"sourceCode":"\tif a == nil || changes.Tag != nil {\n\t\treturn true, nil\n\t}\n\treturn false, nil\n}\n\nfunc (_ *Network) RenderOpenstack(t *openstack.OpenstackAPITarget, a, e, changes *Network) error {\n\tif a == nil {\n\t\tklog.V(2).Infof(\"Creating Network with name:%q\", fi.ValueOf(e.Name))\n\n\t\topt := networks.CreateOpts{\n\t\t\tName:                  fi.ValueOf(e.Name),\n\t\t\tAdminStateUp:          new(true),\n\t\t\tAvailabilityZoneHints: fi.StringSliceValue(e.AvailabilityZoneHints),\n\t\t}\n\n\t\tv, err := t.Cloud.CreateNetwork(opt)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Error creating network: %v\", err)\n\t\t}\n\n\t\terr = t.Cloud.AppendTag(openstack.ResourceTypeNetwork, v.ID, fi.ValueOf(e.Tag))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Error appending tag to network: %v\", err)\n\t\t}\n\n\t\te.ID = new(v.ID)\n\t\tklog.V(2).Infof(\"Creating a new Openstack network, id=%s\", v.ID)\n\t\treturn nil\n\t} else {\n\t\terr := t.Cloud.AppendTag(openstack.ResourceTypeNetwork, fi.ValueOf(a.ID), fi.ValueOf(changes.Tag))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Error appending tag to network: %v\", err)\n\t\t}\n\t}\n\te.ID = a.ID\n\tklog.V(2).Infof(\"Using an existing Openstack network, id=%s\", fi.ValueOf(e.ID))","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/openstacktasks/network.go#L111-L147","documentation":"kOps wraps the gophercloud error returned by OpenstackCloud.CreateNetwork when rendering the Openstack Network task (RenderOpenstack). It means the Neutron API rejected or failed the network-create call, so the desired cluster network could not be provisioned. The wrapper preserves the underlying Neutron/gophercloud error text after the prefix.","triggerScenarios":"t.Cloud.CreateNetwork(opt) returns an error during `kops update cluster` on OpenStack: invalid network name, missing/insufficient Neutron quota (e.g. quota exceeded for networks), bad AvailabilityZoneHints referencing a nonexistent AZ, expired or unauthorized Keystone token, or Neutron endpoint unreachable.","commonSituations":"Tenant hit its networks quota; cloud config (os-client-config/clouds.yaml) points at a wrong project; router/network extensions (e.g. availability zone hints) unsupported by the deployed Neutron version; network name conflicts with existing resources in a different project.","solutions":["Inspect the wrapped %v message from gophercloud to identify the Neutron 4xx/5xx status","Check Neutron network quota (openstack quota show) and delete unused networks or raise the quota","Validate AvailabilityZoneHints against `openstack network availability zone list` and correct the cluster spec","Re-authenticate: verify OS_* environment variables / clouds.yaml credentials and project scope","Confirm Neutron service is healthy in the service catalog and reachable from the kops host"],"exampleFix":"// before\nAvailabilityZoneHints: fi.StringSliceValue([]string{\"nova-unknown-zone\"})\n// after\nAvailabilityZoneHints: fi.StringSliceValue([]string{\"nova\"}) // must exist in `openstack network availability zone list`","handlingStrategy":"try-catch","validationCode":"// pre-flight\ncmd := exec.Command(\"openstack\", \"quota\", \"show\", \"--networks\")\nout, err := cmd.Output() // verify network quota > 0\nif err != nil { return err }\nazOut, _ := exec.Command(\"openstack\", \"network\", \"availability\", \"zone\", \"list\").Output()\n// ensure spec AZ hints appear in azOut before running kops update","typeGuard":"func isNeutronQuotaError(err error) bool {\n\treturn err != nil && strings.Contains(err.Error(), \"Quota exceeded\")\n}","tryCatchPattern":"v, err := t.Cloud.CreateNetwork(opt)\nif err != nil {\n\tif isNeutronQuotaError(err) {\n\t\t// raise quota or free networks, then retry\n\t}\n\treturn fmt.Errorf(\"Error creating network: %v\", err)\n}","preventionTips":["Verify network quota and AZ hints with openstack CLI before `kops update cluster`","Use clouds.yaml validated with `openstack token issue` to rule out credential issues","Keep one OpenStack project per cluster to avoid name/quota contention"],"tags":["openstack","neutron","network","cloud-provider"],"backgroundTag":"openstack-neutron-api-error","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"}