{"record":{"id":"28eefa09647fd378","repo":"kubernetes/kops","slug":"error-creating-subnet-v-28eefa","errorCode":null,"errorMessage":"error creating subnet: %v","messagePattern":"error creating subnet: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/openstack/subnet.go","lineNumber":91,"sourceCode":"\t\treturn nil, err\n\t} else if done {\n\t\treturn subnet, nil\n\t} else {\n\t\treturn nil, wait.ErrWaitTimeout\n\t}\n}\n\nfunc (c *openstackCloud) CreateSubnet(opt subnets.CreateOptsBuilder) (*subnets.Subnet, error) {\n\treturn createSubnet(c, opt)\n}\n\nfunc createSubnet(c OpenstackCloud, opt subnets.CreateOptsBuilder) (*subnets.Subnet, error) {\n\tvar s *subnets.Subnet\n\n\tdone, err := vfs.RetryWithBackoff(writeBackoff, func() (bool, error) {\n\t\tv, err := subnets.Create(context.TODO(), c.NetworkingClient(), opt).Extract()\n\t\tif err != nil {\n\t\t\treturn false, fmt.Errorf(\"error creating subnet: %v\", err)\n\t\t}\n\t\ts = v\n\t\treturn true, nil\n\t})\n\tif err != nil {\n\t\treturn s, err\n\t} else if done {\n\t\treturn s, nil\n\t} else {\n\t\treturn s, wait.ErrWaitTimeout\n\t}\n}\n\nfunc (c *openstackCloud) DeleteSubnet(subnetID string) error {\n\treturn deleteSubnet(c, subnetID)\n}\n\nfunc deleteSubnet(c OpenstackCloud, subnetID string) error {","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/openstack/subnet.go#L73-L109","documentation":"createSubnet issues a Neutron subnet Create call inside a RetryWithBackoff(writeBackoff) loop. If subnets.Create(...).Extract() fails, the error is wrapped as \"error creating subnet: %v\". Because it is retried, this error indicates the create failed persistently across retries.","triggerScenarios":"Invalid CreateOpts (bad CIDR overlapping an existing subnet, CIDR outside the network's range, missing gateway/IP version fields), quota exceeded on subnets, or RBAC denial.","commonSituations":"Cluster spec CIDR overlapping an existing subnet in the VPC, project hit its subnet quota, malformed subnets.CreateOptsBuilder passed by the caller, or Neutron policy restricting subnet creation.","solutions":["Read the wrapped Neutron error: 409 => overlap/conflict, 403 => policy, 413/403 quota => raise limits","Verify the requested CIDR does not overlap existing subnets and fits the network's CIDR range","Check `openstack quota show` for subnet quotas","Validate the CreateOpts (cidr, network_id, ip_version) before calling createSubnet"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Validate CIDR before createSubnet\n_, ipNet, err := net.ParseCIDR(\"10.0.1.0/24\")\nif err != nil {\n\tlog.Fatalf(\"invalid cidr: %v\", err)\n}\n// check no overlap with existing subnets\nfor _, s := range existingSubnets {\n\tif cidrOverlap(ipNet, mustParseCIDR(s.CIDR)) {\n\t\tlog.Fatalf(\"CIDR overlaps existing subnet %s\", s.ID)\n\t}\n}","typeGuard":null,"tryCatchPattern":"sub, err := createSubnet(cloud, opts)\nif err != nil {\n\tif strings.Contains(err.Error(), \"overlaps\") || strings.Contains(err.Error(), \"409\") {\n\t\t// adjust CIDR and retry\n\t}\n\treturn err\n}","preventionTips":["Plan non-overlapping CIDRs across subnets in the network","Monitor subnet quotas (`openstack quota show`)","Validate CreateOpts fields (network_id, ip_version, cidr) before submitting","Check Neutron policy for subnet-create permission"],"tags":["openstack","neutron","subnet","create"],"backgroundTag":"subnet-creation-failed","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}