{"record":{"id":"60bbf37970305e07","repo":"XTLS/Xray-core","slug":"invalid-router-rule","errorCode":null,"errorMessage":"invalid router rule","messagePattern":"invalid router rule","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"infra/conf/router.go","lineNumber":284,"sourceCode":"\t\trule.LocalOs = *rawFieldRule.LocalOS\n\t}\n\n\tif rawFieldRule.Webhook != nil && rawFieldRule.Webhook.URL != \"\" {\n\t\trule.Webhook = &router.WebhookConfig{\n\t\t\tUrl:           rawFieldRule.Webhook.URL,\n\t\t\tDeduplication: rawFieldRule.Webhook.Deduplication,\n\t\t\tHeaders:       rawFieldRule.Webhook.Headers,\n\t\t}\n\t}\n\n\treturn rule, nil\n}\n\nfunc parseRule(msg json.RawMessage) (*router.RoutingRule, error) {\n\trawRule := new(RouterRule)\n\terr := json.Unmarshal(msg, rawRule)\n\tif err != nil {\n\t\treturn nil, errors.New(\"invalid router rule\").Base(err)\n\t}\n\n\tfieldrule, err := parseFieldRule(msg)\n\tif err != nil {\n\t\treturn nil, errors.New(\"invalid field rule\").Base(err)\n\t}\n\treturn fieldrule, nil\n}\n","sourceCodeStart":266,"sourceCodeEnd":293,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/infra/conf/router.go#L266-L293","documentation":"Error \"invalid router rule\" thrown in XTLS/Xray-core.","triggerScenarios":"Thrown at infra/conf/router.go:284 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}