{"record":{"id":"46699e5ba190a3f1","repo":"apache/hadoop","slug":"getsnapshotlisting-is-not-supported-for-httpfs-on","errorCode":null,"errorMessage":"getSnapshotListing is not supported for HttpFs on {0}. Please check your fs.defaultFS configuration","messagePattern":"getSnapshotListing 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":2027,"sourceCode":"     */\n    public FSGetSnapshotListing(String path) {\n      this.path = new Path(path);\n    }\n\n    /**\n     * Executes the filesystem operation.\n     * @param fs filesystem instance to use.\n     * @return A JSON string of all snapshots for a snapshottable directory.\n     * @throws IOException thrown if an IO error occurred.\n     */\n    @Override\n    public String execute(FileSystem fs) throws IOException {\n      SnapshotStatus[] sds = null;\n      if (fs instanceof DistributedFileSystem) {\n        DistributedFileSystem dfs = (DistributedFileSystem) fs;\n        sds = dfs.getSnapshotListing(path);\n      } else {\n        throw new UnsupportedOperationException(\"getSnapshotListing 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 getServerDefaults operation.\n   */\n  @InterfaceAudience.Private\n  public static class FSGetServerDefaults\n      implements FileSystemAccess.FileSystemExecutor<String> {\n\n    /**\n     * Creates a getServerDefaults executor.\n     */\n    public FSGetServerDefaults() {","sourceCodeStart":2009,"sourceCodeEnd":2045,"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#L2009-L2045","documentation":"FSOperations.FSGetSnapshotListing.execute() lists a directory's snapshots via DistributedFileSystem.getSnapshotListing(path), which has no counterpart in the generic FileSystem API. On any non-HDFS backing filesystem the executor throws UnsupportedOperationException (surfaced as HTTP 400 with this message), directing you to the HttpFS server's fs.defaultFS setting.","triggerScenarios":"Client sends op=GETSNAPSHOTLISTING for a path via webhdfs:// while HttpFS's backing filesystem is LocalFileSystem or an object-store FileSystem.","commonSituations":"Snapshot browser tooling hitting an HttpFS gateway in front of non-HDFS storage; dev environment running HttpFS without HDFS; fs.defaultFS overwritten during a storage migration.","solutions":["Set fs.defaultFS to the HDFS nameservice in the HttpFS server config and restart","Confirm the directory path is on the HDFS namespace the server mounts (not a mount-table alias resolving elsewhere)","Query the NameNode via WebHDFS directly if the gateway cannot be HDFS-backed","Skip snapshot-listing features when the deployment is known non-HDFS"],"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; GETSNAPSHOTLISTING then returns snapshot JSON -->","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"static DistributedFileSystem asDfs(FileSystem fs) {\n  return fs instanceof DistributedFileSystem ? (DistributedFileSystem) fs : null;\n}","tryCatchPattern":"try {\n  SnapshotStatus[] snaps = fs.getSnapshotListing(path);\n} catch (IOException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"not supported for HttpFs\")) {\n    LOG.warn(\"Snapshot listing unavailable for {} (non-HDFS HttpFS)\", path);\n    return java.util.Collections.emptyList();\n  }\n  throw e;\n}","preventionTips":["Route snapshot browsers at the NameNode's WebHDFS port","Feature-flag snapshot UI per deployment instead of assuming HDFS","Verify the gateway's effective fs.defaultFS from its startup log after config edits"],"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-23T01:17:44.959Z"}