{"record":{"id":"fd143842be72c693","repo":"apache/hadoop","slug":"getsnapshottabledirlisting-is-not-supported-for-ht","errorCode":null,"errorMessage":"getSnapshottableDirListing is not supported for HttpFs on {0}. Please check your fs.defaultFS configuration","messagePattern":"getSnapshottableDirListing is not supported for HttpFs on (.+?)\\. Please check your fs\\.defaultFS configuration","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":400,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/server/FSOperations.java","lineNumber":1990,"sourceCode":"     * Creates a getSnapshottableDirListing executor.\n     */\n    public FSGetSnapshottableDirListing() {\n    }\n\n    /**\n     * Executes the filesystem operation.\n     * @param fs filesystem instance to use.\n     * @return A JSON string of all snapshottable directories.\n     * @throws IOException thrown if an IO error occurred.\n     */\n    @Override\n    public String execute(FileSystem fs) throws IOException {\n      SnapshottableDirectoryStatus[] sds = null;\n      if (fs instanceof DistributedFileSystem) {\n        DistributedFileSystem dfs = (DistributedFileSystem) fs;\n        sds = dfs.getSnapshottableDirListing();\n      } else {\n        throw new UnsupportedOperationException(\"getSnapshottableDirListing is \"\n            + \"not supported for HttpFs on \" + fs.getClass()\n            + \". Please check your fs.defaultFS configuration\");\n      }\n      return JsonUtil.toJsonString(sds);\n    }\n  }\n\n  /**\n   *  Executor that performs a getSnapshotListing operation.\n   */\n  @InterfaceAudience.Private\n  public static class FSGetSnapshotListing implements\n      FileSystemAccess.FileSystemExecutor<String> {\n    private Path path;\n\n    /**\n     * Creates a getSnapshotDiff executor.\n     * @param path directory path of the snapshots to be examined.","sourceCodeStart":1972,"sourceCodeEnd":2008,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/server/FSOperations.java#L1972-L2008","documentation":"FSOperations.FSGetSnapshottableDirListing.execute() lists snapshottable directories through DistributedFileSystem.getSnapshottableDirListing(), an HDFS-only API. If the filesystem HttpFS opened is anything else, it throws UnsupportedOperationException (delivered as HTTP 400 with this text), because snapshottable-dir tracking simply does not exist outside HDFS.","triggerScenarios":"Client sends op=GETSNAPSHOTTABLEDIRLIST via webhdfs:// against an HttpFS server whose fs.defaultFS is file:/// or an object-store scheme.","commonSituations":"Snapshot-management UIs defaulting to the HttpFS gateway; HttpFS installed standalone (no HDFS) for testing; production gateway repointed to non-HDFS storage without updating clients.","solutions":["Configure and reload the HttpFS server with fs.defaultFS=hdfs://<nameservice>","Verify the server actually binds HDFS by checking startup logs for the filesystem implementation it loaded","Use WebHDFS (webhdfs://namenode:9870) directly for snapshottable-dir queries","If non-HDFS backing is intentional, remove snapshottable-dir listing from the client workflow"],"exampleFix":"<!-- before: httpfs-site.xml -->\n<property><name>fs.defaultFS</name><value>file:///</value></property>\n<!-- after -->\n<property><name>fs.defaultFS</name><value>hdfs://ns1</value></property>\n<!-- restart HttpFS so the executor takes the DistributedFileSystem branch -->","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"static DistributedFileSystem asDfs(FileSystem fs) {\n  return fs instanceof DistributedFileSystem ? (DistributedFileSystem) fs : null;\n}","tryCatchPattern":"try {\n  SnapshottableDirectoryStatus[] s = fs.getSnapshottableDirListing();\n} catch (IOException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"not supported for HttpFs\")) {\n    LOG.warn(\"Snapshottable-dir listing unavailable: HttpFS not HDFS-backed\");\n    return new SnaphottableDirectoryStatus[0];\n  }\n  throw e;\n}","preventionTips":["Snapshot UIs should degrade to 'snapshots unavailable' on this error instead of failing the page","Ensure httpfs-site.xml fs.defaultFS points at HDFS wherever snapshot features are exposed","Smoke-test GETSNAPSHOTTABLEDIRLIST after gateway config changes"],"tags":["httpfs","webhdfs","snapshot","unsupported-operation","fs-defaultfs"],"backgroundTag":"unsupported-filesystem-operation","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}