{"record":{"id":"987c83552390cd92","repo":"apache/hadoop","slug":"specified-work-directory-does-not-exists-s","errorCode":null,"errorMessage":"Specified work directory does not exists: %s","messagePattern":"Specified work directory does not exists: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-minikdc/src/main/java/org/apache/hadoop/minikdc/MiniKdc.java","lineNumber":86,"sourceCode":" * </ul>\n * The generated krb5.conf forces TCP connections.\n */\npublic class MiniKdc {\n\n  public static final String JAVA_SECURITY_KRB5_CONF =\n      \"java.security.krb5.conf\";\n  public static final String SUN_SECURITY_KRB5_DEBUG =\n      \"sun.security.krb5.debug\";\n\n  public static void main(String[] args) throws Exception {\n    if (args.length < 4) {\n      System.out.println(\"Arguments: <WORKDIR> <MINIKDCPROPERTIES> \" +\n              \"<KEYTABFILE> [<PRINCIPALS>]+\");\n      System.exit(1);\n    }\n    File workDir = new File(args[0]);\n    if (!workDir.exists()) {\n      throw new RuntimeException(\"Specified work directory does not exists: \"\n              + workDir.getAbsolutePath());\n    }\n    Properties conf = createConf();\n    File file = new File(args[1]);\n    if (!file.exists()) {\n      throw new RuntimeException(\"Specified configuration does not exists: \"\n              + file.getAbsolutePath());\n    }\n    Properties userConf = new Properties();\n    InputStreamReader r = null;\n    try {\n      r = new InputStreamReader(new FileInputStream(file),\n          StandardCharsets.UTF_8);\n      userConf.load(r);\n    } finally {\n      if (r != null) {\n        r.close();\n      }","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-minikdc/src/main/java/org/apache/hadoop/minikdc/MiniKdc.java#L68-L104","documentation":"MiniKdc's standalone CLI main() requires <WORKDIR> <MINIKDCPROPERTIES> <KEYTABFILE> [PRINCIPALS...]. The first argument must be an existing directory used as the KDC's working root; if File.exists() is false it throws RuntimeException 'Specified work directory does not exists: <absolute path>' before the KDC starts.","triggerScenarios":"Running `java -cp ... org.apache.hadoop.minikdc.MiniKdc /tmp/kdc ...` (or the minikdc shell/bat scripts) where the first argument names a directory that is absent, misspelled, or is a file rather than a directory.","commonSituations":"Integration-test harnesses that assume the build already created target/test-dir; relative paths evaluated from a different CWD in CI; typos when invoking the bundled minikdc scripts.","solutions":["mkdir -p the workdir before launching (the parent must exist and be writable)","Pass an absolute path for <WORKDIR> to avoid CI working-directory surprises","Check the printed absolute path against what you intended if the launch still fails"],"exampleFix":"# before\njava ... MiniKdc target/kdc conf.properties user.keytab hdfs/localhost\n# after\nmkdir -p /tmp/minikdc && java ... MiniKdc /tmp/minikdc /abs/conf.properties /abs/user.keytab hdfs/localhost","handlingStrategy":"validation","validationCode":"File workDir = new File(args[0]);\nif (!workDir.isDirectory() && !workDir.mkdirs())\n  throw new IllegalStateException(\"MiniKdc workdir unusable: \" + workDir.getAbsolutePath());","typeGuard":null,"tryCatchPattern":null,"preventionTips":["mkdir -p the workdir in test setup before invoking MiniKdc","Pass absolute workdir paths in CI","Check writability too — MiniKdc creates a timestamped subdir under it"],"tags":["minikdc","kerberos","testing","file-not-found","cli"],"backgroundTag":"file-path-not-found","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}