{"record":{"id":"c9d82cb1f22b7a2b","repo":"hashicorp/nomad","slug":"default-ipc-mode-must-be-q-or-q-got-q-c9d82c","errorCode":null,"errorMessage":"default_ipc_mode must be %q or %q, got %q","messagePattern":"default_ipc_mode must be %q or %q, got %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/java/driver.go","lineNumber":152,"sourceCode":"\t// exec-based task drivers.\n\tDefaultModeIPC string `codec:\"default_ipc_mode\"`\n\n\t// AllowCaps configures which Linux Capabilities are enabled for tasks\n\t// running on this node.\n\tAllowCaps []string `codec:\"allow_caps\"`\n}\n\nfunc (c *Config) validate() error {\n\tswitch c.DefaultModePID {\n\tcase executor.IsolationModePrivate, executor.IsolationModeHost:\n\tdefault:\n\t\treturn fmt.Errorf(\"default_pid_mode must be %q or %q, got %q\", executor.IsolationModePrivate, executor.IsolationModeHost, c.DefaultModePID)\n\t}\n\n\tswitch c.DefaultModeIPC {\n\tcase executor.IsolationModePrivate, executor.IsolationModeHost:\n\tdefault:\n\t\treturn fmt.Errorf(\"default_ipc_mode must be %q or %q, got %q\", executor.IsolationModePrivate, executor.IsolationModeHost, c.DefaultModeIPC)\n\t}\n\n\tbadCaps := capabilities.Supported().Difference(capabilities.New(c.AllowCaps))\n\tif !badCaps.Empty() {\n\t\treturn fmt.Errorf(\"allow_caps configured with capabilities not supported by system: %s\", badCaps)\n\t}\n\n\treturn nil\n}\n\n// TaskConfig is the driver configuration of a taskConfig within a job\ntype TaskConfig struct {\n\t// Class indicates which class contains the java entry point.\n\tClass string `codec:\"class\"`\n\n\t// ClassPath indicates where class files are found.\n\tClassPath string `codec:\"class_path\"`\n","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/drivers/java/driver.go#L134-L170","documentation":"Config.validate() also checks default_ipc_mode (the default IPC namespace mode) against executor.IsolationModePrivate and executor.IsolationModeHost. Anything else fails driver configuration with this error.","triggerScenarios":"Driver plugin config containing default_ipc_mode with a value other than \"private\" or \"host\".","commonSituations":"Typos like \"share\" or \"hostMode\"; case mismatches (\"Private\"); mixing up pid_mode and ipc_mode config keys.","solutions":["Set default_ipc_mode to exactly \"private\" or \"host\".","Verify the key targets IPC, not PID mode (the sibling error message names default_ipc_mode).","Re-run nomad agent validate on the config file to catch it before deployment."],"exampleFix":"// before\nplugin \"java\" {\n  default_ipc_mode = \"share\"\n}\n// after\nplugin \"java\" {\n  default_ipc_mode = \"host\"\n}","handlingStrategy":"validation","validationCode":"mode := cfg[\"default_ipc_mode\"]\nif mode != \"\" && mode != \"private\" && mode != \"host\" {\n    return fmt.Errorf(\"default_ipc_mode must be 'private' or 'host', got %q\", mode)\n}","typeGuard":null,"tryCatchPattern":"if err := driver.SetConfig(cfg); err != nil && strings.Contains(err.Error(), \"default_ipc_mode\") {\n    return fmt.Errorf(\"fix default_ipc_mode in driver plugin config: %w\", err)\n}","preventionTips":["Validate agent config with `nomad agent validate`.","Use lowercase \"private\"/\"host\" values only.","Don't copy pid_mode values into ipc_mode fields blindly."],"tags":["java-driver","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"}