{"record":{"id":"f7b1a1632c350b28","repo":"hashicorp/nomad","slug":"binary-q-does-not-exist","errorCode":null,"errorMessage":"binary %q does not exist","messagePattern":"binary %q does not exist","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/shared/executor/executor.go","lineNumber":781,"sourceCode":"\n\t// Check the $PATH\n\tif host, err := exec.LookPath(bin); err == nil {\n\t\treturn host, nil\n\t}\n\n\treturn \"\", fmt.Errorf(\"binary %q could not be found\", bin)\n}\n\n// makeExecutable makes the given file executable for root,group,others.\nfunc makeExecutable(binPath string) error {\n\tif runtime.GOOS == \"windows\" {\n\t\treturn nil\n\t}\n\n\tfi, err := os.Stat(binPath)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn fmt.Errorf(\"binary %q does not exist\", binPath)\n\t\t}\n\t\treturn fmt.Errorf(\"specified binary is invalid: %v\", err)\n\t}\n\n\t// If it is not executable, make it so.\n\tperm := fi.Mode().Perm()\n\treq := os.FileMode(0555)\n\tif perm&req != req {\n\t\tif err := os.Chmod(binPath, perm|req); err != nil {\n\t\t\treturn fmt.Errorf(\"error making %q executable: %s\", binPath, err)\n\t\t}\n\t}\n\treturn nil\n}\n\n// SupportedCaps returns a list of all supported capabilities in kernel.\nfunc SupportedCaps(allowNetRaw bool) []string {\n\tvar allCaps []string","sourceCodeStart":763,"sourceCodeEnd":799,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/drivers/shared/executor/executor.go#L763-L799","documentation":"makeExecutable stat's the binary path before chmod'ing it executable; if os.Stat returns os.IsNotExist, the executor returns 'binary %q does not exist'. Raised from Launch, meaning the configured absolute binary path points to a file that is not on disk.","triggerScenarios":"Launching a task with an absolute command path that doesn't exist on the client host (wrong path, binary not installed, path inside a chroot/isolated driver filesystem that lacks it).","commonSituations":"Path typo in job spec; binary deployed to a different location per host; chroot driver (e.g. exec driver) where the binary exists on the host but outside the chroot and isn't in the allowed paths; container image missing the binary.","solutions":["Verify the absolute path exists on the client with 'ls -l <path>'","For chroot/isolated drivers, ensure the binary is inside the chroot or listed in the driver's allowed/chroot mappings","Install the binary on every client node or distribute it via an artifact block","Correct the path typo in the task config"],"exampleFix":"// before\nconfig { command = \"/opt/app/bin/server\" } // not installed on this client\n// after\nartifact { source = \".../server.tar.gz\" }\nconfig { command = \"NOMAD_TASK_DIR/server\" }","handlingStrategy":"validation","validationCode":"if _, err := os.Stat(binPath); err != nil {\n    if os.IsNotExist(err) {\n        return fmt.Errorf(\"binary %s missing on client; deploy it or fix the path\", binPath)\n    }\n    return fmt.Errorf(\"cannot access %s: %w\", binPath, err)\n}","typeGuard":"func binaryExists(path string) bool {\n    fi, err := os.Stat(path)\n    return err == nil && !fi.IsDir()\n}","tryCatchPattern":"if err := client.Launch(...); err != nil {\n    if strings.Contains(err.Error(), \"does not exist\") {\n        return fmt.Errorf(\"bad absolute path in task config: %w\", err)\n    }\n    return err\n}","preventionTips":["Verify the absolute path exists on every client the task can schedule to","For chroot/isolated drivers, keep binaries inside the chroot or map them in driver config","Use artifact blocks to ship the binary with the task","Lint job specs to require absolute paths that were smoke-tested on a client"],"tags":["filesystem","launch","path"],"backgroundTag":"binary-not-found-on-path","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"}