{"record":{"id":"be8d67a7122757c5","repo":"apache/hadoop","slug":"missing-configuration-properties-s","errorCode":null,"errorMessage":"Missing configuration properties: %s","messagePattern":"Missing configuration properties: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-minikdc/src/main/java/org/apache/hadoop/minikdc/MiniKdc.java","lineNumber":217,"sourceCode":"  private boolean krb5Debug;\n\n  public void setTransport(String transport) {\n    this.transport = transport;\n  }\n  /**\n   * Creates a MiniKdc.\n   *\n   * @param conf MiniKdc configuration.\n   * @param workDir working directory, it should be the build directory. Under\n   * this directory an ApacheDS working directory will be created, this\n   * directory will be deleted when the MiniKdc stops.\n   * @throws Exception thrown if the MiniKdc could not be created.\n   */\n  public MiniKdc(Properties conf, File workDir) throws Exception {\n    if (!conf.keySet().containsAll(PROPERTIES)) {\n      Set<String> missingProperties = new HashSet<String>(PROPERTIES);\n      missingProperties.removeAll(conf.keySet());\n      throw new IllegalArgumentException(\"Missing configuration properties: \"\n              + missingProperties);\n    }\n    this.workDir = new File(workDir, Long.toString(System.currentTimeMillis()));\n    if (!this.workDir.exists()\n            && !this.workDir.mkdirs()) {\n      throw new RuntimeException(\"Cannot create directory \" + this.workDir);\n    }\n    LOG.info(\"Configuration:\");\n    LOG.info(\"---------------------------------------------------------------\");\n    for (Map.Entry<?, ?> entry : conf.entrySet()) {\n      LOG.info(\"  {}: {}\", entry.getKey(), entry.getValue());\n    }\n    LOG.info(\"---------------------------------------------------------------\");\n    this.conf = conf;\n    port = Integer.parseInt(conf.getProperty(KDC_PORT));\n    String orgName= conf.getProperty(ORG_NAME);\n    String orgDomain = conf.getProperty(ORG_DOMAIN);\n    realm = orgName.toUpperCase(Locale.ENGLISH) + \".\"","sourceCodeStart":199,"sourceCodeEnd":235,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-minikdc/src/main/java/org/apache/hadoop/minikdc/MiniKdc.java#L199-L235","documentation":"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().","triggerScenarios":"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.","commonSituations":"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.","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)"],"exampleFix":"// before\nProperties conf = new Properties();\nconf.setProperty(MiniKdc.ORG_NAME, \"EXAMPLE\");\nnew MiniKdc(conf, dir);\n// after\nProperties conf = MiniKdc.createConf(); // has all required defaults\nconf.setProperty(MiniKdc.ORG_NAME, \"EXAMPLE\");\nconf.setProperty(MiniKdc.ORG_DOMAIN, \"COM\");\nnew MiniKdc(conf, dir);","handlingStrategy":"validation","validationCode":"Properties conf = MiniKdc.createConf(); // seeds ALL required keys\nconf.setProperty(MiniKdc.ORG_NAME, \"EXAMPLE\");\nconf.setProperty(MiniKdc.ORG_DOMAIN, \"COM\");\nSet<String> missing = new HashSet<>(MiniKdc.REQUIRED_PROPS_NEEDED);\n// simply: never build Properties from scratch for MiniKdc","typeGuard":null,"tryCatchPattern":"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; }","preventionTips":["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"],"tags":["minikdc","kerberos","testing","configuration","missing-config"],"backgroundTag":"missing-required-config-key","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}