{"record":{"id":"f2c75fde0499ff01","repo":"elastic/elasticsearch","slug":"78-f2c75f","errorCode":"78","errorMessage":"Setting [{}] does not exist in the keystore.","messagePattern":"Setting \\[(.+?)\\] does not exist in the keystore\\.","errorType":"exception","errorClass":"UserException","httpStatus":null,"severity":"error","filePath":"distribution/tools/keystore-cli/src/main/java/org/elasticsearch/cli/keystore/ShowKeyStoreCommand.java","lineNumber":53,"sourceCode":"\n    private final OptionSpec<String> arguments;\n\n    public ShowKeyStoreCommand() {\n        super(\"Show a value from the keystore\", true);\n        this.arguments = parser.nonOptions(\"setting name\");\n    }\n\n    @Override\n    protected void executeCommand(Terminal terminal, OptionSet options, Environment env) throws Exception {\n        final List<String> names = arguments.values(options);\n        if (names.size() != 1) {\n            throw new UserException(ExitCodes.USAGE, \"Must provide a single setting name to show\");\n        }\n        final String settingName = names.get(0);\n\n        final KeyStoreWrapper keyStore = getKeyStore();\n        if (keyStore.getSettingNames().contains(settingName) == false) {\n            throw new UserException(ExitCodes.CONFIG, \"Setting [\" + settingName + \"] does not exist in the keystore.\");\n        }\n\n        try (InputStream input = keyStore.getFile(settingName)) {\n            final BytesReference bytes = org.elasticsearch.common.io.Streams.readFully(input);\n            try {\n                byte[] array = BytesReference.toBytes(bytes);\n                CharBuffer text = StandardCharsets.UTF_8.newDecoder()\n                    .onMalformedInput(CodingErrorAction.REPORT)\n                    .onUnmappableCharacter(CodingErrorAction.REPORT)\n                    .decode(ByteBuffer.wrap(array));\n\n                // This is not strictly true, but it's the best heuristic we have.\n                // Without it we risk appending a newline to a binary file that happens to be valid UTF8\n                final boolean isFileOutput = terminal.getOutputStream() != null;\n                if (isFileOutput) {\n                    terminal.print(Terminal.Verbosity.SILENT, text.toString());\n                } else {\n                    terminal.println(Terminal.Verbosity.SILENT, text);","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/distribution/tools/keystore-cli/src/main/java/org/elasticsearch/cli/keystore/ShowKeyStoreCommand.java#L35-L71","documentation":"Thrown by `show` when the requested setting name is not in the keystore. Exits CONFIG (78). Mirrors the remove-path check: name membership is verified before any read of the underlying bytes.","triggerScenarios":"Showing a typo'd or already-removed setting; querying a name from a different node; case mismatch.","commonSituations":"Debug scripts referencing settings that were never added; checking the wrong config dir's keystore.","solutions":["Run `list` to see the exact stored names, then `show <exact-name>`.","Confirm you are pointed at the right node's config dir (`ES_PATH_CONF`).","Add the setting via `add-string`/`add-file` if it should exist."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (!keyStore.getSettingNames().contains(settingName)) {\n    // not present — skip or add it first\n}","typeGuard":null,"tryCatchPattern":"try {\n    showSetting(name);\n} catch (UserException e) {\n    if (e.exitCode == ExitCodes.CONFIG) {\n        // setting absent — list keystore to find correct name\n    }\n}","preventionTips":["Always list before show to get the exact stored name.","Confirm you are pointed at the correct config dir."],"tags":["elasticsearch","keystore-cli","config","setting-name"],"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T12:17:08.281Z"}