{"record":{"id":"71f13dd5ff0d5534","repo":"hashicorp/nomad","slug":"failed-to-create-executor-v","errorCode":null,"errorMessage":"failed to create executor: %v","messagePattern":"failed to create executor: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/exec/driver.go","lineNumber":515,"sourceCode":"\t\tif err != nil {\n\t\t\treturn nil, nil, fmt.Errorf(\"failed to build mount for resolv.conf: %v\", err)\n\t\t}\n\t\tcfg.Mounts = append(cfg.Mounts, dnsMount)\n\t}\n\n\tcaps, err := capabilities.Calculate(\n\t\tcapabilities.NomadDefaults(), d.config.AllowCaps, driverConfig.CapAdd, driverConfig.CapDrop,\n\t)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\td.logger.Debug(\"task capabilities\", \"capabilities\", caps)\n\n\texec, pluginClient, err := executor.CreateExecutor(\n\t\td.logger.With(\"task_name\", handle.Config.Name, \"alloc_id\", handle.Config.AllocID),\n\t\td.nomadConfig, executorConfig)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"failed to create executor: %v\", err)\n\t}\n\t// prevent leaking executor in error scenarios\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tpluginClient.Kill()\n\t\t}\n\t}()\n\n\texecCmd := &executor.ExecCommand{\n\t\tCmd:              driverConfig.Command,\n\t\tArgs:             driverConfig.Args,\n\t\tEnv:              cfg.EnvList(),\n\t\tUser:             user,\n\t\tResourceLimits:   true,\n\t\tNoPivotRoot:      d.config.NoPivotRoot,\n\t\tResources:        cfg.Resources,\n\t\tTaskDir:          cfg.TaskDir().Dir,\n\t\tWorkDir:          driverConfig.WorkDir,","sourceCodeStart":497,"sourceCodeEnd":533,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/drivers/exec/driver.go#L497-L533","documentation":"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.","triggerScenarios":"executor.CreateExecutor fails: nomad executor binary missing or not executable, log retriever/compute setup fails, plugin handshake cannot start (resources, temp dir, permissions).","commonSituations":"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.","solutions":["Verify the Nomad installation is intact (the executor ships inside the nomad binary) and nomad is executable.","Check that temp/plugin dirs are not mounted noexec; remount or adjust TMPDIR.","Inspect client logs for the underlying go-plugin launch error (fork/exec failures, permission denied).","Check SELinux/AppArmor denials and ulimits (nproc) on the client host."],"exampleFix":"// before: /tmp mounted noexec\n$ mount | grep /tmp\n/tmp on /tmp type tmpfs (rw,noexec)\n// after\n$ sudo mount -o remount,exec /tmp\n# then restart nomad client and reschedule the task","handlingStrategy":"validation","validationCode":"// verify the nomad binary (which embeds the executor) can exec on this host\nif err := exec.Command(\"nomad\", \"version\").Run(); err != nil {\n    return fmt.Errorf(\"nomad/executor binary unusable: %w\", err)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify install integrity after upgrades (nomad binary present and executable).","Ensure TMPDIR and plugin dirs are not mounted noexec.","Check SELinux/AppArmor policies allow nomad to spawn children.","Set sane ulimits (nproc) for the nomad service user."],"tags":["nomad","exec-driver","go-plugin","executor","process-spawn"],"backgroundTag":"executor-launch-failed","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}