hashicorp/nomad · error
default_ipc_mode must be %q or %q, got %q
Error message
default_ipc_mode must be %q or %q, got %q
What it means
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.
Source
Thrown at drivers/java/driver.go:152
// exec-based task drivers.
DefaultModeIPC string `codec:"default_ipc_mode"`
// AllowCaps configures which Linux Capabilities are enabled for tasks
// running on this node.
AllowCaps []string `codec:"allow_caps"`
}
func (c *Config) validate() error {
switch c.DefaultModePID {
case executor.IsolationModePrivate, executor.IsolationModeHost:
default:
return fmt.Errorf("default_pid_mode must be %q or %q, got %q", executor.IsolationModePrivate, executor.IsolationModeHost, c.DefaultModePID)
}
switch c.DefaultModeIPC {
case executor.IsolationModePrivate, executor.IsolationModeHost:
default:
return fmt.Errorf("default_ipc_mode must be %q or %q, got %q", executor.IsolationModePrivate, executor.IsolationModeHost, c.DefaultModeIPC)
}
badCaps := capabilities.Supported().Difference(capabilities.New(c.AllowCaps))
if !badCaps.Empty() {
return fmt.Errorf("allow_caps configured with capabilities not supported by system: %s", badCaps)
}
return nil
}
// TaskConfig is the driver configuration of a taskConfig within a job
type TaskConfig struct {
// Class indicates which class contains the java entry point.
Class string `codec:"class"`
// ClassPath indicates where class files are found.
ClassPath string `codec:"class_path"`
View on GitHub (pinned to 482b49bf1a)
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.
Example fix
// before
plugin "java" {
default_ipc_mode = "share"
}
// after
plugin "java" {
default_ipc_mode = "host"
} Defensive patterns
Strategy: validation
Validate before calling
mode := cfg["default_ipc_mode"]
if mode != "" && mode != "private" && mode != "host" {
return fmt.Errorf("default_ipc_mode must be 'private' or 'host', got %q", mode)
} Try / catch
if err := driver.SetConfig(cfg); err != nil && strings.Contains(err.Error(), "default_ipc_mode") {
return fmt.Errorf("fix default_ipc_mode in driver plugin config: %w", err)
} Prevention
- Validate agent config with `nomad agent validate`.
- Use lowercase "private"/"host" values only.
- Don't copy pid_mode values into ipc_mode fields blindly.
When it happens
Trigger: Driver plugin config containing default_ipc_mode with a value other than "private" or "host".
Common situations: Typos like "share" or "hostMode"; case mismatches ("Private"); mixing up pid_mode and ipc_mode config keys.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- default_pid_mode must be %q or %q, got %q
- allow_caps configured with capabilities not supported by sys
- pid_mode must be %q or %q, got %q
- ipc_mode must be %q or %q, got %q
- jar_path or class must be specified
AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04).
Data as JSON: /api/errors/c9d82cb1f22b7a2b.
Report an issue: GitHub.