apache/hadoop · error · IllegalArgumentException
Need to set transport!
Error message
Need to set transport!
What it means
MiniKdc.start() requires a non-null 'transport' property and throws IllegalArgumentException("Need to set transport!") otherwise. The constructor already rejects a Properties object missing any required key ('Missing configuration properties' includes transport), so this branch fires when the Properties is mutated between construction and start() — e.g. the transport key is removed — or a Properties populated with put() holds a null value.
Source
Thrown at hadoop-common-project/hadoop-minikdc/src/main/java/org/apache/hadoop/minikdc/MiniKdc.java:319
simpleKdc.setKdcRealm(realm);
if (transport == null) {
transport = conf.getProperty(TRANSPORT);
}
if (port == 0) {
port = NetworkUtil.getServerPort();
}
if (transport != null) {
if (transport.trim().equals("TCP")) {
simpleKdc.setKdcTcpPort(port);
simpleKdc.setAllowUdp(false);
} else if (transport.trim().equals("UDP")) {
simpleKdc.setKdcUdpPort(port);
simpleKdc.setAllowTcp(false);
} else {
throw new IllegalArgumentException("Invalid transport: " + transport);
}
} else {
throw new IllegalArgumentException("Need to set transport!");
}
simpleKdc.getKdcConfig().setString(KdcConfigKey.KDC_SERVICE_NAME,
conf.getProperty(INSTANCE));
if (conf.getProperty(DEBUG) != null) {
krb5Debug = getAndSet(SUN_SECURITY_KRB5_DEBUG, conf.getProperty(DEBUG));
}
if (conf.getProperty(MIN_TICKET_LIFETIME) != null) {
simpleKdc.getKdcConfig().setLong(KdcConfigKey.MINIMUM_TICKET_LIFETIME,
Long.parseLong(conf.getProperty(MIN_TICKET_LIFETIME)));
}
if (conf.getProperty(MAX_TICKET_LIFETIME) != null) {
simpleKdc.getKdcConfig().setLong(KdcConfigKey.MAXIMUM_TICKET_LIFETIME,
Long.parseLong(conf.getProperty(MiniKdc.MAX_TICKET_LIFETIME)));
}
}
/**
* Stops the MiniKdcView on GitHub (pinned to 2add963021)
Solutions
- Use MiniKdc.createConf() (or a copy) and pass it untouched to the constructor, then start() without further mutation
- Treat the Properties handed to MiniKdc as owned by the KDC after construction; do not mutate it
- If filtering is needed, build the filtered copy before constructing MiniKdc and assert conf.getProperty("transport") != null
Example fix
// before
Properties conf = MiniKdc.createConf();
MiniKdc kdc = new MiniKdc(conf, workDir);
conf.remove("transport"); // mutation after construction
kdc.start(); // -> Need to set transport!
// after
Properties conf = MiniKdc.createConf();
conf.remove("debug"); // safe: not required by start()
MiniKdc kdc = new MiniKdc(conf, workDir);
kdc.start(); Defensive patterns
Strategy: validation
Validate before calling
MiniKdc kdc = new MiniKdc(conf, workDir);
// fail fast if config was mutated between construction and start
Preconditions.checkNotNull(conf.getProperty("transport"), "transport removed from MiniKdc conf");
kdc.start(); Prevention
- Treat the Properties handed to MiniKdc as immutable after construction
- Build config copies from MiniKdc.createConf() rather than mutating shared templates
- Do not strip keys from a shared Properties object between new MiniKdc() and start()
When it happens
Trigger: conf.remove("transport") or setting it to null after new MiniKdc(conf, dir) but before start(); a Properties built via put("transport", null); a Properties subclass whose getProperty() is inconsistent with keySet().
Common situations: Test harnesses that strip keys from a shared config template between construction and start(); programmatic config filtering; passing a shared mutable Properties object that another thread or helper mutates.
Related errors
- Missing configuration properties: %s
- Invalid transport: %s
- Invalid rule: ${remaining}
- Invalid rule mechanism: ${ruleMech}
- Server asks us to fall back to SIMPLE auth, but this client
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/58f4239141c621e5.
Report an issue: GitHub.