{"record":{"id":"565a896888c4f85e","repo":"hashicorp/nomad","slug":"invalid-mount-type-must-be-bind-volume-tmp","errorCode":null,"errorMessage":"invalid mount type, must be \"bind\", \"volume\", \"tmpfs\": %q","messagePattern":"invalid mount type, must be \"bind\", \"volume\", \"tmpfs\": %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/docker/config.go","lineNumber":638,"sourceCode":"\t\t\tDriverConfig: &mount.Driver{\n\t\t\t\tName:    vo.DriverConfig.Name,\n\t\t\t\tOptions: vo.DriverConfig.Options,\n\t\t\t},\n\t\t}\n\tcase \"bind\":\n\t\thm.BindOptions = &mount.BindOptions{\n\t\t\tPropagation: mount.Propagation(m.BindOptions.Propagation),\n\t\t}\n\tcase \"tmpfs\":\n\t\tif m.Source != \"\" {\n\t\t\treturn hm, fmt.Errorf(`invalid source, must be \"\" for tmpfs`)\n\t\t}\n\t\thm.TmpfsOptions = &mount.TmpfsOptions{\n\t\t\tSizeBytes: m.TmpfsOptions.SizeBytes,\n\t\t\tMode:      fs.FileMode(m.TmpfsOptions.Mode),\n\t\t}\n\tdefault:\n\t\treturn hm, fmt.Errorf(`invalid mount type, must be \"bind\", \"volume\", \"tmpfs\": %q`, m.Type)\n\t}\n\n\treturn hm, nil\n}\n\ntype DockerVolumeOptions struct {\n\tNoCopy       bool                     `codec:\"no_copy\"`\n\tLabels       hclutils.MapStrStr       `codec:\"labels\"`\n\tDriverConfig DockerVolumeDriverConfig `codec:\"driver_config\"`\n}\n\ntype DockerBindOptions struct {\n\tPropagation string `codec:\"propagation\"`\n}\n\ntype DockerTmpfsOptions struct {\n\tSizeBytes int64 `codec:\"size\"`\n\tMode      int   `codec:\"mode\"`","sourceCodeStart":620,"sourceCodeEnd":656,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/drivers/docker/config.go#L620-L656","documentation":"Each Nomad mount block must declare type as one of \"bind\", \"volume\", or \"tmpfs\". toDockerMountConfig's switch on m.Type has no matching case for other values, so the driver rejects the mount with this error rather than sending an undefined mount type to Docker.","triggerScenarios":"A mount block sets type to a misspelled or unsupported value such as \"Tmpfs\", \"TMPFS\", \"tmpfs \" (trailing space), \"nfs\", or another value outside the three allowed ones.","commonSituations":"Typos or wrong casing in HCL job files; copying Docker Compose volume types (like 'npipe') into Nomad; assuming more mount types exist than this driver supports.","solutions":["Set type to exactly \"bind\", \"volume\", or \"tmpfs\" (lowercase).","Re-check spelling/whitespace in the mount stanza.","Consult the Nomad docker driver mount docs for the supported set."],"exampleFix":"// before\nmount {\n  type   = \"Tmpfs\"\n  target = \"/cache\"\n}\n// after\nmount {\n  type   = \"tmpfs\"\n  target = \"/cache\"\n}","handlingStrategy":"validation","validationCode":"var allowed = map[string]bool{\"bind\": true, \"volume\": true, \"tmpfs\": true}\nif !allowed[m.Type] {\n  return fmt.Errorf(\"unsupported mount type %q\", m.Type)\n}","typeGuard":"func isMountType(s string) bool {\n  switch s { case \"bind\", \"volume\", \"tmpfs\": return true }\n  return false\n}","tryCatchPattern":null,"preventionTips":["Use only lowercase \"bind\"/\"volume\"/\"tmpfs\".","Trim whitespace from config values.","Reject unknown types at job submission with a pre-flight linter."],"tags":["docker","mount","validation","nomad"],"backgroundTag":"invalid-config-value","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"}