{"record":{"id":"f6b4c235985aa7df","repo":"AlistGo/alist","slug":"failed-to-upload-node-w","errorCode":null,"errorMessage":"failed to upload node: %w","messagePattern":"failed to upload node: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/doubao/util.go","lineNumber":609,"sourceCode":"\t\treturn nil, fmt.Errorf(\"failed to complete multipart upload: %w\", err)\n\t}\n\t// 提交上传\n\tif err = d._retryOperation(\"Commit upload\", func() error {\n\t\treturn d.commitMultipartUpload(config)\n\t}); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to commit upload: %w\", err)\n\t}\n\n\tup(98.0) // 更新到98%\n\t// 上传节点信息\n\tvar uploadNodeResp UploadNodeResp\n\n\tif err = d._retryOperation(\"Upload node\", func() error {\n\t\tvar err error\n\t\tuploadNodeResp, err = d.uploadNode(config, dstDir, file, dataType)\n\t\treturn err\n\t}); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to upload node: %w\", err)\n\t}\n\n\tup(100.0) // 完成上传\n\n\treturn &model.Object{\n\t\tID:       uploadNodeResp.Data.NodeList[0].ID,\n\t\tName:     uploadNodeResp.Data.NodeList[0].Name,\n\t\tSize:     file.GetSize(),\n\t\tIsFolder: false,\n\t}, nil\n}\n\n// 统一上传请求方法\nfunc (d *Doubao) uploadRequest(uploadUrl string, method string, storeInfo StoreInfo, callback base.ReqCallback, resp interface{}) ([]byte, error) {\n\tclient := resty.New()\n\tclient.SetTransport(&http.Transport{\n\t\tDisableKeepAlives: true,  // 禁用连接复用\n\t\tForceAttemptHTTP2: false, // 强制使用HTTP/1.1","sourceCodeStart":591,"sourceCodeEnd":627,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/doubao/util.go#L591-L627","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the destination folder still exists and its ID is valid, then retry the upload","Re-authenticate the Doubao driver (refresh cookies/session) so the node API call is authorized","Inspect the wrapped error from uploadNode for the specific API code and act on it (quota, invalid dir, datatype)","Retry once — transient node-service failures after successful commit are common","Report/check driver updates if the uploadNode endpoint contract changed"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := d.Put(ctx, dstDir, file, up); err != nil {\n    if strings.Contains(err.Error(), \"failed to upload node\") {\n        // bytes are committed; re-run Put to re-register the node (dedup makes the second pass fast)\n        return d.Put(ctx, dstDir, file, up)\n    }\n    return err\n}","preventionTips":["Confirm the destination folder ID exists right before starting large uploads","Don't delete/move the destination folder while uploads are in flight","Refresh driver credentials before very long upload sessions"],"tags":["doubao","upload","api-error","node-registration","go"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}