AlistGo/alist · error

failed to upload node: %w

Error message

failed to upload node: %w

What it means

Thrown by the Doubao driver when the last step of an upload — registering the uploaded object as a file node in the destination folder (uploadNode) — fails after internal retries. The bytes are stored and committed, but the file never appears in the listing because no node was created.

Source

Thrown at drivers/doubao/util.go:609

		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,
		Name:     uploadNodeResp.Data.NodeList[0].Name,
		Size:     file.GetSize(),
		IsFolder: false,
	}, nil
}

// 统一上传请求方法
func (d *Doubao) uploadRequest(uploadUrl string, method string, storeInfo StoreInfo, callback base.ReqCallback, resp interface{}) ([]byte, error) {
	client := resty.New()
	client.SetTransport(&http.Transport{
		DisableKeepAlives: true,  // 禁用连接复用
		ForceAttemptHTTP2: false, // 强制使用HTTP/1.1

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Verify the destination folder still exists and its ID is valid, then retry the upload
  2. Re-authenticate the Doubao driver (refresh cookies/session) so the node API call is authorized
  3. Inspect the wrapped error from uploadNode for the specific API code and act on it (quota, invalid dir, datatype)
  4. Retry once — transient node-service failures after successful commit are common
  5. Report/check driver updates if the uploadNode endpoint contract changed
Defensive patterns

Strategy: retry

Try / catch

if err := d.Put(ctx, dstDir, file, up); err != nil {
    if strings.Contains(err.Error(), "failed to upload node") {
        // bytes are committed; re-run Put to re-register the node (dedup makes the second pass fast)
        return d.Put(ctx, dstDir, file, up)
    }
    return err
}

Prevention

When it happens

Trigger: Put into a Doubao drive where uploadNode(config, dstDir, file, dataType) fails: dstDir folder ID invalid or deleted mid-upload, dataType mismatch (e.g. uploading a video-ineligible file as video), session/auth expired between commit and node registration, or the API returns a non-success code.

Common situations: Destination folder was removed or moved while a large file was uploading, cookie/session for the web API expired, uploading a file type the node API rejects, or a Doubao frontend API change breaking the uploadNode endpoint shape.

Related errors


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