AlistGo/alist · error

fileRsp.Msg

Error message

fileRsp.Msg

What it means

Returned by ChaoXing Put after the raw multipart POST to https://pan-yz.chaoxing.com/upload when the parsed UploadFileDataRsp.Msg is anything other than "success". The storage server received the bytes but rejected finalizing the object.

Source

Thrown at drivers/chaoxing/driver.go:279

	}
	req.Header.Set("Content-Type", writer.FormDataContentType())
	req.Header.Set("Content-Length", fmt.Sprintf("%d", body.Len()))
	resps, err := http.DefaultClient.Do(req)
	if err != nil {
		return err
	}
	defer resps.Body.Close()
	bodys, err := io.ReadAll(resps.Body)
	if err != nil {
		return err
	}
	var fileRsp UploadFileDataRsp
	err = json.Unmarshal(bodys, &fileRsp)
	if err != nil {
		return err
	}
	if fileRsp.Msg != "success" {
		return errors.New(fileRsp.Msg)
	}
	uploadDoneParam := UploadDoneParam{Key: fileRsp.ObjectID, Cataid: "100000019", Param: fileRsp.Data}
	params, err := json.Marshal(uploadDoneParam)
	if err != nil {
		return err
	}
	query := map[string]string{
		"bbsid":  d.Addition.Bbsid,
		"pid":    dstDir.GetID(),
		"type":   "yunpan",
		"params": url.QueryEscape("[" + string(params) + "]"),
	}
	var respd ListFileResp
	_, err = d.request("/pc/resource/addResource", http.MethodGet, func(req *resty.Request) {
		req.SetQueryParams(query)
	}, &respd)
	if err != nil {
		return err

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Retry the whole Put operation from scratch so a fresh upload token is fetched
  2. Confirm the ChaoXing account has free quota and the file is under size limits
  3. Re-login the storage if token-related messages recur
  4. Reduce contention: upload sequentially, since tokens are single-use
Defensive patterns

Strategy: retry

Validate before calling

null

Try / catch

if err := d.Put(ctx, dst, f, up); err != nil {
    var msg string
    if errors.As(err, &msg) {}; // err already carries fileRsp.Msg text
    if strings.Contains(err.Error(), "token") || strings.Contains(err.Error(), "失效") { retry whole Put once }
}

Prevention

When it happens

Trigger: The upload server rejects the multipart body (wrong/expired _token or puid form fields, malformed chunk, size/quota exceeded), returning a JSON body whose Msg is an error string.

Common situations: Slow upload exceeding the upload-token TTL so the finalize step fails; session rotated between getUploadConfig and the POST; quota exhaustion on the ChaoXing drive.

Related errors


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