{"record":{"id":"6091426abb4bc7ed","repo":"hashicorp/nomad","slug":"not-src-destination-format","errorCode":null,"errorMessage":"not <src>:<destination> format","messagePattern":"not <src>:<destination> format","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/docker/utils.go","lineNumber":300,"sourceCode":"\n\tif filepath.IsAbs(dir) {\n\t\treturn filepath.Clean(dir)\n\t}\n\n\treturn filepath.Clean(filepath.Join(base, dir))\n}\n\nfunc parseVolumeSpec(volBind, os string) (hostPath string, containerPath string, mode string, err error) {\n\tif os == \"windows\" {\n\t\treturn parseVolumeSpecWindows(volBind)\n\t}\n\treturn parseVolumeSpecLinux(volBind)\n}\n\nfunc parseVolumeSpecWindows(volBind string) (hostPath string, containerPath string, mode string, err error) {\n\tparts, err := windowsSplitRawSpec(volBind, rxDestination)\n\tif err != nil {\n\t\treturn \"\", \"\", \"\", fmt.Errorf(\"not <src>:<destination> format\")\n\t}\n\n\tif len(parts) < 2 {\n\t\treturn \"\", \"\", \"\", fmt.Errorf(\"not <src>:<destination> format\")\n\t}\n\n\t// Convert host mount path separators to match the host OS's separator\n\t// so that relative paths are supported cross-platform regardless of\n\t// what slash is used in the jobspec.\n\thostPath = filepath.FromSlash(parts[0])\n\tcontainerPath = parts[1]\n\n\tif len(parts) > 2 {\n\t\tmode = parts[2]\n\t}\n\n\treturn\n}","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/drivers/docker/utils.go#L282-L318","documentation":"On Windows, parseVolumeSpecWindows runs windowsSplitRawSpec (regex-based parser handling drive letters and UNC paths); if the regex split fails it rejects the bind spec because it doesn't look like <src>:<destination>. This is a fast-fail before any path existence checks.","triggerScenarios":"Passing a volBind string to parseVolumeSpec on Windows where windowsSplitRawSpec returns an error: unbalanced/absent colon, malformed path the rxDestination regex can't match (e.g. \"C::data\" or quoting artifacts).","commonSituations":"Jobspec volume stanzas written with Linux syntax on a Windows client (relative paths like \"./data:/data\"), stray spaces, or templates leaving empty segments.","solutions":["Rewrite the volume string in absolute Windows form: \"C:\\host\\path:C:\\container\\path\".","Remove spaces/quotes around the colon; each side must be a valid path.","Avoid relative host paths on Windows; resolve to an absolute path in the jobspec."],"exampleFix":"// before\nvolumes = [\"./data:c:/data\"]\n// after\nvolumes = [\"C:/nomad/data:C:/container/data\"]","handlingStrategy":"validation","validationCode":"func validWindowsBind(s string) bool {\n  parts := strings.Split(s, \":\")\n  return len(parts) >= 2 && len(parts) <= 3 &&\n    (filepath.IsAbs(parts[0]) || filepath.VolumeName(parts[0]) != \"\") &&\n    parts[1] != \"\"\n}","typeGuard":null,"tryCatchPattern":"host, cont, mode, err := parseVolumeSpec(volBind)\nif err != nil {\n  return fmt.Errorf(\"volume %q rejected: %w\", volBind, err)\n}","preventionTips":["Use absolute Windows paths (with drive letter) for host side.","No spaces or stray quotes around colons.","Don't reuse Linux-style relative paths on Windows clients."],"tags":["docker","volumes","windows","parsing"],"backgroundTag":"invalid-volume-spec","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"}