{"record":{"id":"43e51fd5391707d2","repo":"kubernetes/kops","slug":"cannot-parse-rule-q-43e51f","errorCode":null,"errorMessage":"cannot parse rule %q","messagePattern":"cannot parse rule %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/openstacktasks/securitygroup.go","lineNumber":328,"sourceCode":"type RemovalRule interface {\n\tMatches(sgr.SecGroupRule) bool\n}\n\n// ParseRemovalRule parses our removal rule DSL into a RemovalRule\nfunc ParseRemovalRule(rule string) (RemovalRule, error) {\n\trule = strings.TrimSpace(rule)\n\ttokens := strings.Split(rule, \"=\")\n\n\t// Simple little language:\n\t//   port=N matches rules that filter (only) by port=N\n\t//\n\t// Note this language is internal, so isn't required to be stable\n\n\tif len(tokens) == 2 {\n\t\tif tokens[0] == \"port\" {\n\t\t\tport, err := strconv.Atoi(tokens[1])\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"cannot parse rule %q\", rule)\n\t\t\t}\n\n\t\t\treturn &PortRemovalRule{Port: port}, nil\n\t\t} else {\n\t\t\treturn nil, fmt.Errorf(\"cannot parse rule %q\", rule)\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"cannot parse rule %q\", rule)\n}\n\ntype PortRemovalRule struct {\n\tPort int\n}\n\nvar _ RemovalRule = (*PortRemovalRule)(nil)\n\nfunc (r *PortRemovalRule) String() string {\n\treturn fi.DebugAsJsonString(r)","sourceCodeStart":310,"sourceCodeEnd":346,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/openstacktasks/securitygroup.go#L310-L346","documentation":"The internal removal-rule DSL could not parse the given rule string. Currently only 'port=N' is supported; the rule's port value failed integer conversion or the syntax is unrecognized, so the rule cannot be matched against cloud rules.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/openstacktasks/securitygroup.go:328 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use the supported 'port=<number>' syntax","Remove the invalid rule from the security group's removal rules list"],"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"}