hashicorp/nomad · error

insufficient disk space: have %d bytes available, need at le

Error message

insufficient disk space: have %d bytes available, need at least %d bytes (BoltDB size %d + %d buffer)

What it means

Fires in preflightChecks when free space on the raft directory is less than the BoltDB size plus the required buffer: the WAL migration could fill the disk, so it refuses to start.

Source

Thrown at helper/raftutil/migrate.go:217

		return fmt.Errorf("insufficient write permissions in %s: %w", raftDir, err)
	}
	os.Remove(testFile)

	// Check available disk space.
	usage, err := disk.Usage(raftDir)
	if err != nil {
		// Log warning but don't fail migration - disk space check is advisory.
		return fmt.Errorf("unable to check available disk space: %w", err)
	}
	availableSpace := usage.Free

	boltSize := uint64(boltInfo.Size())

	// Require at least the BoltDB size + minimum free space buffer.
	// WAL format is typically similar in size to BoltDB, but we add a buffer.
	requiredSpace := boltSize + minRequiredSpace
	if availableSpace < requiredSpace {
		return fmt.Errorf(
			"insufficient disk space: have %d bytes available, need at least %d bytes (BoltDB size %d + %d buffer)",
			availableSpace, requiredSpace, boltSize, minRequiredSpace)
	}

	return nil
}

// cleanupWAL removes the WAL directory, retrying on Windows to handle
// delayed file handle releases.
func cleanupWAL(walDir string) {
	// First attempt immediate cleanup.
	if err := os.RemoveAll(walDir); err == nil {
		return
	}

	// On failure (common on Windows), retry with delays.
	for range 3 {
		time.Sleep(100 * time.Millisecond)

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Free disk space on the raft volume until available bytes exceed BoltDB size plus the minimum buffer
  2. Move or shrink the BoltDB store (e.g. take and restore a snapshot) before migrating
  3. Extend the underlying disk/partition
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at helper/raftutil/migrate.go:217 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04). Data as JSON: /api/errors/99110e9dfe0f42d4. Report an issue: GitHub.