{"record":{"id":"622db583c4ae976e","repo":"apache/hadoop","slug":"pmemdir-does-not-exist","errorCode":null,"errorMessage":"${pmemDir} does not exist","messagePattern":"(.+?) does not exist","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/PmemVolumeManager.java","lineNumber":323,"sourceCode":"      // Update maxBytes and cache capacity according to cache space\n      // used by recovered cached files.\n      usedBytesCounts.get(volumeIndex).setMaxBytes(maxBytes + usedBytes);\n      cacheCapacity += usedBytes;\n      usedBytesCounts.get(volumeIndex).reserve(usedBytes);\n    }\n    return keyToMappableBlock;\n  }\n\n  public void recoverBlockKeyToVolume(ExtendedBlockId key, byte volumeIndex) {\n    blockKeyToVolume.put(key, volumeIndex);\n  }\n\n  @VisibleForTesting\n  static File verifyIfValidPmemVolume(File pmemDir)\n      throws IOException {\n    if (!pmemDir.exists()) {\n      final String message = pmemDir + \" does not exist\";\n      throw new IOException(message);\n    }\n    if (!pmemDir.isDirectory()) {\n      final String message = pmemDir + \" is not a directory\";\n      throw new IllegalArgumentException(message);\n    }\n\n    File realPmemDir = new File(getRealPmemDir(pmemDir.getPath()));\n    if (!realPmemDir.exists() && !realPmemDir.mkdir()) {\n      throw new IOException(\"Failed to create \" + realPmemDir.getPath());\n    }\n\n    String uuidStr = UUID.randomUUID().toString();\n    String testFilePath = realPmemDir.getPath() + \"/.verify.pmem.\" + uuidStr;\n    byte[] contents = uuidStr.getBytes(StandardCharsets.UTF_8);\n    RandomAccessFile testFile = null;\n    MappedByteBuffer out = null;\n    try {\n      testFile = new RandomAccessFile(testFilePath, \"rw\");","sourceCodeStart":305,"sourceCodeEnd":341,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/PmemVolumeManager.java#L305-L341","documentation":"Error \"${pmemDir} does not exist\" thrown in apache/hadoop.","triggerScenarios":"Pmem cache initialization when a configured pmem directory path does not exist on the host.","commonSituations":"See trigger scenarios.","solutions":["Create the configured pmem directory or correct the path in dfs.datanode.pmem.cache.dirs.","Ensure the pmem device is mounted (with DAX) at the expected location before starting the DataNode."],"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-22T20:17:22.307Z"}