anomalyco/sst · error

bad status: %s

Error message

bad status: %s

What it means

Inside InstallBun's download task, after http.Get to the bun release URL, any status other than 200 is surfaced as 'bad status: <code and text>'. It means the GitHub release asset could not be fetched as expected.

Source

Thrown at pkg/global/bun.go:115

			filename = "bun-windows-x64.zip"
		}
	default:
	}
	if filename == "" {
		return fmt.Errorf("unsupported platform: %s %s", goos, arch)
	}
	slog.Info("bun selected", "filename", filename)

	_, err := task.Run(ctx, func() (any, error) {
		url := "https://github.com/oven-sh/bun/releases/download/bun-v" + BUN_VERSION + "/" + filename
		slog.Info("bun downloading", "url", url)
		response, err := http.Get(url)
		if err != nil {
			return nil, err
		}
		defer response.Body.Close()
		if response.StatusCode != http.StatusOK {
			return nil, fmt.Errorf("bad status: %s", response.Status)
		}
		bodyBytes, err := io.ReadAll(response.Body)
		if err != nil {
			return nil, err
		}
		readerAt := bytes.NewReader(bodyBytes)
		zipReader, err := zip.NewReader(readerAt, readerAt.Size())
		if err != nil {
			return nil, err
		}
		for _, file := range zipReader.File {
			filename := filepath.Base(file.Name)
			if filename == "bun" || filename == "bun.exe" {
				f, err := file.Open()
				if err != nil {
					return nil, err
				}
				defer f.Close()

View on GitHub (pinned to a0bd20f762)

Solutions

  1. Check network access to github.com and the exact URL in a browser/curl
  2. Retry later if rate-limited (403) or set GITHUB token-aware download
  3. Update or pin BUN_VERSION to an existing release
  4. Configure HTTPS_PROXY to a working egress proxy

Example fix

// before
$ curl -I https://github.com/oven-sh/bun/releases/download/bun-v9.9.9/bun-linux-x64.zip
404 Not Found
// after
// use an existing version
const BUN_VERSION = "1.1.29" // valid release tag
Defensive patterns

Strategy: retry

Validate before calling

resp, err := http.Head(url)
if err != nil || resp.StatusCode != http.StatusOK {
    return fmt.Errorf("download URL unavailable: %s", url)
}
resp.Body.Close()

Try / catch

response, err := http.Get(url)
if err != nil {
    return err
}
defer response.Body.Close()
if response.StatusCode != http.StatusOK {
    return fmt.Errorf("bun download failed (%s); check network/proxy or version", response.Status)
}

Prevention

When it happens

Trigger: http.Get to https://github.com/oven-sh/bun/releases/download/bun-v<ver>/<file> returning 404 (bad BUN_VERSION or filename), 403 (rate limited), 5xx, or a proxy error page.

Common situations: Corporate proxy/firewall intercepting github.com; GitHub rate limiting shared CI IPs; pinned BUN_VERSION whose release assets were removed; DNS hijack captive portals returning HTML with 200? (no — those hit 403/502 typically); offline environments.

Understand the failure class

Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.

Related errors


AI-assisted analysis of anomalyco/sst@a0bd20f762 (2026-08-30). Data as JSON: /api/errors/547df085d0d6f7c8. Report an issue: GitHub.