{"record":{"id":"8321c5ef6c5a22ff","repo":"hashicorp/nomad","slug":"failed-driver-config-validation-v-8321c5","errorCode":null,"errorMessage":"failed driver config validation: %v","messagePattern":"failed driver config validation: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/rawexec/driver.go","lineNumber":408,"sourceCode":"\nfunc (d *Driver) StartTask(cfg *drivers.TaskConfig) (*drivers.TaskHandle, *drivers.DriverNetwork, error) {\n\tif !d.config.Enabled {\n\t\treturn nil, nil, errDisabledDriver\n\t}\n\n\tif _, ok := d.tasks.Get(cfg.ID); ok {\n\t\treturn nil, nil, fmt.Errorf(\"task with ID %q already started\", cfg.ID)\n\t}\n\n\tvar driverConfig TaskConfig\n\tif err := cfg.DecodeDriverConfig(&driverConfig); err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"failed to decode driver config: %v\", err)\n\t}\n\n\tdriverConfig.OverrideCgroupV2 = cgroupslib.CustomPathCG2(driverConfig.OverrideCgroupV2)\n\n\tif err := driverConfig.validate(); err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"failed driver config validation: %v\", err)\n\t}\n\n\tif err := d.Validate(*cfg); err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"failed driver config validation: %v\", err)\n\t}\n\n\td.logger.Info(\"starting task\", \"driver_cfg\", hclog.Fmt(\"%+v\", driverConfig))\n\thandle := drivers.NewTaskHandle(taskHandleVersion)\n\thandle.Config = cfg\n\n\tpluginLogFile := filepath.Join(cfg.TaskDir().Dir, \"executor.out\")\n\texecutorConfig := &executor.ExecutorConfig{\n\t\tLogFile:  pluginLogFile,\n\t\tLogLevel: \"debug\",\n\t\tCompute:  d.compute,\n\t}\n\n\tlogger := d.logger.With(\"task_name\", handle.Config.Name, \"alloc_id\", handle.Config.AllocID)","sourceCodeStart":390,"sourceCodeEnd":426,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/drivers/rawexec/driver.go#L390-L426","documentation":"The decoded rawexec TaskConfig failed its own validate() checks before launching. This guards driver-level invariants such as requiring an explicit command, rejecting path traversal in command paths, and cgroup v2 override path constraints (the value just passed through cgroupslib.CustomPathCG2).","triggerScenarios":"StartTask with a driverConfig whose validate() returns error: empty command, command not an absolute/safe path when required, or invalid OverrideCgroupV2 path.","commonSituations":"Omitting 'command' in the rawexec config block; specifying cgroup_v2 override pointing to a nonexistent/nonstandard path; relative executable paths on hosts where rawexec requires absolute paths.","solutions":["Set an absolute 'command' in the job's rawexec config block (e.g. \"/bin/sleep\")","Remove or fix the cgroup_v2 override path so it matches the host's cgroup v2 mount/custom path","Read the exact wrapped message (%v) for the specific validate() complaint and correct that field","Check the driver's client config (enabled, cgroup settings) matches the host's cgroup version"],"exampleFix":"// before\nconfig {\n  args = [\"10\"]\n}\n// after\nconfig {\n  command = \"/bin/sleep\"\n  args    = [\"10\"]\n}","handlingStrategy":"validation","validationCode":"// pre-checks before submit\nif !strings.HasPrefix(cfg.Command, \"/\") && path.IsAbs(cfg.Command) == false {\n  // rawexec expects an absolute command path\n}\nif cfg.CgroupV2 != \"\" { checkCustomCgroupPathExistsOnHost(cfg.CgroupV2) }","typeGuard":null,"tryCatchPattern":"h, net, err := d.StartTask(cfg)\nif err != nil && strings.Contains(err.Error(), \"failed driver config validation\") {\n  return fmt.Errorf(\"fix rawexec config block: %w\", err)\n}","preventionTips":["Always use absolute executable paths in rawexec jobs","Match cgroup_v2 override to the host's actual cgroup mount layout","Run 'nomad job validate' pre-deploy","Keep rawexec client options (enabled, cgroup settings) consistent with jobs"],"tags":["nomad","rawexec","validation","config","cgroups"],"backgroundTag":"driver-config-validation-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"}