AlistGo/alist · error

upload request failed: %w

Error message

upload request failed: %w

What it means

Low-level transport error from the Doubao driver's shared uploadRequest helper: resty's req.Execute failed with something other than io.EOF (which is tolerated because the upload endpoints sometimes return empty bodies). This is the generic network/HTTP failure underneath every upload step (init, part, finish, commit).

Source

Thrown at drivers/doubao/util.go:655

		"X-Storage-U":   d.UserId,
		"Authorization": storeInfo.Auth,
	})

	if method == http.MethodPost {
		req.SetHeader("Content-Type", "text/plain;charset=UTF-8")
	}

	if callback != nil {
		callback(req)
	}

	if resp != nil {
		req.SetResult(resp)
	}

	res, err := req.Execute(method, uploadUrl)
	if err != nil && err != io.EOF {
		return nil, fmt.Errorf("upload request failed: %w", err)
	}

	return res.Body(), nil
}

// 初始化分片上传
func (d *Doubao) initMultipartUpload(config *UploadConfig, uploadUrl string, storeInfo StoreInfo) (uploadId string, err error) {
	uploadResp := UploadResp{}

	_, err = d.uploadRequest(uploadUrl, http.MethodPost, storeInfo, func(req *resty.Request) {
		req.SetQueryParams(map[string]string{
			"uploadmode": "part",
			"phase":      "init",
		})
	}, &uploadResp)

	if err != nil {
		return uploadId, err

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Retry the operation — transient network failures usually clear; the caller _retryOperation already retries, so persistent failure means a real connectivity issue
  2. Check the wrapped error: timeouts suggest raising UploadTimeout for large parts; connection refused/DNS errors suggest firewall or DNS problems
  3. Verify the uploadUrl from the upload config is still valid (they can expire); re-fetch upload config
  4. Test reachability of the upload host from the host running OpenList
  5. If behind a proxy, ensure it permits large POST bodies to the video CDN host
Defensive patterns

Strategy: retry

Validate before calling

// sanity-check the upload URL before use
u, err := url.Parse(uploadUrl)
if err != nil || u.Scheme == "" || u.Host == "" {
    return fmt.Errorf("invalid upload url: %q", uploadUrl)
}

Try / catch

// _retryOperation already retries; add outer backoff for persistent transport errors
if err := operation(); err != nil {
    if isTransportErr(err) { // net.Error, timeouts, connection reset
        time.Sleep(backoff)
        return operation()
    }
    return err
}

Prevention

When it happens

Trigger: Any uploadRequest call (POST with part/transfer/finish/commit phases to the upload host) where the TCP/TLS connection fails, times out after UploadTimeout, the host header resolution fails (strings.Split(uploadUrl, "/")[2] yields a bad Host), or the server resets the connection.

Common situations: Slow or unstable network during large multipart uploads, upload host blocked by firewall/GFW-adjacent filtering, forced HTTP/1.1 + DisableKeepAlives interacting badly with middleboxes, DNS issues, or an upload URL that has expired between fetching upload config and using it.

Related errors


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