{"record":{"id":"a78ac21034fc0ada","repo":"apache/hadoop","slug":"could-not-find-pathstr-in-any-of-the-configured","errorCode":null,"errorMessage":"Could not find ${pathStr} in any of the configured local directories","messagePattern":"Could not find (.+?) in any of the configured local directories","errorType":"exception","errorClass":"DiskErrorException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/LocalDirAllocator.java","lineNumber":618,"sourceCode":"        Configuration conf) throws IOException {\n      Context ctx = confChanged(conf);\n      int numDirs = ctx.localDirs.length;\n      int numDirsSearched = 0;\n      //remove the leading slash from the path (to make sure that the uri\n      //resolution results in a valid path on the dir being checked)\n      if (pathStr.startsWith(\"/\")) {\n        pathStr = pathStr.substring(1);\n      }\n      while (numDirsSearched < numDirs) {\n        Path file = new Path(ctx.localDirs[numDirsSearched], pathStr);\n        if (ctx.localFS.exists(file)) {\n          return file;\n        }\n        numDirsSearched++;\n      }\n\n      //no path found\n      throw new DiskErrorException (\"Could not find \" + pathStr +\" in any of\" +\n      \" the configured local directories\");\n    }\n\n    private static class PathIterator implements Iterator<Path>, Iterable<Path> {\n      private final FileSystem fs;\n      private final String pathStr;\n      private int i = 0;\n      private final Path[] rootDirs;\n      private Path next = null;\n\n      private PathIterator(FileSystem fs, String pathStr, Path[] rootDirs)\n          throws IOException {\n        this.fs = fs;\n        this.pathStr = pathStr;\n        this.rootDirs = rootDirs;\n        advance();\n      }\n","sourceCodeStart":600,"sourceCodeEnd":636,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/LocalDirAllocator.java#L600-L636","documentation":"Error \"Could not find ${pathStr} in any of the configured local directories\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/LocalDirAllocator.java:618 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the file was actually created under one of the configured local directories.","Check that the LocalDirAllocator configuration matches the one used to create the file.","Guard against the file being cleaned up between creation and lookup."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}