{"record":{"id":"f593bd8aa09dcb2e","repo":"containerd/containerd","slug":"filesystem-type-cannot-be-empty","errorCode":null,"errorMessage":"filesystem type cannot be empty","messagePattern":"filesystem type cannot be empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/snapshots/devmapper/config.go","lineNumber":122,"sourceCode":"\t\tresult = append(result, fmt.Errorf(\"pool_name is required\"))\n\t}\n\n\tif c.RootPath == \"\" {\n\t\tresult = append(result, fmt.Errorf(\"root_path is required\"))\n\t}\n\n\tif c.BaseImageSize == \"\" {\n\t\tresult = append(result, fmt.Errorf(\"base_image_size is required\"))\n\t}\n\n\tif c.FileSystemType != \"\" {\n\t\tswitch c.FileSystemType {\n\t\tcase fsTypeExt4, fsTypeXFS, fsTypeExt2:\n\t\tdefault:\n\t\t\tresult = append(result, fmt.Errorf(\"unsupported Filesystem Type: %q\", c.FileSystemType))\n\t\t}\n\t} else {\n\t\tresult = append(result, fmt.Errorf(\"filesystem type cannot be empty\"))\n\t}\n\n\treturn errors.Join(result...)\n}\n","sourceCodeStart":104,"sourceCodeEnd":127,"githubUrl":"https://github.com/containerd/containerd/blob/4246446a2bf7d03837b0244118d858799393bd80/plugins/snapshots/devmapper/config.go#L104-L127","documentation":"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.","triggerScenarios":"LoadConfig/NewSnapshotter called with c.FileSystemType == \"\" — i.e. filesystem_type key absent or empty in the plugin config.","commonSituations":"Minimal config files omitting filesystem_type assuming a default; older configs predating the required-field change; programmatic config construction with zero values.","solutions":["Explicitly set filesystem_type to \"ext4\" (the common default) in the plugin config.","Check the plugin version's docs for whether a default was previously applied and add the key after upgrade.","Run Validate locally (or LoadConfig) to confirm the full joined error list is resolved.","Add filesystem_type alongside pool_name, root_path, and base_image_size in config templates."],"exampleFix":"// before\n{\"config\":{\"pool_name\":\"pool\",\"root_path\":\"/var/lib/devmapper\",\"base_image_size\":\"10GB\"}}\n// after\n{\"config\":{\"pool_name\":\"pool\",\"root_path\":\"/var/lib/devmapper\",\"base_image_size\":\"10GB\",\"filesystem_type\":\"ext4\"}}","handlingStrategy":"validation","validationCode":"func validateFSTypePresent(cfg Config) error {\n    if cfg.FileSystemType == \"\" {\n        return errors.New(\"config: filesystem_type is required (set to \\\"ext4\\\" if unsure)\")\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"if err := cfg.Validate(); err != nil {\n    if strings.Contains(err.Error(), \"filesystem type cannot be empty\") {\n        cfg.FileSystemType = \"ext4\" // apply default and retry once\n    } else { return err }\n}","preventionTips":["Never rely on implicit defaults for filesystem_type","Set filesystem_type explicitly in all environments (dev, staging, prod)","Re-diff config files after plugin upgrades — previously optional keys may now be required","Keep the four required keys (pool_name, root_path, base_image_size, filesystem_type) in one snippet"],"tags":["devmapper","config","validation","missing-field"],"backgroundTag":"missing-config-field","analyzedSha":"4246446a2bf7d03837b0244118d858799393bd80","analyzedAt":"2026-09-02T00:14:43.053Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}