AlistGo/alist · error

failed to commit upload: %w

Error message

failed to commit upload: %w

What it means

This error is thrown by the Doubao (doubao.com) storage driver after all file parts have been uploaded and merged, when the final 'CommitUploadInner' API call that finalizes the upload session fails even after the driver's internal _retryOperation retries. It wraps the underlying commit error, so the data is on the storage server but the upload is never registered as a file node.

Source

Thrown at drivers/doubao/util.go:597

			return nil
		})
	}

	if err = threadG.Wait(); err != nil {
		return nil, err
	}
	// 完成上传-分片合并
	if err = d._retryOperation("Complete multipart upload", func() error {
		return d.completeMultipartUpload(config, uploadUrl, uploadID, parts)
	}); err != nil {
		return nil, fmt.Errorf("failed to complete multipart upload: %w", err)
	}
	// 提交上传
	if err = d._retryOperation("Commit upload", func() error {
		return d.commitMultipartUpload(config)
	}); err != nil {
		return nil, fmt.Errorf("failed to commit upload: %w", err)
	}

	up(98.0) // 更新到98%
	// 上传节点信息
	var uploadNodeResp UploadNodeResp

	if err = d._retryOperation("Upload node", func() error {
		var err error
		uploadNodeResp, err = d.uploadNode(config, dstDir, file, dataType)
		return err
	}); err != nil {
		return nil, fmt.Errorf("failed to upload node: %w", err)
	}

	up(100.0) // 完成上传

	return &model.Object{
		ID:       uploadNodeResp.Data.NodeList[0].ID,

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Retry the whole upload: since parts and merge already succeeded, a fresh Put usually gets a new upload session and commits cleanly
  2. Refresh credentials (re-login the Doubao driver) so the UploadToken/Samantha auth used by commitMultipartUpload is current
  3. Check the wrapped error message for the Doubao API code to distinguish quota/auth/expire failures
  4. Verify network reachability of the VideoHost endpoint and inspect for HTTP-level failures in logs
  5. If persistent, check for an upstream Doubao API contract change and update the driver's commit params
Defensive patterns

Strategy: retry

Try / catch

// In a wrapper around driver.Put
if err := d.Put(ctx, dstDir, file, up); err != nil {
    if strings.Contains(err.Error(), "failed to commit upload") {
        // parts are already stored server-side; a full re-Put is safe and idempotent
        time.Sleep(2 * time.Second)
        return d.Put(ctx, dstDir, file, up)
    }
    return err
}

Prevention

When it happens

Trigger: Calling Put on a Doubao mount after parts uploaded and completeMultipartUpload succeeded; commitMultipartUpload (Action=CommitUploadInner against the Samantha VideoHost endpoint) returns a non-2000 code or the HTTP request fails (expired UploadToken auth, invalid SpaceName, session already committed, network drop) and exhausts _retryOperation retries.

Common situations: Expired or stale upload token/authorization obtained earlier in the flow, Doubao API change to the CommitUploadInner action or Version string (2020-11-19), rate limiting on the commit endpoint, proxy/firewall interfering with the video-host domain, or a Doubao account out of storage quota.

Related errors


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