{"record":{"id":"5f94bb7f4d2e118f","repo":"AlistGo/alist","slug":"failed-to-commit-upload-w","errorCode":null,"errorMessage":"failed to commit upload: %w","messagePattern":"failed to commit upload: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/doubao/util.go","lineNumber":597,"sourceCode":"\n\t\t\treturn nil\n\t\t})\n\t}\n\n\tif err = threadG.Wait(); err != nil {\n\t\treturn nil, err\n\t}\n\t// 完成上传-分片合并\n\tif err = d._retryOperation(\"Complete multipart upload\", func() error {\n\t\treturn d.completeMultipartUpload(config, uploadUrl, uploadID, parts)\n\t}); err != nil {\n\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,","sourceCodeStart":579,"sourceCodeEnd":615,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/doubao/util.go#L579-L615","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Retry the whole upload: since parts and merge already succeeded, a fresh Put usually gets a new upload session and commits cleanly","Refresh credentials (re-login the Doubao driver) so the UploadToken/Samantha auth used by commitMultipartUpload is current","Check the wrapped error message for the Doubao API code to distinguish quota/auth/expire failures","Verify network reachability of the VideoHost endpoint and inspect for HTTP-level failures in logs","If persistent, check for an upstream Doubao API contract change and update the driver's commit params"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// In a wrapper around driver.Put\nif err := d.Put(ctx, dstDir, file, up); err != nil {\n    if strings.Contains(err.Error(), \"failed to commit upload\") {\n        // parts are already stored server-side; a full re-Put is safe and idempotent\n        time.Sleep(2 * time.Second)\n        return d.Put(ctx, dstDir, file, up)\n    }\n    return err\n}","preventionTips":["Keep the Doubao driver session fresh; commit failures often stem from expired UploadToken auth","Avoid uploading the same file to the same path concurrently from multiple clients","Treat any wrapped 'commit' error as retriable-with-full-restart, not as partial state to resume manually"],"tags":["doubao","upload","api-error","go","storage-driver"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}