{"record":{"id":"41ccbfd4cfa28731","repo":"XTLS/Xray-core","slug":"invalid-id-id","errorCode":null,"errorMessage":"invalid id + id","messagePattern":"invalid id \\+ id","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"infra/conf/transport_finalmask.go","lineNumber":869,"sourceCode":"\t\tif scheme == \"http\" {\n\t\t\tport = \"80\"\n\t\t}\n\t}\n\n\ttoken, err = url.PathUnescape(u.User.String())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif token == \"\" {\n\t\treturn nil, errors.New(\"invalid token\", token)\n\t}\n\n\tid, err = url.PathUnescape(strings.TrimPrefix(u.EscapedPath(), \"/\"))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif id == \"\" {\n\t\treturn nil, errors.New(\"invalid id\", id)\n\t}\n\n\tif len(c.StunServers) == 0 {\n\t\treturn nil, errors.New(\"empty stunServers\")\n\t}\n\n\tfor _, s := range c.StunServers {\n\t\t_, _, err = net.SplitHostPort(s)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tstunServers = c.StunServers\n\n\tif c.TlsConfig != nil {\n\t\ttc, err := c.TlsConfig.Build()\n\t\tif err != nil {","sourceCodeStart":851,"sourceCodeEnd":887,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/infra/conf/transport_finalmask.go#L851-L887","documentation":"Thrown by Realm.Build() when the path component of the Realm URL, after trimming the leading '/' and percent-decoding, is empty. The path carries the Realm session ID; 'realm://token@host' with no trailing path fails here. It is checked after token extraction.","triggerScenarios":"A URL like 'realm://token@host:8443' or 'realm://token@host:8443/' (root-only path) triggers this. The decoded path must be at least one non-empty segment.","commonSituations":"Omitting the ID path when shortening URLs; trimming what looked like a redundant trailing segment; misreading docs where the final path element is the session ID.","solutions":["Append the session ID as the URL path: 'realm://token@host:port/<id>'.","Ensure the path is not just '/'.","Percent-encode the ID if it contains reserved characters so decoding round-trips."],"exampleFix":"// before\n\"url\": \"realm://mytoken@signal.example.com:8443\"\n// after\n\"url\": \"realm://mytoken@signal.example.com:8443/session-42\"","handlingStrategy":"validation","validationCode":"u, _ := url.Parse(raw)\nif strings.TrimPrefix(u.EscapedPath(), \"/\") == \"\" {\n    return fmt.Errorf(\"realm url is missing the session id path\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always terminate Realm URLs with the session id segment.","Do not strip trailing path components when shortening URLs.","Percent-encode ids so unescaping cannot yield an empty string."],"tags":["go","xray","config","validation","url-parsing"],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}