{"record":{"id":"d2bebc92e5261fed","repo":"apache/hadoop","slug":"the-snapshot-name-is-null-or-empty","errorCode":null,"errorMessage":"The snapshot name is null or empty.","messagePattern":"The 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":1979,"sourceCode":"    metrics.incrCreateSnapshotOps();\n    String ret = null;\n    try {\n      ret = namesystem.createSnapshot(snapshotRoot, snapshotName,\n          cacheEntry != null);\n    } finally {\n      RetryCache.setState(cacheEntry, ret != null, ret);\n    }\n    return ret;\n  }\n  \n  @Override\n  public void deleteSnapshot(String snapshotRoot, String snapshotName)\n      throws IOException {\n    checkNNStartup();\n    LOG.debug(\"*DIR* NameNode.deleteSnapshot: Path {} and SnapshotName {}\",\n        snapshotRoot, snapshotName);\n    if (snapshotName == null || snapshotName.isEmpty()) {\n      throw new IOException(\"The snapshot name is null or empty.\");\n    }\n    namesystem.checkOperation(OperationCategory.WRITE);\n    metrics.incrDeleteSnapshotOps();\n    CacheEntry cacheEntry = getCacheEntry();\n    if (cacheEntry != null && cacheEntry.isSuccess()) {\n      return; // Return previous response\n    }\n    boolean success = false;\n    try {\n      namesystem.deleteSnapshot(snapshotRoot, snapshotName, cacheEntry != null);\n      success = true;\n    } finally {\n      RetryCache.setState(cacheEntry, success);\n    }\n  }\n\n  @Override\n  // Client Protocol","sourceCodeStart":1961,"sourceCodeEnd":1997,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeRpcServer.java#L1961-L1997","documentation":"Error \"The snapshot name is null or empty.\" thrown in apache/hadoop.","triggerScenarios":"createSnapshot is invoked without a snapshot name (null or empty).","commonSituations":"Calling 'hdfs dfs -createSnapshot <path>' without specifying a name where the API requires one.","solutions":["Provide a non-null, non-empty snapshot name when creating a snapshot."],"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"}