hashicorp/nomad · error

failed to create executor: %v

Error message

failed to create executor: %v

What it means

StartTask launches the executor as a go-plugin subprocess via executor.CreateExecutor. If the plugin client cannot be created or the executor binary cannot be started/spawned, this error is returned and the plugin client is killed by the deferred cleanup.

Source

Thrown at drivers/exec/driver.go:515

		if err != nil {
			return nil, nil, fmt.Errorf("failed to build mount for resolv.conf: %v", err)
		}
		cfg.Mounts = append(cfg.Mounts, dnsMount)
	}

	caps, err := capabilities.Calculate(
		capabilities.NomadDefaults(), d.config.AllowCaps, driverConfig.CapAdd, driverConfig.CapDrop,
	)
	if err != nil {
		return nil, nil, err
	}
	d.logger.Debug("task capabilities", "capabilities", caps)

	exec, pluginClient, err := executor.CreateExecutor(
		d.logger.With("task_name", handle.Config.Name, "alloc_id", handle.Config.AllocID),
		d.nomadConfig, executorConfig)
	if err != nil {
		return nil, nil, fmt.Errorf("failed to create executor: %v", err)
	}
	// prevent leaking executor in error scenarios
	defer func() {
		if err != nil {
			pluginClient.Kill()
		}
	}()

	execCmd := &executor.ExecCommand{
		Cmd:              driverConfig.Command,
		Args:             driverConfig.Args,
		Env:              cfg.EnvList(),
		User:             user,
		ResourceLimits:   true,
		NoPivotRoot:      d.config.NoPivotRoot,
		Resources:        cfg.Resources,
		TaskDir:          cfg.TaskDir().Dir,
		WorkDir:          driverConfig.WorkDir,

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Verify the Nomad installation is intact (the executor ships inside the nomad binary) and nomad is executable.
  2. Check that temp/plugin dirs are not mounted noexec; remount or adjust TMPDIR.
  3. Inspect client logs for the underlying go-plugin launch error (fork/exec failures, permission denied).
  4. Check SELinux/AppArmor denials and ulimits (nproc) on the client host.

Example fix

// before: /tmp mounted noexec
$ mount | grep /tmp
/tmp on /tmp type tmpfs (rw,noexec)
// after
$ sudo mount -o remount,exec /tmp
# then restart nomad client and reschedule the task
Defensive patterns

Strategy: validation

Validate before calling

// verify the nomad binary (which embeds the executor) can exec on this host
if err := exec.Command("nomad", "version").Run(); err != nil {
    return fmt.Errorf("nomad/executor binary unusable: %w", err)
}

Prevention

When it happens

Trigger: executor.CreateExecutor fails: nomad executor binary missing or not executable, log retriever/compute setup fails, plugin handshake cannot start (resources, temp dir, permissions).

Common situations: Nomad installed via package that lost the executor binary; /tmp or plugin temp dir mounted noexec; restrictive ulimits or cgroup settings preventing process spawn; SELinux/AppArmor blocking execution.

Related errors


AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04). Data as JSON: /api/errors/71f13dd5ff0d5534. Report an issue: GitHub.