{"record":{"id":"6281e430416c3cb8","repo":"apache/hadoop","slug":"the-new-snapshot-name-is-null-or-empty","errorCode":null,"errorMessage":"The new snapshot name is null or empty.","messagePattern":"The new snapshot name is null or empty\\.","errorType":"validation","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeRpcServer.java","lineNumber":2021,"sourceCode":"\n  @Override\n  // Client Protocol\n  public void disallowSnapshot(String snapshot) throws IOException {\n    checkNNStartup();\n    metrics.incrDisAllowSnapshotOps();\n    namesystem.disallowSnapshot(snapshot);\n  }\n\n  @Override\n  // ClientProtocol\n  public void renameSnapshot(String snapshotRoot, String snapshotOldName,\n      String snapshotNewName) throws IOException {\n    checkNNStartup();\n    LOG.debug(\n        \"*DIR* NameNode.renameSnapshot: Snapshot Path {},snapshotOldName {}, snapshotNewName {}\",\n        snapshotRoot, snapshotOldName, snapshotNewName);\n    if (snapshotNewName == null || snapshotNewName.isEmpty()) {\n      throw new IOException(\"The new snapshot name is null or empty.\");\n    }\n    namesystem.checkOperation(OperationCategory.WRITE);\n    metrics.incrRenameSnapshotOps();\n    CacheEntry cacheEntry = getCacheEntry();\n    if (cacheEntry != null && cacheEntry.isSuccess()) {\n      return; // Return previous response\n    }\n    boolean success = false;\n    try {\n      namesystem.renameSnapshot(snapshotRoot, snapshotOldName,\n          snapshotNewName, cacheEntry != null);\n      success = true;\n    } finally {\n      RetryCache.setState(cacheEntry, success);\n    }\n  }\n\n  @Override // Client Protocol","sourceCodeStart":2003,"sourceCodeEnd":2039,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeRpcServer.java#L2003-L2039","documentation":"Error \"The new snapshot name is null or empty.\" thrown in apache/hadoop.","triggerScenarios":"renameSnapshot is invoked with a null or empty new name.","commonSituations":"Calling 'hdfs dfs -renameSnapshot <path> <old> \"\"' or an API call with a missing new name.","solutions":["Provide a non-null, non-empty new snapshot name for the rename operation."],"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"}