juicedata/juicefs · error

get slices of inode %d index %d error: %d

Error message

get slices of inode %d index %d error: %d

What it means

During cache-fill iteration, hasNext fetches the slice list for a chunk via meta Read; a non-zero status code produces 'get slices of inode %d index %d error: %d' with the raw metadata status. This aborts iteration for that file, meaning the fill/collection cannot read the chunk's slices.

Source

Thrown at pkg/vfs/fill.go:402

		iter.err = iter.ctx.Err()
		return false
	}

	for iter.nextSliceIndex >= uint64(len(iter.slices)) {
		// Skip chunks that don't overlap any range.
		for iter.nextChunkIndex < iter.chunkCnt &&
			!iter.overlapsRange(uint64(iter.nextChunkIndex)*meta.ChunkSize, uint64(iter.nextChunkIndex+1)*meta.ChunkSize) {
			iter.nextChunkIndex++
		}
		if iter.nextChunkIndex >= iter.chunkCnt {
			return false
		}

		iter.slices = nil
		iter.nextSliceIndex = 0
		iter.sliceOffset = 0
		if st := iter.mClient.Read(iter.ctx, iter.ino, iter.nextChunkIndex, &iter.slices); st != 0 {
			iter.err = fmt.Errorf("get slices of inode %d index %d error: %d", iter.ino, iter.nextChunkIndex, st)
			logger.Error(iter.err)
			return false
		}
		iter.nextChunkIndex++
	}

	return true
}

// next returns the next slice of the current chunk together with the parts of
// its object that must be processed.
func (iter *sliceIterator) next() (meta.Slice, []chunk.Range) {
	s := iter.slices[iter.nextSliceIndex]
	iter.nextSliceIndex++
	sliceStart := uint64(iter.nextChunkIndex-1)*meta.ChunkSize + iter.sliceOffset
	iter.sliceOffset += uint64(s.Len)
	if s.Id == 0 || s.Len == 0 {
		return s, nil

View on GitHub (pinned to c9a67b23e8)

Solutions

  1. Check metadata engine health and connectivity (the status code hints at the engine error)
  2. Re-run the fill after the file settles if it was deleted/truncated concurrently
  3. Verify inode/chunk index consistency, e.g. via juicefs info or gc
  4. Inspect engine logs for the corresponding status code
Defensive patterns

Strategy: retry

Validate before calling

// verify file still exists before iterating
if st, err := fs.Stat(path); err != nil || st.Ino == 0 { skip }

Try / catch

if !iter.Next() && iter.Err() != nil { log.Warnf("fill iteration aborted: %v", iter.Err()) } // re-run later

Prevention

When it happens

Trigger: Iterate/collectSliceIDs/collectParts walking a file's chunks when the metadata engine returns an error status for Read(ino, chunkIndex) — e.g. chunk index beyond file length metadata, engine connectivity failure, or deleted inode mid-iteration.

Common situations: File truncated/deleted while prefill iteration is running; Redis/SQL engine unavailable or timing out; corrupted chunk index entries.

Related errors


AI-assisted analysis of juicedata/juicefs@c9a67b23e8 (2026-09-06). Data as JSON: /api/errors/a415fd3ab83669bb. Report an issue: GitHub.