{"record":{"id":"2f0e43ef03f4bd2a","repo":"hashicorp/nomad","slug":"failed-to-start-command-path-q-args-q-v","errorCode":null,"errorMessage":"failed to start command path=%q --- args=%q: %v","messagePattern":"failed to start command path=%q --- args=%q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/shared/executor/executor.go","lineNumber":429,"sourceCode":"\tabsPath, err := lookupBin(command.TaskDir, command.Cmd)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := makeExecutable(absPath); err != nil {\n\t\treturn nil, err\n\t}\n\n\tpath := absPath\n\n\t// Set the commands arguments\n\te.childCmd.Path = path\n\te.childCmd.Args = append([]string{e.childCmd.Path}, command.Args...)\n\te.childCmd.Env = e.command.Env\n\n\t// Start the process\n\tif err = withNetworkIsolation(e.childCmd.Start, command.NetworkIsolation); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to start command path=%q --- args=%q: %v\", path, e.childCmd.Args, err)\n\t}\n\n\t// Run the runningFunc hook after the process starts\n\tif err := running(); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Wait on the task process\n\tgo e.wait()\n\treturn &ProcessState{Pid: e.childCmd.Process.Pid, ExitCode: -1, Time: time.Now()}, nil\n}\n\n// Exec a command inside a container for exec and java drivers.\nfunc (e *UniversalExecutor) Exec(deadline time.Time, name string, args []string) ([]byte, int, error) {\n\tctx, cancel := context.WithDeadline(context.Background(), deadline)\n\tdefer cancel()\n\n\tif cleanup, err := e.setSubCmdCgroup(&e.childCmd, e.command.StatsCgroup()); err != nil {","sourceCodeStart":411,"sourceCodeEnd":447,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/drivers/shared/executor/executor.go#L411-L447","documentation":"Launch finally starts the child process (e.childCmd.Start) — optionally under network isolation — and wraps any Start failure with the command path and args. This is the definitive 'task process could not be launched' error in the universal executor.","triggerScenarios":"withNetworkIsolation(e.childCmd.Start, ...) fails: fork/exec error (ENOENT, EACCES, ENOEXEC), netns setup failure (creating/joining the network namespace fails), or process resource limits.","commonSituations":"Wrong driver 'command' path, binary missing from image/chroot, architecture mismatch (ENOEXEC), network isolation misconfiguration (invalid bridge, missing CAP_NET_ADMIN, CNI plugin failure), fork limits under heavy load.","solutions":["Read path and args in the message and verify the binary exists/executable at exactly that path","If NetworkIsolation is set, check CNI/bridge setup and CAP_NET_ADMIN on the client node","Check chroot/task dir contents for the expected binary (missing files in chroot list)","Test the command manually as the nomad user; inspect the wrapped %v cause for errno","Raise process/fd limits if EAGAIN/fork failures appear"],"exampleFix":"// before\n// exec: \"nomad-task\": no such file or directory (binary not in chroot)\n// after\n// copy binary into the task dir or fix driver config: command = \"/local/nomad-task\" with artifact staging","handlingStrategy":"validation","validationCode":"func preflightLaunch(path string, args []string) error {\n  fi, err := os.Stat(path)\n  if err != nil { return fmt.Errorf(\"ENOENT: %w\", err) }\n  if fi.Mode()&0o111 == 0 { return fmt.Errorf(\"EACCES: %s not executable\", path) }\n  for _, a := range args { if a == \"\" { return errors.New(\"empty arg\") } }\n  return nil\n}","typeGuard":null,"tryCatchPattern":"if err := launchTask(); err != nil {\n  if strings.Contains(err.Error(), \"failed to start command path=\") {\n    var eerr *exec.Error\n    if errors.As(err, &eerr) {\n      return fmt.Errorf(\"fix driver command config for %s: %w\", eerr.Name, err)\n    }\n    if strings.Contains(err.Error(), \"network\") {\n      return checkCNIAndRetry()\n    }\n  }\n  return err\n}","preventionTips":["Preflight the exact path+args before deployment","Ensure network-isolated tasks run on nodes with CNI and CAP_NET_ADMIN","Keep chroot lists complete for exec/java drivers","Set alerting on ENOEXEC/EACCES launch failures"],"tags":["process-start","exec","network-isolation","nomad-executor"],"backgroundTag":"exec-command-not-found","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"}