{"record":{"id":"a755078111b0aa68","repo":"apache/hadoop","slug":"renaming-to-failed","errorCode":null,"errorMessage":"renaming  {} to {} FAILED","messagePattern":"renaming  (.+?) to (.+?) FAILED","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java","lineNumber":1373,"sourceCode":"        LOG.warn(\"Unable to delete cancelled checkpoint in \" + sd);\n        al.add(sd);            \n      }\n    }\n    storage.reportErrorsOnDirectories(al);\n  }\n\n  private void renameImageFileInDir(StorageDirectory sd, NameNodeFile fromNnf,\n      NameNodeFile toNnf, long txid, boolean renameMD5) throws IOException {\n    final File fromFile = NNStorage.getStorageFile(sd, fromNnf, txid);\n    final File toFile = NNStorage.getStorageFile(sd, toNnf, txid);\n    // renameTo fails on Windows if the destination file already exists.\n    if (LOG.isDebugEnabled()) {\n      LOG.debug(\"renaming  {} to {}\", fromFile.getAbsoluteFile(), toFile.getAbsolutePath());\n    }\n\n    if (!fromFile.renameTo(toFile)) {\n      if (!toFile.delete() || !fromFile.renameTo(toFile)) {\n        throw new IOException(\"renaming  \" + fromFile.getAbsolutePath() + \" to \"  + \n            toFile.getAbsolutePath() + \" FAILED\");\n      }\n    }\n    if (renameMD5) {\n      MD5FileUtils.renameMD5File(fromFile, toFile);\n    }\n  }\n\n  CheckpointSignature rollEditLog(int layoutVersion) throws IOException {\n    getEditLog().rollEditLog(layoutVersion);\n    // Record this log segment ID in all of the storage directories, so\n    // we won't miss this log segment on a restart if the edits directories\n    // go missing.\n    storage.writeTransactionIdFileToStorage(getEditLog().getCurSegmentTxId());\n    //Update NameDirSize Metric\n    getStorage().updateNameDirSize();\n    return new CheckpointSignature(this);\n  }","sourceCodeStart":1355,"sourceCodeEnd":1391,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java#L1355-L1391","documentation":"Error \"renaming  {} to {} FAILED\" thrown in apache/hadoop.","triggerScenarios":"Renaming (moving) an image/edits file to its final location in the storage directory fails on the local filesystem.","commonSituations":"See trigger scenarios.","solutions":["Check filesystem permissions and disk state on the storage directory so the image file rename can succeed.","Inspect NameNode logs for the underlying IOException and retry the checkpoint."],"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"}