MHSanaei/3x-ui · error
download xray: unexpected HTTP %d
Error message
download xray: unexpected HTTP %d
What it means
Returned by downloadXRay when the Xray release asset URL (https://github.com/XTLS/Xray-core/releases/download/<version>/<file>) responds with anything but 200. Most often a 404: the constructed asset name does not exist for that version — typically an unsupported GOOS/GOARCH combination or a version string that isn't a real release tag. Can also be 429 rate limiting on the redirect or proxy interference.
Source
Thrown at internal/web/service/server.go:895
arch = "32"
case "s390x":
arch = "s390x"
}
fileName := fmt.Sprintf("Xray-%s-%s.zip", osName, arch)
url := fmt.Sprintf("https://github.com/XTLS/Xray-core/releases/download/%s/%s", version, fileName)
client := s.settingService.NewProxiedHTTPClient(60 * time.Second)
req, reqErr := http.NewRequestWithContext(context.Background(), http.MethodGet, url, nil)
if reqErr != nil {
return "", reqErr
}
resp, err := client.Do(req)
if err != nil {
return "", err
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
return "", fmt.Errorf("download xray: unexpected HTTP %d", resp.StatusCode)
}
if resp.ContentLength > maxXrayArchiveBytes {
return "", fmt.Errorf("download xray: archive exceeds %d bytes", maxXrayArchiveBytes)
}
file, err := os.CreateTemp("", "xray-*.zip")
if err != nil {
return "", err
}
path := file.Name()
ok := false
defer func() {
_ = file.Close()
if !ok {
_ = os.Remove(path)
}
}()
View on GitHub (pinned to ad32144c42)
Solutions
- Verify the asset exists: open https://github.com/XTLS/Xray-core/releases/tag/<version> and check the file list matches the requested OS/arch
- Pick a version that ships assets for your platform
- For 429, wait and retry; reduce automated update frequency
Defensive patterns
Strategy: validation
Validate before calling
// Verify the asset exists for this platform before updating
assetURL := fmt.Sprintf("https://github.com/XTLS/Xray-core/releases/download/%s/%s", version, fileName)
if resp, err := client.Head(assetURL); err == nil && resp.StatusCode == http.StatusNotFound {
return fmt.Errorf("no xray asset for %s/%s at %s", runtime.GOOS, runtime.GOARCH, version)
}
Prevention
- Select versions only from the fetched release list the panel shows
- Confirm your OS/arch has published assets before scripting updates
- Handle 429 from the CDN with backoff, not immediate retries
When it happens
Trigger: Updating to a version from the list whose asset naming changed (e.g. new platform suffix); running on an OS/arch XTLS does not publish (so fileName maps to nothing); GitHub download CDN throttling (429).
Common situations: Exotic architectures (armv6, riscv) with no matching asset; version/prerelease tag published without assets yet; aggressive automated downloads hitting the CDN limit.
Related errors
- GitHub API error: %s
- GitHub API returned status %d: %s
- download xray: archive exceeds %d bytes
- download xray checksum: unexpected HTTP %d
- xray version %q is not in the fetched release list
AI-assisted analysis of MHSanaei/3x-ui@ad32144c42 (2026-08-15).
Data as JSON: /api/errors/1f8e283d0ca7e32d.
Report an issue: GitHub.