AlistGo/alist · error

upload failed, empty response

Error message

upload failed, empty response

What it means

Thrown by ILanZou's upload completion path after polling POST /7n/results: the API answered but resp.List is empty, so there is no upload-status record to inspect. The token-based poll found no matching upload result for the token submitted.

Source

Thrown at drivers/ilanzou/driver.go:365

		}
		token = utils.Json.Get(res.Body(), "token").ToString()
	}
	// commit upload
	var resp UploadResultResp
	for i := 0; i < 10; i++ {
		_, err = d.unproved("/7n/results", http.MethodPost, func(req *resty.Request) {
			params := []string{
				"tokenList=" + token,
				"tokenTime=" + time.Now().Format("Mon Jan 02 2006 15:04:05 GMT-0700 (MST)"),
			}
			queryString := strings.Join(params, "&")
			req.SetQueryString(queryString).SetResult(&resp)
		})
		if err != nil {
			return nil, err
		}
		if len(resp.List) == 0 {
			return nil, fmt.Errorf("upload failed, empty response")
		}
		if resp.List[0].Status == 1 {
			break
		}
		time.Sleep(time.Second * 1)
	}
	file := resp.List[0]
	if file.Status != 1 {
		return nil, fmt.Errorf("upload failed, status: %d", resp.List[0].Status)
	}
	return &model.Object{
		ID: strconv.FormatInt(file.FileId, 10),
		//Path:     ,
		Name:     file.FileName,
		Size:     s.GetSize(),
		Modified: s.ModTime(),
		Ctime:    s.CreateTime(),
		IsFolder: false,

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Retry the whole upload from the start — an empty result list is not recoverable by further polling.
  2. Verify the token and tokenTime encoding match what the upload step returned (exact format string, URL-encoding of the token).
  3. If persistent, capture the raw /7n/results response body — a login/API-contract change may be returning an error envelope that decodes to an empty list.
  4. Check the driver version for fixes to the results-polling contract.
Defensive patterns

Strategy: retry

Try / catch

obj, err := d.Put(ctx, dstDir, stream, up)
if err != nil && strings.Contains(err.Error(), "upload failed, empty response") {
    stream.Reset() // if the stream supports re-reading
    obj, err = d.Put(ctx, dstDir, stream, up)
}
if err != nil { return err }

Prevention

When it happens

Trigger: Polling too early or after the server expired the result record; the token from the upload phase mismatched (encoding issue in the tokenList param); upload actually failed server-side and the result entry was never created.

Common situations: The 1-second poll loop iterating many times until the record expires; time skew in tokenTime (formatted in MST) causing token rejection; upstream API change dropping the results endpoint contract.

Related errors


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