{"record":{"id":"da8f3bea2703c381","repo":"elastic/elasticsearch","slug":"unknown-secure-settings-source-source","errorCode":null,"errorMessage":"Unknown secure settings source [${source}]","messagePattern":"Unknown secure settings source \\[(.+?)\\]","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"distribution/tools/server-cli/src/main/java/org/elasticsearch/server/cli/ServerCli.java","lineNumber":310,"sourceCode":"        envVars.remove(\"ES_JAVA_OPTS\");\n        return envVars;\n    }\n\n    protected static byte[] serializeServerArgs(ServerArgs args) throws IOException {\n        try (BytesStreamOutput out = new BytesStreamOutput()) {\n            args.writeTo(out);\n            return BytesReference.toBytes(out.bytes());\n        }\n    }\n\n    // protected to allow tests to override\n    protected SecureSettingsLoader secureSettingsLoader(ProcessInfo processInfo) {\n        // The SecureSettingsLoader is configured by a CLI sys prop `es.secure_settings.source` via `CLI_JAVA_OPTS`\n        String source = processInfo.sysprops().getOrDefault(\"es.secure_settings.source\", \"keystore\");\n        return switch (source) {\n            case \"keystore\" -> new KeyStoreLoader();\n            case \"file_settings\" -> new FileSettingsClusterSecretsLoader();\n            default -> throw new IllegalArgumentException(\"Unknown secure settings source [\" + source + \"]\");\n        };\n    }\n}\n","sourceCodeStart":292,"sourceCodeEnd":314,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/distribution/tools/server-cli/src/main/java/org/elasticsearch/server/cli/ServerCli.java#L292-L314","documentation":"Thrown by ServerCli.secureSettingsLoader when the `es.secure_settings.source` system property is set to a value other than the two supported sources (`keystore` or `file_settings`). The property is typically injected via CLI_JAVA_OPTS by the launcher scripts to select which SecureSettingsLoader implementation bootstraps the node's secrets. An unknown value means the node cannot decide how to load secure settings, so it fails fast with an IllegalArgumentException rather than silently running with no secrets.","triggerScenarios":"Setting `-Des.secure_settings.source=auto`, `env`, `vault`, or any other unsupported identifier via ES_JAVA_OPTS, jvm.options, or a custom launcher script. Also occurs on downgrade: a config using `file_settings` run by an older binary that only knows `keystore`.","commonSituations":"Typo in the source name. Copying a config from a newer Elasticsearch version that supports `file_settings` into an older installation. Custom Docker images that hardcode an unsupported source. Misreading docs that only list `keystore` and `file_settings` as valid.","solutions":["Check the effective value: `echo $ES_JAVA_OPTS` and any jvm.options files for `es.secure_settings.source`.","Set the property to either `keystore` (default, reads the ES keystore) or `file_settings` (reads cluster secrets from the file-based settings).","Remove the property entirely to fall back to the default `keystore` loader.","If you genuinely need a custom source, subclass ServerCli and override secureSettingsLoader(ProcessInfo) in a custom distribution."],"exampleFix":"// before\nexport ES_JAVA_OPTS=\"-Des.secure_settings.source=env\"\n// after\nexport ES_JAVA_OPTS=\"-Des.secure_settings.source=file_settings\"\n// or simply omit it to use the default keystore loader","handlingStrategy":"validation","validationCode":"static final Set<String> VALID_SOURCES = Set.of(\"keystore\", \"file_settings\");\nString src = System.getProperty(\"es.secure_settings.source\", \"keystore\");\nif (!VALID_SOURCES.contains(src)) {\n    throw new IllegalArgumentException(\"Unsupported es.secure_settings.source=\" + src + \"; valid: \" + VALID_SOURCES);\n}","typeGuard":"static boolean isValidSecureSettingsSource(String s) {\n    return s != null && (s.equals(\"keystore\") || s.equals(\"file_settings\"));\n}","tryCatchPattern":"try {\n    SecureSettingsLoader loader = cli.secureSettingsLoader(processInfo);\n} catch (IllegalArgumentException e) {\n    // surface the supported values to the operator, fall back to default keystore if appropriate\n    log.error(\"Invalid es.secure_settings.source; supported: keystore, file_settings\", e);\n    throw e;\n}","preventionTips":["Document the two valid values wherever ES_JAVA_OPTS is configured.","Pin the supported set in a single constant and use it for both validation and docs generation.","On version downgrade, audit config files for sources the older binary does not know."],"tags":["cli","secure-settings","sysprop","startup","configuration"],"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T06:17:24.410Z"}