{"record":{"id":"9900b975eb272111","repo":"hashicorp/nomad","slug":"failed-to-launch-command-with-executor-v-9900b9","errorCode":null,"errorMessage":"failed to launch command with executor: %v","messagePattern":"failed to launch command with executor: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"drivers/rawexec/driver.go","lineNumber":451,"sourceCode":"\t\tCmd:              driverConfig.Command,\n\t\tArgs:             driverConfig.Args,\n\t\tEnv:              d.buildEnvList(&driverConfig, cfg),\n\t\tUser:             cfg.User,\n\t\tTaskDir:          cfg.TaskDir().Dir,\n\t\tWorkDir:          driverConfig.WorkDir,\n\t\tStdoutPath:       cfg.StdoutPath,\n\t\tStderrPath:       cfg.StderrPath,\n\t\tNetworkIsolation: cfg.NetworkIsolation,\n\t\tResources:        cfg.Resources.Copy(),\n\t\tOverrideCgroupV2: driverConfig.OverrideCgroupV2,\n\t\tOverrideCgroupV1: driverConfig.OverrideCgroupV1,\n\t\tOOMScoreAdj:      int32(driverConfig.OOMScoreAdj),\n\t}\n\n\tps, err := exec.Launch(execCmd)\n\tif err != nil {\n\t\tpluginClient.Kill()\n\t\treturn nil, nil, fmt.Errorf(\"failed to launch command with executor: %v\", err)\n\t}\n\n\th := &taskHandle{\n\t\texec:         exec,\n\t\tpid:          ps.Pid,\n\t\tpluginClient: pluginClient,\n\t\ttaskConfig:   cfg,\n\t\tprocState:    drivers.TaskStateRunning,\n\t\tstartedAt:    time.Now().Round(time.Millisecond),\n\t\tlogger:       d.logger,\n\t\tdoneCh:       make(chan struct{}),\n\t}\n\n\tdriverState := TaskState{\n\t\tReattachConfig: pstructs.ReattachConfigFromGoPlugin(pluginClient.ReattachConfig()),\n\t\tPid:            ps.Pid,\n\t\tTaskConfig:     cfg,\n\t\tStartedAt:      h.startedAt,","sourceCodeStart":433,"sourceCodeEnd":469,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/drivers/rawexec/driver.go#L433-L469","documentation":"The executor was created but exec.Launch(execCmd) failed to actually start the user command. The driver kills the plugin client and returns this error, so the task never runs. The wrapped error carries the executor's reason (exec format error, permission denied, missing binary, cgroup setup failure, etc.).","triggerScenarios":"StartTask calls exec.Launch with the ExecCommand and the underlying os/exec or namespace/cgroup setup fails: nonexistent command binary, non-executable file, bad working directory, cgroup v2 creation failure, or fork limits.","commonSituations":"Wrong 'command' path in the job spec; script lacking +x; task_dir/user mismatch (running as non-root without permission); containerized nomad client missing syscall permissions; cgroup v2 path conflicts on the host.","solutions":["Verify the command exists and is executable on the client host (or within chroot/task_dir when driver.caps include exec)","Read the wrapped error: 'no such file or directory' → fix path; 'permission denied' → fix exec bit/user; 'operation not permitted' → fix container/capability setup","Check executor logs in the alloc dir for the exact syscall failure","Fix cgroup/namespace related issues (custom cgroup_v2 path, unprivileged user restrictions) or run the client with required privileges"],"exampleFix":"// before: non-executable, relative path\nconfig { command = \"scripts/app.sh\" }\n// after: absolute path to an executable\nconfig { command = \"/opt/app/bin/app.sh\" }","handlingStrategy":"try-catch","validationCode":"// before submit, verify the command on the target client\ntest -x /opt/app/bin/app.sh || echo \"command missing or not executable\"\nfile /opt/app/bin/app.sh   # right arch/format for host?","typeGuard":null,"tryCatchPattern":"h, net, err := d.StartTask(cfg)\nif err != nil {\n  var launchErr = \"failed to launch command with executor\"\n  if strings.Contains(err.Error(), launchErr) {\n    d.logger.Error(\"task command failed to launch\", \"wrapped\", err)\n    // executor+plugin already killed by driver; surface fix guidance\n  }\n}","preventionTips":["Use absolute paths to executables present on every client the job can schedule to","chmod +x scripts and ensure correct architecture binaries","Verify user/permissions and task_dir contents for non-root execution","Check cgroup v2 host layout before using cgroup overrides"],"tags":["nomad","rawexec","exec","launch-failure","process"],"backgroundTag":"command-launch-failed","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"}