AlistGo/alist · error

[doubao_new] missing block meta for seq %d

Error message

[doubao_new] missing block meta for seq %d

What it means

Doubao_new incremental upload bookkeeping error: the server's NeededUploadBlocks list references a block seq that has no entry in the local blockMeta map built during upload preparation. The client cannot produce the metadata (checksum/size) needed to upload that block.

Source

Thrown at drivers/doubao_new/driver.go:344

			}

			uploadedBytes += groupRealSize
			groupSeqs = groupSeqs[:0]
			groupChecksums = groupChecksums[:0]
			groupSizes = groupSizes[:0]
			groupRealSize = 0
			groupExpectSum = 0
			groupBuf.Reset()
			if up != nil {
				percent := float64(uploadedBytes) / float64(totalSize) * 100
				up(percent)
			}
			return nil
		}

		for _, item := range needed.NeededUploadBlocks {
			if _, ok := blockMeta[item.Seq]; !ok {
				return nil, fmt.Errorf("[doubao_new] missing block meta for seq %d", item.Seq)
			}
			if item.Size <= 0 {
				return nil, fmt.Errorf("[doubao_new] invalid block size from needed list: seq=%d size=%d", item.Seq, item.Size)
			}
			offset := int64(item.Seq) * blockSize
			buf := make([]byte, int(item.Size))
			n, err := tmpFile.ReadAt(buf, offset)
			if err != nil && err != io.EOF && err != io.ErrUnexpectedEOF {
				return nil, err
			}
			if n != len(buf) {
				return nil, fmt.Errorf("[doubao_new] short read: seq=%d want=%d got=%d", item.Seq, len(buf), n)
			}
			buf = buf[:n]
			realAdler := adler32String(buf)
			if realAdler != item.Checksum {
				return nil, fmt.Errorf("[doubao_new] block checksum mismatch: seq=%d offset=%d adler32=%s step2=%s", item.Seq, offset, realAdler, item.Checksum)
			}

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Retry the entire upload (fresh prep + fresh needed query yields consistent views)
  2. Ensure the source file is not modified during upload; upload a snapshot/copy instead
  3. If it reproduces deterministically for one file, capture prep and needed-list responses and report the driver inconsistency
  4. Update the doubao_new driver — prep/needed consistency handling improved in later revisions
  5. Check that file size >= (maxSeq+1)*blockSize expectations; a truncated file can make server seqs exceed local meta
Defensive patterns

Strategy: validation

Validate before calling

// before the needed-blocks loop, assert coverage
maxSeq := 0
for seq := range blockMeta {
    if seq > maxSeq { maxSeq = seq }
}
if int64(maxSeq)*blockSize+maxBlockSize > fileSize+blockSize {
    return fmt.Errorf("block meta inconsistent with file size; re-run prep")
}

Try / catch

if err := uploadNeeded(...); err != nil && strings.Contains(err.Error(), "missing block meta") {
    return d.uploadPass(ctx, ...) // fresh prep + needed query restores consistency
}

Prevention

When it happens

Trigger: The upload-prep phase populated blockMeta from one view of the file's blocks, then the needed-list query returned seqs outside that set — file grew/shrank between prep and upload, block size changed between calls, or a stale prep response was reused after a retry loop iteration.

Common situations: Uploading a file that is still being written (log files, exports), retry loops that reuse an old uploadPrep after the server rotated the session, or driver bug where blockMeta is keyed by different seq granularity than the needed list.

Related errors


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