hashicorp/nomad · error

Specified config is missing from options

Error message

Specified config is missing from options

What it means

Config.ReadBool looks up a boolean option by id in the Config.Options map; if the key is absent it returns this error instead of a default. It signals the caller asked for a config option that was never provided, distinguishing 'missing' from 'present but unparseable' (which yields the parse error below it).

Source

Thrown at client/config/config.go:1006

// ReadAlternativeDefault returns the specified configuration value, or the
// specified value if none is set.
func (c *Config) ReadAlternativeDefault(ids []string, defaultValue string) string {
	for _, id := range ids {
		val, ok := c.Options[id]
		if ok {
			return val
		}
	}

	return defaultValue
}

// ReadBool parses the specified option as a boolean.
func (c *Config) ReadBool(id string) (bool, error) {
	val, ok := c.Options[id]
	if !ok {
		return false, fmt.Errorf("Specified config is missing from options")
	}
	bval, err := strconv.ParseBool(val)
	if err != nil {
		return false, fmt.Errorf("Failed to parse %s as bool: %s", val, err)
	}
	return bval, nil
}

// ReadBoolDefault tries to parse the specified option as a boolean. If there is
// an error in parsing, the default option is returned.
func (c *Config) ReadBoolDefault(id string, defaultValue bool) bool {
	val, err := c.ReadBool(id)
	if err != nil {
		return defaultValue
	}
	return val
}

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Ensure the option is set before reading: add the key to the config/options map or set the corresponding config field
  2. Check the option id string for typos and verify it against the expected key names
  3. Use the Config's accessor/merge helpers or a default: check presence with a map lookup and fall back to false when absent
  4. Verify config-file loading actually populated Options (correct file path, no parse failures upstream)

Example fix

// before
val, err := c.ReadBool("artifact_inspection_disable") // wrong id, key missing
// after
val := false
if b, ok := c.Options["disable_artifact_inspection"]; ok {
    val, _ = strconv.ParseBool(b)
}
Defensive patterns

Strategy: validation

Validate before calling

func readBoolDefault(c *config.Config, id string, def bool) (bool, error) {
    if _, ok := c.Options[id]; !ok {
        return def, nil
    }
    return c.ReadBool(id)
}

Type guard

func hasOption(c *config.Config, id string) bool {
    _, ok := c.Options[id]
    return ok
}

Try / catch

val, err := c.ReadBool("my_option")
if err != nil {
    if err.Error() == "Specified config is missing from options" {
        val = false // documented default
    } else {
        return err
    }
}

Prevention

When it happens

Trigger: Calling c.ReadBool(id) where c.Options has no entry for id — e.g. reading an option before it was set, a typo in the option id, or an options map built from a config file that omitted the key.

Common situations: Plugin or driver code reading a client option the user never configured; renamed option keys between versions so old code reads a key the new config no longer populates; env/flag parsing skipping the key so Options never contains it.

Related errors


AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04). Data as JSON: /api/errors/52996e41f1798280. Report an issue: GitHub.