AlistGo/alist · error

read url failed: status=%d

Error message

read url failed: status=%d

What it means

Error "read url failed: status=%d" thrown in AlistGo/alist.

Source

Thrown at drivers/strm/util.go:262

	}
	if link.URL == "" {
		return nil, fmt.Errorf("empty link")
	}
	url := link.URL
	if !strings.HasPrefix(url, "http://") && !strings.HasPrefix(url, "https://") {
		api := common.GetApiUrl(nil)
		if api == "" {
			return nil, fmt.Errorf("relative url without site url: %s", url)
		}
		url = strings.TrimSuffix(api, "/") + url
	}
	res, err := base.RestyClient.R().SetContext(ctx).SetDoNotParseResponse(true).Get(url)
	if err != nil {
		return nil, err
	}
	defer res.RawBody().Close()
	if res.StatusCode() >= http.StatusBadRequest {
		return nil, fmt.Errorf("read url failed: status=%d", res.StatusCode())
	}
	return io.ReadAll(res.RawBody())
}

func (d *Strm) writeLocal(path string, payload []byte, mode string) error {
	if mode == SaveLocalInsertMode && utils.Exists(path) {
		return nil
	}
	if st, err := os.Stat(path); err == nil && st.IsDir() {
		if mode != SaveLocalSyncMode {
			return nil
		}
		if err = os.RemoveAll(path); err != nil {
			return err
		}
	}
	if mode != SaveLocalInsertMode {
		if old, err := os.ReadFile(path); err == nil {

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Inspect the underlying error details in the message, fix the indicated cause (credentials, network, or provider-side failure), and retry.

When it happens

Trigger: Thrown at drivers/strm/util.go:262 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15). Data as JSON: /api/errors/7e712a44293f65b4. Report an issue: GitHub.