juicedata/juicefs · critical

The entry of the root inode was not found

Error message

The entry of the root inode was not found

What it means

During SQL metadata dump, the root inode (1) entry must be present to anchor the FSTree; if no row was found for the root inode, the dump is incomplete and this error aborts it. It protects against emitting a dump with a missing filesystem root.

Source

Thrown at pkg/meta/sql.go:4977

			}
			if err = m.dumpEntry(s, root, TypeDirectory, tree, nil); err != nil {
				return err
			}
			if root == RootInode && !skipTrash {
				trash = &DumpedEntry{
					Name: "Trash",
					Attr: &DumpedAttr{
						Inode: TrashInode,
						Type:  typeToString(TypeDirectory),
					},
				}
				if err = m.dumpEntry(s, TrashInode, TypeDirectory, trash, nil); err != nil {
					return err
				}
			}
		}
		if tree == nil {
			return errors.New("The entry of the root inode was not found")
		}
		tree.Name = "FSTree"

		var drows []delfile
		// the statement remembers the table of last Iterator
		if err := s.Table(&delfile{}).Find(&drows); err != nil {
			return err
		}
		dels := make([]*DumpedDelFile, 0, len(drows))
		for _, row := range drows {
			dels = append(dels, &DumpedDelFile{row.Inode, row.Length, row.Expire})
		}
		var crows []counter
		if err = s.Find(&crows); err != nil {
			return err
		}
		counters := &DumpedCounters{}
		for _, row := range crows {

View on GitHub (pinned to c9a67b23e8)

Solutions

  1. Verify you are dumping the intended volume (correct MySQL/Postgres/SQLite DSN and table prefix).
  2. Check the jfs_entry table for the row with inode=1; restore the root entry from a good backup if it is missing.
  3. If metadata is corrupted, restore the SQL database from a backup (juicefs backup output) before dumping.
Defensive patterns

Strategy: validation

Validate before calling

// before dumping, verify root entry exists
var n int64
db.Model(&entry{}).Where("inode = 1").Count(&n)
if n == 0 { return errors.New("root inode missing; restore from backup first") }

Prevention

When it happens

Trigger: Running `juicefs dump` against a SQL metadata engine whose jfs_entry table has no row for inode 1 (root) — e.g. severely corrupted or wrongly-initialized metadata.

Common situations: Pointing dump at the wrong/empty database schema; metadata corruption or manual deletion of the root row; restoring a broken backup into SQL then dumping it.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


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