{"record":{"id":"f6dc091e4168e251","repo":"apache/hadoop","slug":"disallowsnapshot-is-not-supported-for-httpfs-on-0","errorCode":null,"errorMessage":"disallowSnapshot is not supported for HttpFs on {0}. Please check your fs.defaultFS configuration","messagePattern":"disallowSnapshot 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":1745,"sourceCode":"     * Creates a disallowSnapshot executor.\n     * @param path directory path to allow snapshot.\n     */\n    public FSDisallowSnapshot(String path) {\n      this.path = new Path(path);\n    }\n\n    /**\n     * Executes the filesystem operation.\n     * @param fs filesystem instance to use.\n     * @throws IOException thrown if an IO error occurred.\n     */\n    @Override\n    public Void execute(FileSystem fs) throws IOException {\n      if (fs instanceof DistributedFileSystem) {\n        DistributedFileSystem dfs = (DistributedFileSystem) fs;\n        dfs.disallowSnapshot(path);\n      } else {\n        throw new UnsupportedOperationException(\"disallowSnapshot is not \"\n            + \"supported for HttpFs on \" + fs.getClass()\n            + \". Please check your fs.defaultFS configuration\");\n      }\n      return null;\n    }\n  }\n\n  /**\n   *  Executor that performs a createSnapshot FileSystemAccess operation.\n   */\n  @InterfaceAudience.Private\n  public static class FSCreateSnapshot implements\n      FileSystemAccess.FileSystemExecutor<String> {\n\n    private Path path;\n    private String snapshotName;\n\n    /**","sourceCodeStart":1727,"sourceCodeEnd":1763,"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#L1727-L1763","documentation":"FSOperations.FSDisallowSnapshot.execute() implements DISALLOWSNAPSHOT only for DistributedFileSystem, because reverting a snapshottable directory is an HDFS-specific RPC with no generic FileSystem API. When the HttpFS server's backing filesystem (from its fs.defaultFS) is not HDFS, it throws UnsupportedOperationException (surfaced to REST clients as HTTP 400 with this message).","triggerScenarios":"Client sends op=DISALLOWSNAPSHOT via webhdfs:// while HttpFS proxies to a non-HDFS filesystem (local, s3a, abfs, viewfs).","commonSituations":"HttpFS gateway fronting object storage; httpfs-site.xml fs.defaultFS unset so LocalFileSystem is used; environment drift between dev (local FS) and prod (HDFS) exposing the call only in dev.","solutions":["Configure fs.defaultFS=hdfs://<nameservice> in the HttpFS server's configuration and restart it","Confirm the loaded server config (httpfs-site.xml) rather than an inherited core-site with a non-HDFS default","Use WebHDFS directly against the NameNode if the HttpFS proxy cannot be reconfigured","Gate snapshot-management calls on a deployment capability check if the same code targets mixed backing stores"],"exampleFix":"<!-- before: httpfs-site.xml -->\n<property><name>fs.defaultFS</name><value>s3a://bucket</value></property>\n<!-- after -->\n<property><name>fs.defaultFS</name><value>hdfs://ns1</value></property>\n<!-- restart HttpFS so DISALLOWSNAPSHOT reaches DistributedFileSystem -->","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"static DistributedFileSystem asDfs(FileSystem fs) {\n  return fs instanceof DistributedFileSystem ? (DistributedFileSystem) fs : null;\n}","tryCatchPattern":"try {\n  fs.disallowSnapshot(path);\n} catch (IOException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"not supported for HttpFs\")) {\n    LOG.warn(\"HttpFS not HDFS-backed; cannot disallowSnapshot({})\", path);\n    return;\n  }\n  throw e;\n}","preventionTips":["Verify the HttpFS server's fs.defaultFS resolves to HDFS before shipping snapshot workflows","Make cleanup scripts tolerant: treat this capability error as 'nothing to clean'","Keep dev HttpFS instances HDFS-backed (e.g., mini-cluster) so capability gaps surface before prod"],"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"}