containerd/containerd · error

filesystem type cannot be empty

Error message

filesystem type cannot be empty

What it means

Validate() treats an empty FilesystemType as invalid: unlike optional fields, the snapshotter requires an explicit filesystem because it formats thin devices at snapshot creation. It throws this in the else branch of the filesystem-type check.

Source

Thrown at plugins/snapshots/devmapper/config.go:122

		result = append(result, fmt.Errorf("pool_name is required"))
	}

	if c.RootPath == "" {
		result = append(result, fmt.Errorf("root_path is required"))
	}

	if c.BaseImageSize == "" {
		result = append(result, fmt.Errorf("base_image_size is required"))
	}

	if c.FileSystemType != "" {
		switch c.FileSystemType {
		case fsTypeExt4, fsTypeXFS, fsTypeExt2:
		default:
			result = append(result, fmt.Errorf("unsupported Filesystem Type: %q", c.FileSystemType))
		}
	} else {
		result = append(result, fmt.Errorf("filesystem type cannot be empty"))
	}

	return errors.Join(result...)
}

View on GitHub (pinned to 4246446a2b)

Solutions

  1. Explicitly set filesystem_type to "ext4" (the common default) in the plugin config.
  2. Check the plugin version's docs for whether a default was previously applied and add the key after upgrade.
  3. Run Validate locally (or LoadConfig) to confirm the full joined error list is resolved.
  4. Add filesystem_type alongside pool_name, root_path, and base_image_size in config templates.

Example fix

// before
{"config":{"pool_name":"pool","root_path":"/var/lib/devmapper","base_image_size":"10GB"}}
// after
{"config":{"pool_name":"pool","root_path":"/var/lib/devmapper","base_image_size":"10GB","filesystem_type":"ext4"}}
Defensive patterns

Strategy: validation

Validate before calling

func validateFSTypePresent(cfg Config) error {
    if cfg.FileSystemType == "" {
        return errors.New("config: filesystem_type is required (set to \"ext4\" if unsure)")
    }
    return nil
}

Try / catch

if err := cfg.Validate(); err != nil {
    if strings.Contains(err.Error(), "filesystem type cannot be empty") {
        cfg.FileSystemType = "ext4" // apply default and retry once
    } else { return err }
}

Prevention

When it happens

Trigger: LoadConfig/NewSnapshotter called with c.FileSystemType == "" — i.e. filesystem_type key absent or empty in the plugin config.

Common situations: Minimal config files omitting filesystem_type assuming a default; older configs predating the required-field change; programmatic config construction with zero values.

Related errors


AI-assisted analysis of containerd/containerd@4246446a2b (2026-09-02). Data as JSON: /api/errors/f593bd8aa09dcb2e. Report an issue: GitHub.