{"record":{"id":"741f5c8231f9fa27","repo":"MHSanaei/3x-ui","slug":"xray-version-q-is-not-in-the-fetched-release-list","errorCode":null,"errorMessage":"xray version %q is not in the fetched release list","messagePattern":"xray version %q is not in the fetched release list","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/web/service/server.go","lineNumber":993,"sourceCode":"\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\th := strings.ToLower(strings.TrimSpace(rest))\n\t\tif len(h) != 64 {\n\t\t\treturn \"\", fmt.Errorf(\"xray checksum: malformed SHA2-256 entry in digest\")\n\t\t}\n\t\treturn h, nil\n\t}\n\treturn \"\", fmt.Errorf(\"xray checksum: no SHA2-256 entry in digest\")\n}\n\nfunc (s *ServerService) UpdateXray(version string) error {\n\tversions, err := s.GetXrayVersions()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !slices.Contains(versions, version) {\n\t\treturn fmt.Errorf(\"xray version %q is not in the fetched release list\", version)\n\t}\n\n\t// 1. Stop xray before doing anything\n\tif err := s.StopXrayService(); err != nil {\n\t\tlogger.Warning(\"failed to stop xray before update:\", err)\n\t}\n\n\t// 2. Download the zip\n\tzipFileName, err := s.downloadXRay(version)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer os.Remove(zipFileName)\n\n\tzipFile, err := os.Open(zipFileName)\n\tif err != nil {\n\t\treturn err\n\t}","sourceCodeStart":975,"sourceCodeEnd":1011,"githubUrl":"https://github.com/MHSanaei/3x-ui/blob/ad32144c42455696ea9f14e12168beac3e25f5d2/internal/web/service/server.go#L975-L1011","documentation":"Returned by UpdateXray when the requested version is not present in the list fetched from GetXrayVersions(). The version must be chosen from the fetched GitHub release list — anything else (typo, 'v' prefix mismatch, a prerelease not in the list, a version published after the list was fetched) is rejected before xray is stopped or anything is downloaded. It protects against stopping the service for an impossible update.","triggerScenarios":"Calling UpdateXray('2.1.0') when releases are tagged 'v2.1.0' or vice versa; the UI's version list is stale (fetched before a new release was published); selecting a draft/prerelease that the releases API omits; whitespace in the version string.","commonSituations":"User pastes a version from the Xray blog that differs from the GitHub tag; the panel page was open for hours and a new release came out; API returned a partial list during rate limiting.","solutions":["Refresh the version list in the panel and re-select the version from it","Match the exact GitHub tag spelling (including the leading 'v' if the list shows it)","If rate-limited earlier, wait for the window to reset so the full list is fetched"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"versions, err := s.GetXrayVersions()\nif err != nil {\n    return err\n}\nif !slices.Contains(versions, version) {\n    return fmt.Errorf(\"version %q not offered; refresh the list and pick from it\", version)\n}\n","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always re-fetch the release list immediately before an update, not at page load","Pass versions verbatim from the list to the update call — no hand-typing tags","Normalize tag spelling (leading 'v') at one place in the code"],"tags":["xray-update","validation","github-api"],"backgroundTag":null,"analyzedSha":"ad32144c42455696ea9f14e12168beac3e25f5d2","analyzedAt":"2026-08-15T11:13:23.905Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}