apache/hadoop · error · IllegalArgumentException
Missing configuration properties: %s
Error message
Missing configuration properties: %s
What it means
The MiniKdc constructor (line 217) requires the supplied Properties to contain every mandatory key: org.name, org.domain, kdc.bind.address, kdc.port, instance, transport, max.ticket.lifetime and max.renewable.lifetime. If any are missing it throws IllegalArgumentException 'Missing configuration properties: [<missing keys>]'. MiniKdc.createConf() already returns defaults for all of them, so this fires when callers construct their own Properties from scratch instead of starting from createConf().
Source
Thrown at hadoop-common-project/hadoop-minikdc/src/main/java/org/apache/hadoop/minikdc/MiniKdc.java:217
private boolean krb5Debug;
public void setTransport(String transport) {
this.transport = transport;
}
/**
* Creates a MiniKdc.
*
* @param conf MiniKdc configuration.
* @param workDir working directory, it should be the build directory. Under
* this directory an ApacheDS working directory will be created, this
* directory will be deleted when the MiniKdc stops.
* @throws Exception thrown if the MiniKdc could not be created.
*/
public MiniKdc(Properties conf, File workDir) throws Exception {
if (!conf.keySet().containsAll(PROPERTIES)) {
Set<String> missingProperties = new HashSet<String>(PROPERTIES);
missingProperties.removeAll(conf.keySet());
throw new IllegalArgumentException("Missing configuration properties: "
+ missingProperties);
}
this.workDir = new File(workDir, Long.toString(System.currentTimeMillis()));
if (!this.workDir.exists()
&& !this.workDir.mkdirs()) {
throw new RuntimeException("Cannot create directory " + this.workDir);
}
LOG.info("Configuration:");
LOG.info("---------------------------------------------------------------");
for (Map.Entry<?, ?> entry : conf.entrySet()) {
LOG.info(" {}: {}", entry.getKey(), entry.getValue());
}
LOG.info("---------------------------------------------------------------");
this.conf = conf;
port = Integer.parseInt(conf.getProperty(KDC_PORT));
String orgName= conf.getProperty(ORG_NAME);
String orgDomain = conf.getProperty(ORG_DOMAIN);
realm = orgName.toUpperCase(Locale.ENGLISH) + "."View on GitHub (pinned to 2add963021)
Solutions
- Start from the defaults: `Properties conf = MiniKdc.createConf(); conf.setProperty(MiniKdc.ORG_NAME, ...); ...` then override only what you need
- If building manually, set all keys named in the error message (note max.renewable.lifetime is required even though min.ticket.lifetime is not)
Example fix
// before Properties conf = new Properties(); conf.setProperty(MiniKdc.ORG_NAME, "EXAMPLE"); new MiniKdc(conf, dir); // after Properties conf = MiniKdc.createConf(); // has all required defaults conf.setProperty(MiniKdc.ORG_NAME, "EXAMPLE"); conf.setProperty(MiniKdc.ORG_DOMAIN, "COM"); new MiniKdc(conf, dir);
Defensive patterns
Strategy: validation
Validate before calling
Properties conf = MiniKdc.createConf(); // seeds ALL required keys conf.setProperty(MiniKdc.ORG_NAME, "EXAMPLE"); conf.setProperty(MiniKdc.ORG_DOMAIN, "COM"); Set<String> missing = new HashSet<>(MiniKdc.REQUIRED_PROPS_NEEDED); // simply: never build Properties from scratch for MiniKdc
Try / catch
try { new MiniKdc(conf, dir); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith("Missing configuration")) { conf = MiniKdc.createConf(); conf.putAll(userConf); new MiniKdc(conf, dir); } else throw e; } Prevention
- Always start from MiniKdc.createConf() and override selectively
- When upgrading Hadoop versions, re-check MiniKdc's required property list
- Encapsulate MiniKdc construction in one test utility so the rule lives in one place
When it happens
Trigger: Programmatic use: `new MiniKdc(props, workDir)` with `props = new Properties()` plus only a few overrides (e.g. only org.name/org.domain set) — the missing set is computed as PROPERTIES minus conf.keySet() and reported. The CLI main() merges user properties over createConf() defaults, so it cannot trigger this.
Common situations: Test code migrating from older MiniKdc versions where fewer properties were mandatory; custom test utilities building Properties manually; copy-pasted partial configs that set only org.name and org.domain.
Related errors
- Specified work directory does not exists: %s
- Specified configuration does not exists: %s
- Cannot rename KDC's krb5conf to %s
- Invalid transport: %s
- Need to set transport!
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/be8d67a7122757c5.
Report an issue: GitHub.