{"record":{"id":"05c7de0e937a95e1","repo":"apache/seatunnel","slug":"key-is-required-05c7de","errorCode":null,"errorMessage":"${key} is required","messagePattern":"(.+?) is required","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-engine/seatunnel-engine-storage/imap-storage-plugins/imap-storage-file/src/main/java/org/apache/seatunnel/engine/imap/storage/file/config/AbstractConfiguration.java","lineNumber":52,"sourceCode":"\n    public Long getBlockSize() {\n        return blockSize;\n    }\n\n    public void setBlockSize(Long blockSize) {\n        this.blockSize = blockSize;\n    }\n\n    /**\n     * check the configuration keys\n     *\n     * @param config configuration\n     * @param keys keys\n     */\n    void checkConfiguration(Map<String, String> config, String... keys) {\n        for (String key : keys) {\n            if (!config.containsKey(key) || null == config.get(key)) {\n                throw new IllegalArgumentException(key + \" is required\");\n            }\n        }\n    }\n\n    public abstract Configuration buildConfiguration(Map<String, String> config)\n            throws IMapStorageException;\n\n    /**\n     * set extra options for configuration\n     *\n     * @param hadoopConf\n     * @param config\n     * @param prefix\n     */\n    void setExtraConfiguration(\n            Configuration hadoopConf, Map<String, String> config, String prefix) {\n        config.forEach(\n                (k, v) -> {","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-engine/seatunnel-engine-storage/imap-storage-plugins/imap-storage-file/src/main/java/org/apache/seatunnel/engine/imap/storage/file/config/AbstractConfiguration.java#L34-L70","documentation":"AbstractConfiguration.checkConfiguration validates that a config map contains a value for each required key; if a key is missing or maps to null it throws this IllegalArgumentException with '<key> is required'. Subclass buildConfiguration methods (e.g. HdfsConfiguration) call it before building the Hadoop Configuration.","triggerScenarios":"Calling buildConfiguration() with a config map lacking e.g. hdfs name/kerberos keys, or containing the key with an explicit null value.","commonSituations":"seatunnel.yaml storage section missing kerberos principal/keytab or hdfs URL entries; YAML indentation dropping keys; keys provided as environment placeholders that resolved to null.","solutions":["Add the missing key named in the message to the storage config with a non-null value.","Check YAML indentation so keys are nested under the correct map section.","Ensure placeholder substitution (env vars) actually resolves — a ${VAR} that is unset can yield null."],"exampleFix":"// before\nstorage:\n  hdfs:\n    url: \"hdfs://nn:8020\"\n// after (message said principal is required)\nstorage:\n  hdfs:\n    url: \"hdfs://nn:8020\"\n    kerberosPrincipal: \"st/_HOST@EXAMPLE.COM\"\n    kerberosKeytabFilePath: \"/etc/security/keytabs/st.keytab\"","handlingStrategy":"validation","validationCode":"java.util.Map<String,String> cfg = /* parsed storage config */;\njava.util.List<String> required = java.util.Arrays.asList(\"url\", \"kerberosPrincipal\", \"kerberosKeytabFilePath\");\nrequired.forEach(k -> { if (cfg.get(k) == null) throw new IllegalStateException(k + \" missing in storage config\"); });","typeGuard":null,"tryCatchPattern":"try { Configuration c = hdfsConfiguration.buildConfiguration(config); } catch (IllegalArgumentException e) { /* key named in message; add it with a non-null value */ }","preventionTips":["Keep a validated reference storage config per environment","Beware YAML indentation dropping keys into the wrong map","Verify env-var placeholders resolve to non-null at deploy time"],"tags":["configuration","validation","missing-key"],"backgroundTag":"missing-required-config-field","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}