{"record":{"id":"c388bc3e113dd2ab","repo":"hashicorp/nomad","slug":"ipc-mode-must-be-q-or-q-got-q-c388bc","errorCode":null,"errorMessage":"ipc_mode must be %q or %q, got %q","messagePattern":"ipc_mode must be %q or %q, got %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/java/driver.go","lineNumber":209,"sourceCode":"\t// CapDrop is a set of linux capabilities to disable.\n\tCapDrop []string `codec:\"cap_drop\"`\n\n\t// WorkDir is the working directory for the task\n\tWorkDir string `codec:\"work_dir\"`\n}\n\nfunc (tc *TaskConfig) validate() error {\n\tswitch tc.ModePID {\n\tcase \"\", executor.IsolationModePrivate, executor.IsolationModeHost:\n\tdefault:\n\t\treturn fmt.Errorf(\"pid_mode must be %q or %q, got %q\", executor.IsolationModePrivate, executor.IsolationModeHost, tc.ModePID)\n\n\t}\n\n\tswitch tc.ModeIPC {\n\tcase \"\", executor.IsolationModePrivate, executor.IsolationModeHost:\n\tdefault:\n\t\treturn fmt.Errorf(\"ipc_mode must be %q or %q, got %q\", executor.IsolationModePrivate, executor.IsolationModeHost, tc.ModeIPC)\n\t}\n\n\tsupported := capabilities.Supported()\n\tbadAdds := supported.Difference(capabilities.New(tc.CapAdd))\n\tif !badAdds.Empty() {\n\t\treturn fmt.Errorf(\"cap_add configured with capabilities not supported by system: %s\", badAdds)\n\t}\n\tbadDrops := supported.Difference(capabilities.New(tc.CapDrop))\n\tif !badDrops.Empty() {\n\t\treturn fmt.Errorf(\"cap_drop configured with capabilities not supported by system: %s\", badDrops)\n\t}\n\n\tif tc.WorkDir != \"\" && !filepath.IsAbs(tc.WorkDir) {\n\t\treturn fmt.Errorf(\"work_dir must be an absolute path: %s\", tc.WorkDir)\n\t}\n\treturn nil\n}\n","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/drivers/java/driver.go#L191-L227","documentation":"TaskConfig.validate guard in the java driver: ModeIPC was set to a value other than the allowed executor.IsolationModePrivate or executor.IsolationModeHost (or empty); the task config is rejected at registration.","triggerScenarios":"A java task's config sets ipc_mode to a value other than \"\", \"private\", or \"host\".","commonSituations":"Typos in job specs (\"share\", \"none\"); mixing up pid_mode/ipc_mode values; older jobs written for drivers with different allowed values.","solutions":["Set ipc_mode to \"private\" or \"host\", or remove it to inherit the driver default.","Run `nomad job validate` to catch the mistake before submission.","Check that the value targets IPC mode, not PID mode or capabilities."],"exampleFix":"// before\nconfig {\n  ipc_mode = \"shared\"\n}\n// after\nconfig {\n  ipc_mode = \"host\"\n}","handlingStrategy":"validation","validationCode":"mode := taskCfg[\"ipc_mode\"]\nif mode != \"\" && mode != \"private\" && mode != \"host\" {\n    return fmt.Errorf(\"ipc_mode must be '' (default), 'private' or 'host', got %q\", mode)\n}","typeGuard":null,"tryCatchPattern":"if err := driver.StartTask(cfg); err != nil && strings.Contains(err.Error(), \"ipc_mode\") {\n    return fmt.Errorf(\"fix ipc_mode in task config: %w\", err)\n}","preventionTips":["Run `nomad job validate` before submitting jobs.","Omit ipc_mode to inherit the driver default.","Keep job specs linted against the driver's schema."],"tags":["java-driver","job-spec","config-validation","nomad"],"backgroundTag":"invalid-config-value","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"}