{"record":{"id":"3165d9aa80e27e63","repo":"hashicorp/nomad","slug":"no-keys-present-in-keyring-file-s","errorCode":null,"errorMessage":"no keys present in keyring file: %s","messagePattern":"no keys present in keyring file: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"command/agent/keyring.go","lineNumber":109,"sourceCode":"\t// Decode keyring JSON\n\tkeys := make([]string, 0)\n\tif err := json.Unmarshal(keyringData, &keys); err != nil {\n\t\treturn err\n\t}\n\n\t// Decode base64 values\n\tkeysDecoded := make([][]byte, len(keys))\n\tfor i, key := range keys {\n\t\tkeyBytes, err := base64.StdEncoding.DecodeString(key)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tkeysDecoded[i] = keyBytes\n\t}\n\n\t// Guard against empty keyring\n\tif len(keysDecoded) == 0 {\n\t\treturn fmt.Errorf(\"no keys present in keyring file: %s\", c.KeyringFile)\n\t}\n\n\t// Create the keyring\n\tkeyring, err := memberlist.NewKeyring(keysDecoded, keysDecoded[0])\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tc.MemberlistConfig.Keyring = keyring\n\n\t// Success!\n\treturn nil\n}\n","sourceCodeStart":91,"sourceCodeEnd":123,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/command/agent/keyring.go#L91-L123","documentation":"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.","triggerScenarios":"Thrown at command/agent/keyring.go:109 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Regenerate the keyring file with at least one key (nomad keygen)","Point keyring config at the correct non-empty keyring file"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}