{"record":{"id":"42ae192f7b530556","repo":"AlistGo/alist","slug":"doubao-new-payload-checksum-mismatch-seq-d-sta","errorCode":null,"errorMessage":"[doubao_new] payload checksum mismatch: seq=%d start=%d end=%d adler32=%s step2=%s","messagePattern":"\\[doubao_new\\] payload checksum mismatch: seq=(.+?) start=(.+?) end=(.+?) adler32=(.+?) step2=(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/doubao_new/driver.go","lineNumber":368,"sourceCode":"\t\t\tbuf := make([]byte, int(item.Size))\n\t\t\tn, err := tmpFile.ReadAt(buf, offset)\n\t\t\tif err != nil && err != io.EOF && err != io.ErrUnexpectedEOF {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif n != len(buf) {\n\t\t\t\treturn nil, fmt.Errorf(\"[doubao_new] short read: seq=%d want=%d got=%d\", item.Seq, len(buf), n)\n\t\t\t}\n\t\t\tbuf = buf[:n]\n\t\t\trealAdler := adler32String(buf)\n\t\t\tif realAdler != item.Checksum {\n\t\t\t\treturn nil, fmt.Errorf(\"[doubao_new] block checksum mismatch: seq=%d offset=%d adler32=%s step2=%s\", item.Seq, offset, realAdler, item.Checksum)\n\t\t\t}\n\t\t\tpayloadStart := groupBuf.Len()\n\t\t\tgroupBuf.Write(buf)\n\t\t\tpayloadEnd := groupBuf.Len()\n\t\t\tpayloadAdler := adler32String(groupBuf.Bytes()[payloadStart:payloadEnd])\n\t\t\tif payloadAdler != item.Checksum {\n\t\t\t\treturn nil, fmt.Errorf(\"[doubao_new] payload checksum mismatch: seq=%d start=%d end=%d adler32=%s step2=%s\", item.Seq, payloadStart, payloadEnd, payloadAdler, item.Checksum)\n\t\t\t}\n\t\t\tgroupSeqs = append(groupSeqs, item.Seq)\n\t\t\tgroupChecksums = append(groupChecksums, item.Checksum)\n\t\t\tgroupSizes = append(groupSizes, item.Size)\n\t\t\tgroupRealSize += int64(n)\n\t\t\tgroupExpectSum += item.Size\n\t\t\tif len(groupSeqs) >= maxMergeBlockCount {\n\t\t\t\tif err := flushGroup(); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif err := flushGroup(); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif up != nil {\n\t\t\tup(100)","sourceCodeStart":350,"sourceCodeEnd":386,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/doubao_new/driver.go#L350-L386","documentation":"Second adler32 check in doubao_new: after appending the verified block into the shared groupBuf merge buffer, the hash of the appended slice (payloadStart..payloadEnd) no longer equals item.Checksum. Since the same bytes passed check 694 moments before, this fires when the buffer's memory was mutated concurrently or the slice bookkeeping is wrong.","triggerScenarios":"Concurrent goroutines writing into groupBuf without synchronization, payloadStart/payloadEnd captured incorrectly after a buffer growth/copy, or (rare) a bug where buf was resliced between the two hash computations. This is essentially an internal-consistency assertion, not a network error.","commonSituations":"Almost always a driver bug report candidate: it indicates a data race or slice-aliasing issue in the group buffering logic, occasionally triggered by memory pressure or a changed adler32String implementation.","solutions":["Retry the upload — races are intermittent and usually pass","Report upstream as a likely data race; include file size, block size, and whether parallel uploads were active","Update to the latest doubao_new driver revision where buffer handling may be fixed","As a workaround, disable concurrent upload tasks for this mount while uploading","Run OpenList with the race detector enabled if you can reproduce locally to confirm the race"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// single-writer discipline for the merge buffer: only flushGroup touches groupBuf\n// assert invariance cheaply before flush\nif groupBuf.Len() != int(groupExpectSum) {\n    return fmt.Errorf(\"group buffer desynced: len=%d expect=%d\", groupBuf.Len(), groupExpectSum)\n}","typeGuard":null,"tryCatchPattern":"if err := flushGroup(); err != nil && strings.Contains(err.Error(), \"payload checksum mismatch\") {\n    // intermittent by nature (race); one retry is cheap, persistent failure is a bug report\n    return d.uploadPass(ctx, ...)\n}","preventionTips":["Never append to groupBuf from multiple goroutines","Serialize uploads to one mount when this error appears","Report reproducible cases upstream — run with -race to confirm"],"tags":["doubao-new","upload","adler32","data-race","integrity","go"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}