{"record":{"id":"114e0196e7db896d","repo":"kubernetes/kops","slug":"expecting-subnet-cidr-to-start-with-q-q","errorCode":null,"errorMessage":"expecting subnet cidr to start with %q: %q","messagePattern":"expecting subnet cidr to start with %q: %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awstasks/subnet.go","lineNumber":560,"sourceCode":"}\n\nfunc (d *deleteSubnetIPv6CIDRBlock) Item() string {\n\treturn fmt.Sprintf(\"%v: ipv6cidr=%v\", *d.vpcID, *d.ipv6CidrBlock)\n}\n\nfunc (d *deleteSubnetIPv6CIDRBlock) DeferDeletion() bool {\n\treturn false // TODO: should we defer this?\n}\n\nfunc calculateSubnetCIDR(vpcCIDR, subnetCIDR *string) (*string, error) {\n\tif vpcCIDR == nil {\n\t\treturn nil, fmt.Errorf(\"expecting VPC CIDR to not be <nil>\")\n\t}\n\tif subnetCIDR == nil {\n\t\treturn nil, fmt.Errorf(\"expecting subnet CIDR to not be <nil>\")\n\t}\n\tif !strings.HasPrefix(aws.ToString(subnetCIDR), \"/\") {\n\t\treturn nil, fmt.Errorf(\"expecting subnet cidr to start with %q: %q\", \"/\", aws.ToString(subnetCIDR))\n\t}\n\n\tnewSize, netNum, err := utils.ParseCIDRNotation(aws.ToString(subnetCIDR))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error parsing CIDR subnet: %v\", err)\n\t}\n\n\tnewCIDR, err := utils.CIDRSubnet(aws.ToString(vpcCIDR), newSize, netNum)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error calculating CIDR subnet: %v\", err)\n\t}\n\n\treturn aws.String(newCIDR), nil\n}\n","sourceCodeStart":542,"sourceCodeEnd":575,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awstasks/subnet.go#L542-L575","documentation":"Subnet CIDR hints must use the '/<size>,<netnum>' notation (leading slash marking a computed CIDR); the provided hint does not start with '/', so it is neither a full CIDR nor a valid hint.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/awstasks/subnet.go:560 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Change the hint to start with '/' (e.g. '/64,2')","Or provide a complete CIDR (e.g. 10.0.2.0/24) instead of a hint"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}