{"record":{"id":"08a0f8dd2c0dad17","repo":"hashicorp/nomad","slug":"requested-filesystem-type-v-got-v","errorCode":null,"errorMessage":"requested filesystem type %v, got %v","messagePattern":"requested filesystem type (.+?), got (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/csi/client.go","lineNumber":605,"sourceCode":"\n\t\tif capBlock != nil && expectedBlock == nil {\n\t\t\tmultierror.Append(&err, fmt.Errorf(\n\t\t\t\t\"'block-device' access type was not requested but was validated by the controller\"))\n\t\t\tcontinue NEXT_CAP\n\t\t}\n\n\t\tif capMount == nil {\n\t\t\tcontinue NEXT_CAP\n\t\t}\n\n\t\tif expectedMount == nil {\n\t\t\tmultierror.Append(&err, fmt.Errorf(\n\t\t\t\t\"'file-system' access type was not requested but was validated by the controller\"))\n\t\t\tcontinue NEXT_CAP\n\t\t}\n\n\t\tif expectedMount.FsType != capMount.FsType {\n\t\t\tmultierror.Append(&err, fmt.Errorf(\n\t\t\t\t\"requested filesystem type %v, got %v\",\n\t\t\t\texpectedMount.FsType, capMount.FsType))\n\t\t\tcontinue NEXT_CAP\n\t\t}\n\n\t\tfor _, expectedFlag := range expectedMount.MountFlags {\n\n\t\t\t// The mount flags can contain sensitive data, so we can't log exact\n\t\t\t// details.\n\t\t\tif !slices.Contains(capMount.MountFlags, expectedFlag) {\n\t\t\t\tmultierror.Append(&err, fmt.Errorf(\n\t\t\t\t\t\"requested mount flags did not match available capabilities\"))\n\t\t\t\tcontinue NEXT_CAP\n\t\t\t}\n\t\t}\n\n\t\treturn nil\n\t}","sourceCodeStart":587,"sourceCodeEnd":623,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/plugins/csi/client.go#L587-L623","documentation":"In compareCapabilities, when both expected and validated capabilities are mount-type, Nomad compares FsType. If the filesystem type the plugin validated differs from the requested one, it appends 'requested filesystem type %v, got %v'. This means the driver validated the volume for a different filesystem than the job requires.","triggerScenarios":"ControllerValidateCapabilities request includes a mount capability with fs_type (e.g. \"xfs\") but the plugin's validated capability reports a different fs_type (e.g. \"ext4\" or empty), causing expectedMount.FsType != capMount.FsType.","commonSituations":"Driver does not honor fs_type and defaults to its own filesystem; job spec fs_type changed after volume creation but the plugin validates against the volume's actual filesystem; empty fs_type in the spec being validated as the plugin default; plugin version upgrade changing default fstype handling.","solutions":["Set fs_type explicitly in the volume capability to match what the plugin will validate (check plugin docs for supported/default fstypes)","Check the full multierror for accompanying mount-flag mismatches and correct the whole capability spec","Re-create/re-register the volume with the desired filesystem if the underlying volume was formatted differently","If the plugin ignores fs_type, upgrade the plugin or omit fs_type and accept the plugin default"],"exampleFix":"// before\ncapability { access_type = \"mount\"  access_mode = \"single-node-writer\" }\n// after: fs_type now explicit and matching the plugin's supported value\ncapability { access_type = \"mount\"  access_mode = \"single-node-writer\"  fs_type = \"ext4\" }","handlingStrategy":"validation","validationCode":"// confirm fs_type is set and supported by the driver before validating\nsupported := map[string]bool{\"ext4\": true, \"xfs\": true} // per driver docs\nfor _, cap := range req.VolumeCapabilities {\n    m := cap.GetMount()\n    if m != nil && m.GetFsType() != \"\" && !supported[m.GetFsType()] {\n        return fmt.Errorf(\"fs_type %q not supported by driver\", m.GetFsType())\n    }\n}","typeGuard":"func fsTypeMatches(expected, validated *csipbv1.VolumeCapability) bool {\n    em, vm := expected.GetMount(), validated.GetMount()\n    if em == nil || vm == nil { return true }\n    return em.GetFsType() == vm.GetFsType()\n}","tryCatchPattern":"err := client.ControllerValidateCapabilities(ctx, req)\nif err != nil {\n    if merr, ok := err.(*multierror.Error); ok {\n        for _, e := range merr.Errors {\n            if strings.Contains(e.Error(), \"requested filesystem type\") {\n                // align fs_type in the spec with the plugin's validated value\n            }\n        }\n    }\n    return err\n}","preventionTips":["Always set fs_type explicitly in mount capabilities; never rely on driver defaults","Check the driver's supported fstype list before changing it in the volume spec","Remember filesystem is fixed at volume creation; changing fs_type later requires re-creating the volume","Include fs_type consistency checks in CI for volume spec files"],"tags":["csi","filesystem","validation","mount"],"backgroundTag":"csi-capability-mismatch","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}