{"record":{"id":"ca3189c0b35c57ca","repo":"apache/hadoop","slug":"getsnapshotdiff-is-not-supported-for-httpfs-on-0","errorCode":null,"errorMessage":"getSnapshotDiff is not supported for HttpFs on {0}. Please check your fs.defaultFS configuration","messagePattern":"getSnapshotDiff 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":1893,"sourceCode":"      this.path = new Path(path);\n      this.oldSnapshotName = oldSnapshotName;\n      this.snapshotName = snapshotName;\n    }\n\n    /**\n     * Executes the filesystem operation.\n     * @param fs filesystem instance to use.\n     * @return A serialized JSON string of snapshot diffs.\n     * @throws IOException thrown if an IO error occurred.\n     */\n    @Override\n    public String execute(FileSystem fs) throws IOException {\n      SnapshotDiffReport sdr = null;\n      if (fs instanceof DistributedFileSystem) {\n        DistributedFileSystem dfs = (DistributedFileSystem) fs;\n        sdr = dfs.getSnapshotDiffReport(path, oldSnapshotName, snapshotName);\n      } else {\n        throw new UnsupportedOperationException(\"getSnapshotDiff is not \"\n            + \"supported for HttpFs on \" + fs.getClass()\n            + \". Please check your fs.defaultFS configuration\");\n      }\n      if (sdr != null) {\n        return JsonUtil.toJsonString(sdr);\n      } else {\n        return \"\";\n      }\n    }\n  }\n\n  /**\n   *  Executor that performs a getSnapshotDiffListing operation.\n   */\n  @InterfaceAudience.Private\n  public static class FSGetSnapshotDiffListing implements\n      FileSystemAccess.FileSystemExecutor<String> {\n","sourceCodeStart":1875,"sourceCodeEnd":1911,"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#L1875-L1911","documentation":"FSOperations.FSGetSnapshotDiff.execute() computes a snapshot diff report only through DistributedFileSystem.getSnapshotDiffReport(); the generic FileSystem interface has no diff API. When HttpFS's backing filesystem is not HDFS it throws UnsupportedOperationException (HTTP 400 to REST callers), telling you the server-side fs.defaultFS does not point at HDFS.","triggerScenarios":"Client sends op=GETSNAPSHOTDIFF (oldsnapshotname/snapshotname params) via webhdfs:// while the HttpFS server's filesystem is LocalFileSystem, an object-store FileSystem, or ViewFs.","commonSituations":"HttpFS proxied to non-HDFS storage in a hybrid lakehouse; missing fs.defaultFS in httpfs config so defaults leak in; snapshot-diff tooling pointed at an HttpFS URL whose server was never HDFS-backed.","solutions":["Set the HttpFS server's fs.defaultFS to the HDFS nameservice and restart","Validate the backing store before enabling snapshot-diff features in tools (e.g., HDFS SnapshotDiff viewers) that default to HttpFS URLs","Bypass HttpFS and use WebHDFS against the NameNode for snapshot diff queries","Confirm both snapshots exist on an HDFS-backed deployment; on non-HDFS backing the op is unavailable regardless of arguments"],"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, then GETSNAPSHOTDIFF returns JSON diff report -->","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"static DistributedFileSystem asDfs(FileSystem fs) {\n  return fs instanceof DistributedFileSystem ? (DistributedFileSystem) fs : null;\n}","tryCatchPattern":"try {\n  SnapshotDiffReport r = fs.getSnapshotDiffReport(path, oldSnap, newSnap);\n} catch (IOException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"not supported for HttpFs\")) {\n    // non-HDFS gateway: fetch diffs via WebHDFS on the NameNode instead\n    throw new UnsupportedFeatureException(\"snapshot diff requires HDFS-backed HttpFS\", e);\n  }\n  throw e;\n}","preventionTips":["Configure diff tooling with the NameNode WebHDFS URL, not an HttpFS gateway of unknown backing","Cache a capability flag after the first 'not supported for HttpFs' response and stop retrying","Assert fs.defaultFS in the HttpFS server config during deployment checks"],"tags":["httpfs","webhdfs","snapshot-diff","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"}