hashicorp/nomad · error

no keys present in keyring file: %s

Error message

no keys present in keyring file: %s

What it means

loadKeyringFile decodes the JSON keyring file into base64 keys and guards against an empty decoded set; if the file contains no keys, memberlist cannot be initialized with a keyring, so the gossip encryption setup fails during agent startup.

Source

Thrown at command/agent/keyring.go:109

	// Decode keyring JSON
	keys := make([]string, 0)
	if err := json.Unmarshal(keyringData, &keys); err != nil {
		return err
	}

	// Decode base64 values
	keysDecoded := make([][]byte, len(keys))
	for i, key := range keys {
		keyBytes, err := base64.StdEncoding.DecodeString(key)
		if err != nil {
			return err
		}
		keysDecoded[i] = keyBytes
	}

	// Guard against empty keyring
	if len(keysDecoded) == 0 {
		return fmt.Errorf("no keys present in keyring file: %s", c.KeyringFile)
	}

	// Create the keyring
	keyring, err := memberlist.NewKeyring(keysDecoded, keysDecoded[0])
	if err != nil {
		return err
	}

	c.MemberlistConfig.Keyring = keyring

	// Success!
	return nil
}

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Regenerate the keyring file with at least one key (nomad keygen)
  2. Point keyring config at the correct non-empty keyring file
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at command/agent/keyring.go:109 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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