{"record":{"id":"61eebb2c7d086f62","repo":"apache/hadoop","slug":"directory-is-not-a-snapshottable-directory-61eebb","errorCode":null,"errorMessage":"Directory is not a snapshottable directory: {}","messagePattern":"Directory is not a snapshottable directory: (.+?)","errorType":"exception","errorClass":"SnapshotException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java","lineNumber":7167,"sourceCode":"   *                  to start from.\n   * @return a list in which each entry describes a corrupt file/block\n   * @throws IOException\n   */\n  List<String> listCorruptFileBlocksWithSnapshot(String path,\n      List<String> snapshottableDirs, String[] cookieTab) throws IOException {\n    final Collection<CorruptFileBlockInfo> corruptFileBlocks =\n        listCorruptFileBlocks(path, cookieTab);\n    List<String> list = new ArrayList<String>();\n\n    // Precalculate snapshottableFeature list\n    List<DirectorySnapshottableFeature> lsf = new ArrayList<>();\n    if (snapshottableDirs != null) {\n      for (String snap : snapshottableDirs) {\n        final INode isnap = getFSDirectory().getINode(snap, DirOp.READ_LINK);\n        final DirectorySnapshottableFeature sf =\n            isnap.asDirectory().getDirectorySnapshottableFeature();\n        if (sf == null) {\n          throw new SnapshotException(\n              \"Directory is not a snapshottable directory: \" + snap);\n        }\n        lsf.add(sf);\n      }\n    }\n\n    for (CorruptFileBlockInfo c : corruptFileBlocks) {\n      if (getFileInfo(c.path, true, false, false) != null) {\n        list.add(c.toString());\n      }\n      final Collection<String> snaps = FSDirSnapshotOp\n          .getSnapshotFiles(getFSDirectory(), lsf, c.path);\n      if (snaps != null) {\n        for (String snap : snaps) {\n          // follow the syntax of CorruptFileBlockInfo#toString()\n          list.add(c.block.getBlockName() + \"\\t\" + snap);\n        }\n      }","sourceCodeStart":7149,"sourceCodeEnd":7185,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java#L7149-L7185","documentation":"Error \"Directory is not a snapshottable directory: {}\" thrown in apache/hadoop.","triggerScenarios":"A snapshot create/rename/delete operation targets a directory that has not been made snapshottable.","commonSituations":"Running 'hdfs dfs -createSnapshot' on a directory where allowSnapshot was never executed.","solutions":["Enable snapshots on the directory first with 'hdfs dfsadmin -allowSnapshot <path>', then retry the snapshot 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"}