{"record":{"id":"064c332f47dfaa5a","repo":"apache/hadoop","slug":"failed-to-create-filepath","errorCode":null,"errorMessage":"Failed to create ${filePath}","messagePattern":"Failed to create (.+?)","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":459,"sourceCode":"   * @param volumeIndex   The index of pmem volume where a replica will be\n   *                      cached to or has been cached to.\n   *\n   * @param key           The replica's ExtendedBlockId.\n   *\n   * @return              A path to which the block replica is mapped.\n   */\n  public String idToCacheFilePath(Byte volumeIndex, ExtendedBlockId key)\n      throws IOException {\n    final String cacheSubdirPrefix = \"subdir\";\n    long blockId = key.getBlockId();\n    String bpid = key.getBlockPoolId();\n    int d1 = (int) ((blockId >> 16) & 0x1F);\n    int d2 = (int) ((blockId >> 8) & 0x1F);\n    String parentDir = pmemVolumes.get(volumeIndex) + \"/\" + bpid;\n    String subDir = cacheSubdirPrefix + d1 + \"/\" + cacheSubdirPrefix + d2;\n    File filePath = new File(parentDir, subDir);\n    if (!filePath.exists() && !filePath.mkdirs()) {\n      throw new IOException(\"Failed to create \" + filePath.getPath());\n    }\n    return filePath.getAbsolutePath() + \"/\" + idToCacheFileName(key);\n  }\n\n  /**\n   * The cache file path is pmemVolume/BlockPoolId/subdir#/subdir#/BlockId.\n   */\n  public String getCachePath(ExtendedBlockId key) throws IOException {\n    Byte volumeIndex = blockKeyToVolume.get(key);\n    if (volumeIndex == null) {\n      return  null;\n    }\n    return idToCacheFilePath(volumeIndex, key);\n  }\n\n  @VisibleForTesting\n  Map<ExtendedBlockId, Byte> getBlockKeyToVolume() {\n    return blockKeyToVolume;","sourceCodeStart":441,"sourceCodeEnd":477,"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#L441-L477","documentation":"Error \"Failed to create ${filePath}\" thrown in apache/hadoop.","triggerScenarios":"Pmem block caching when the backing cache file cannot be created on the pmem volume.","commonSituations":"See trigger scenarios.","solutions":["Check permissions and free space on the pmem volume; create the parent directories if missing.","Verify the pmem device is mounted and healthy."],"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"}