{"record":{"id":"466a92ef8c7b26c7","repo":"seaweedfs/seaweedfs","slug":"getsimplename-doesn-t-support-createsnapshot","errorCode":null,"errorMessage":"{getSimpleName} doesn't support createSnapshot","messagePattern":"(.+?) doesn't support createSnapshot","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystem.java","lineNumber":393,"sourceCode":"    }\n\n    public boolean supportsSymlinks() {\n        return false;\n    }\n\n    /**\n     * Create a snapshot.\n     *\n     * @param path         The directory where snapshots will be taken.\n     * @param snapshotName The name of the snapshot\n     * @return the snapshot path.\n     * @throws IOException                   IO failure\n     * @throws UnsupportedOperationException if the operation is unsupported\n     */\n    @Override\n    public Path createSnapshot(Path path, String snapshotName)\n            throws IOException {\n        throw new UnsupportedOperationException(getClass().getSimpleName()\n                + \" doesn't support createSnapshot\");\n    }\n\n    /**\n     * Rename a snapshot.\n     *\n     * @param path            The directory path where the snapshot was taken\n     * @param snapshotOldName Old name of the snapshot\n     * @param snapshotNewName New name of the snapshot\n     * @throws IOException                   IO failure\n     * @throws UnsupportedOperationException if the operation is unsupported\n     *                                       (default outcome).\n     */\n    @Override\n    public void renameSnapshot(Path path, String snapshotOldName,\n            String snapshotNewName) throws IOException {\n        throw new UnsupportedOperationException(getClass().getSimpleName()\n                + \" doesn't support renameSnapshot\");","sourceCodeStart":375,"sourceCodeEnd":411,"githubUrl":"https://github.com/seaweedfs/seaweedfs/blob/1c926e8fac8e8001ce25efa1027c90b02b4a1804/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystem.java#L375-L411","documentation":"UnsupportedOperationException('<class> doesn't support createSnapshot') thrown unconditionally by SeaweedFileSystem.createSnapshot() (seaweed.hdfs.SeaweedFileSystem:393). The HDFS snapshot API (point-in-time, read-only copy of a directory subtree) is not implemented by this client, so creating a snapshot on a seaweedfs:// path always fails deterministically.","triggerScenarios":"Calling fs.createSnapshot(path, snapshotName) on a SeaweedFileSystem; scripts using 'hdfs dfsapi'-style snapshot commands; backup/DR tooling that snapshots directories before destructive operations.","commonSituations":"Disaster-recovery automation written against HDFS being repointed at SeaweedFS; admin runbooks that snapshot before big migrations; version-driven re-exposure when ops tooling adds snapshot safety checks.","solutions":["Use SeaweedFS-native protection instead: filer-level replication to another cluster, volume snapshots, or S3-style versioning depending on deployment.","Implement an application-level 'snapshot' by recursively copying the subtree to a backup path before mutating it.","Remove/disable snapshot steps in runbooks when the target is seaweedfs://."],"exampleFix":"// before\nfs.createSnapshot(dirPath, \"pre-migration\"); // UnsupportedOperationException\n\n// after — explicit copy snapshot\nPath snap = new Path(dirPath.getParent(), dirPath.getName() + \".snap-\" + System.currentTimeMillis());\norg.apache.hadoop.fs.FileUtil.copy(fs, dirPath, fs, snap, false, true, fs.getConf());","handlingStrategy":"try-catch","validationCode":"boolean supportsSnapshots(FileSystem fs) {\n    return !(fs instanceof seaweed.hdfs.SeaweedFileSystem)\n        && !\"seaweedfs\".equals(fs.getUri().getScheme());\n}","typeGuard":"boolean canSnapshot = !(fs instanceof seaweed.hdfs.SeaweedFileSystem);","tryCatchPattern":"try {\n    fs.createSnapshot(dir, name);\n} catch (UnsupportedOperationException e) {\n    // fall back to a copy-based snapshot\n    org.apache.hadoop.fs.FileUtil.copy(fs, dir, fs, snapPath, false, true, fs.getConf());\n}","preventionTips":["Treat snapshots as an HDFS-specific capability; probe scheme/instance before calling on compatible filesystems.","For SeaweedFS, plan DR at the filer/volume replication layer, not the Hadoop snapshot API.","Catch UnsupportedOperationException explicitly in admin tooling so one bad target doesn't abort the whole runbook."],"tags":["java","hadoop","seaweedfs","unsupported-operation","snapshot","backup"],"backgroundTag":null,"analyzedSha":"1c926e8fac8e8001ce25efa1027c90b02b4a1804","analyzedAt":"2026-08-15T15:37:02.018Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}