{"record":{"id":"852934b654f16578","repo":"AlistGo/alist","slug":"wukong-commit-upload-inner-failed-s","errorCode":null,"errorMessage":"wukong commit upload inner failed: %s","messagePattern":"wukong commit upload inner failed: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/wukong/driver.go","lineNumber":472,"sourceCode":"\treturn &resp, nil\n}\n\nfunc (d *Wukong) commitUploadInner(ctx context.Context, auth *uploadAuthTokenResp, spaceName, sessionKey string) (string, error) {\n\tq := map[string]string{\n\t\t\"Action\":    \"CommitUploadInner\",\n\t\t\"Version\":   \"2020-11-19\",\n\t\t\"SpaceName\": spaceName,\n\t}\n\tbody, _ := json.Marshal(map[string]any{\n\t\t\"SessionKey\": sessionKey,\n\t\t\"Functions\":  []any{},\n\t})\n\tvar resp commitUploadInnerResp\n\tif err := d.vodRequest(ctx, http.MethodPost, q, body, auth, &resp); err != nil {\n\t\treturn \"\", err\n\t}\n\tif resp.ResponseMetadata.Error.Code != \"\" {\n\t\treturn \"\", fmt.Errorf(\"wukong commit upload inner failed: %s\", resp.ResponseMetadata.Error.Message)\n\t}\n\tif len(resp.Result.Results) > 0 {\n\t\tstatus := resp.Result.Results[0].URIStatus\n\t\tif status != 0 && status != minUploadSubmitSuccess {\n\t\t\treturn \"\", fmt.Errorf(\"wukong commit upload inner failed: uri_status=%d\", status)\n\t\t}\n\t}\n\treturn extractVideoVid(&resp), nil\n}\n\nfunc (d *Wukong) uploadSubmit(ctx context.Context, fatherID, fileName, ext string, fileType int, size int64, md5Hex, storeURI, videoVid string) error {\n\tvar resp uploadSubmitResp\n\tbody := map[string]any{\n\t\t\"base_info\": map[string]any{\n\t\t\t\"father_id\":    asIDValue(fatherID),\n\t\t\t\"file_type\":    fileType,\n\t\t\t\"size\":         size,\n\t\t\t\"extension\":    ext,","sourceCodeStart":454,"sourceCodeEnd":490,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/wukong/driver.go#L454-L490","documentation":"Thrown by commitUploadInner when the VOD CommitUploadInner action (POST with SessionKey) returns response metadata with a non-empty Error.Code. Commit finalizes the uploaded data on the VOD/TOS side; failing here means uploaded bytes never became a committed object.","triggerScenarios":"Committing with a SessionKey whose upload was incomplete or aborted; token/signature expired during a long upload; SessionKey already committed (double commit); upstream VOD error while finalizing.","commonSituations":"Multipart upload that lost parts (network drops) then committed anyway; retry logic re-committing the same session; hour-long uploads exceeding token lifetime.","solutions":["Retry the whole upload from applyUploadInner with a fresh session and token","Before commit, verify all parts/uploads succeeded (uploadToTOS/multipart finish returned nil)","Refresh auth token right before commit if the upload took long","If the error indicates duplicate commit, re-run uploadSubmit with the previously obtained StoreURI/Vid instead of restarting"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"vid, err := d.commitUploadInner(ctx, auth, spaceName, sessionKey)\nif err != nil {\n    if strings.Contains(err.Error(), \"SessionKey\") || strings.Contains(err.Error(), \"expire\") {\n        return fmt.Errorf(\"upload session invalid, restarting full upload: %w\", err)\n    }\n    time.Sleep(time.Second)\n    vid, err = d.commitUploadInner(ctx, auth, spaceName, sessionKey)\n    if err != nil { return err }\n}","preventionTips":["Only commit after every upload/finish step returned success","Detect 'session expired/invalid' errors and route the user to a full restart instead of blind retries","Refresh auth token before commit on long uploads"],"tags":["wukong","upload","vod","commit","session","go"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}