{"record":{"id":"03f487a2ba3fb704","repo":"hashicorp/nomad","slug":"default-pid-mode-must-be-q-or-q-got-q-03f487","errorCode":null,"errorMessage":"default_pid_mode must be %q or %q, got %q","messagePattern":"default_pid_mode must be %q or %q, got %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/java/driver.go","lineNumber":146,"sourceCode":"type Config struct {\n\t// DefaultModePID is the default PID isolation set for all tasks using\n\t// exec-based task drivers.\n\tDefaultModePID string `codec:\"default_pid_mode\"`\n\n\t// DefaultModeIPC is the default IPC isolation set for all tasks using\n\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 {","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/drivers/java/driver.go#L128-L164","documentation":"The Java driver's plugin-level Config.validate() checks that default_pid_mode (the default PID namespace mode for tasks) is either \"private\" or \"host\" as defined by executor.IsolationModePrivate/Host. Any other value in the driver plugin configuration is rejected at driver setup time.","triggerScenarios":"Driver plugin configuration containing default_pid_mode set to a value other than \"private\" or \"host\" (typo, wrong casing, empty string).","commonSituations":"Operator typos in agent config (e.g. default_pid_mode = \"container\", \"shared\", or \"Private\"); copying config from docker driver docs; upgrades where allowed values changed.","solutions":["Set default_pid_mode to exactly \"private\" or \"host\" in the driver plugin config.","Check quoting/case sensitivity in the HCL/JSON agent configuration.","Consult the Java driver docs for the current list of accepted isolation modes."],"exampleFix":"// before\nplugin \"java\" {\n  default_pid_mode = \"container\"\n}\n// after\nplugin \"java\" {\n  default_pid_mode = \"private\"\n}","handlingStrategy":"validation","validationCode":"mode := cfg[\"default_pid_mode\"]\nif mode != \"\" && mode != \"private\" && mode != \"host\" {\n    return fmt.Errorf(\"default_pid_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_pid_mode\") {\n    return fmt.Errorf(\"fix default_pid_mode in driver plugin config: %w\", err)\n}","preventionTips":["Run `nomad agent validate` on configs before deployment.","Use exactly \"private\" or \"host\" (lowercase).","Keep driver plugin configs under config management with schema checks."],"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"}