AlistGo/alist · error

upload part failed: %s

Error message

upload part failed: %s

What it means

Returned by uploadPart when the server responded to a part 'phase=transfer' POST with a business code other than 2000. The part bytes were not (or not reliably) accepted; the message is the server's own explanation.

Source

Thrown at drivers/doubao/util.go:711

			"Content-Disposition": fmt.Sprintf("attachment; filename=%s", url.QueryEscape(storeInfo.StoreURI)),
		})

		req.SetQueryParams(map[string]string{
			"uploadid":    uploadID,
			"part_number": strconv.FormatInt(partNumber, 10),
			"phase":       "transfer",
		})

		req.SetBody(data)
		req.SetContentLength(true)
	}, &uploadResp)

	if err != nil {
		return resp, err
	}

	if uploadResp.Code != 2000 {
		return resp, fmt.Errorf("upload part failed: %s", uploadResp.Message)
	} else if uploadResp.Data.Crc32 != crc32Value {
		return resp, fmt.Errorf("upload part failed: crc32 mismatch, expected %s, got %s", crc32Value, uploadResp.Data.Crc32)
	}

	return uploadResp.Data, nil
}

// 完成分片上传
func (d *Doubao) completeMultipartUpload(config *UploadConfig, uploadUrl, uploadID string, parts []UploadPart) error {
	uploadResp := UploadResp{}

	storeInfo := config.InnerUploadAddress.UploadNodes[0].StoreInfos[0]

	body := _convertUploadParts(parts)

	err := utils.Retry(MaxRetryAttempts, time.Second, func() (err error) {
		_, err = d.uploadRequest(uploadUrl, http.MethodPost, storeInfo, func(req *resty.Request) {
			req.SetQueryParams(map[string]string{

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Retry the part (already done by _retryOperation; if it still fails, treat as persistent)
  2. Check the server message for quota/auth specifics and address those
  3. Reduce chunk size configuration so each part is comfortably under node limits
  4. Re-init the upload session with a fresh token if the error indicates session expiry
  5. Re-authenticate the driver if auth-related
Defensive patterns

Strategy: retry

Try / catch

// part upload already runs under _retryOperation; on final failure fall back to smaller chunks
if err := uploadAllParts(chunkSize); err != nil && strings.Contains(err.Error(), "upload part failed") {
    return uploadAllParts(chunkSize / 2)
}

Prevention

When it happens

Trigger: Uploading a single chunk within _retryOperation where the part auth is stale, the part number/offset violates server expectations, body too large for the node, storage quota exceeded, or the server rejects the Content-Length handling (req.SetContentLength(true)) for this node.

Common situations: One flaky upload node among UploadNodes rejects parts intermittently, chunk size tuned larger than the node accepts, quota exhausted mid-upload, or session expiry during long multi-part uploads of large files.

Related errors


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