{"record":{"id":"6a1214baa396a1ae","repo":"eclipse-vertx/vert.x","slug":"change-group-of-file-not-supported","errorCode":null,"errorMessage":"Change group of file not supported","messagePattern":"Change group of file not supported","errorType":"exception","errorClass":"FileSystemException","httpStatus":null,"severity":"error","filePath":"vertx-core/src/main/java/io/vertx/core/file/impl/FileSystemImpl.java","lineNumber":568,"sourceCode":"        }\n        return null;\n      }\n    };\n  }\n\n  protected BlockingAction<Void> chownInternal(String path, String user, String group) {\n    Objects.requireNonNull(path);\n    return new BlockingAction<Void>() {\n      public Void perform() {\n        try {\n          Path target = resolveFile(path).toPath();\n          UserPrincipalLookupService service = target.getFileSystem().getUserPrincipalLookupService();\n          UserPrincipal userPrincipal = user == null ? null : service.lookupPrincipalByName(user);\n          GroupPrincipal groupPrincipal = group == null ? null : service.lookupPrincipalByGroupName(group);\n          if (groupPrincipal != null) {\n            PosixFileAttributeView view = Files.getFileAttributeView(target, PosixFileAttributeView.class, LinkOption.NOFOLLOW_LINKS);\n            if (view == null) {\n              throw new FileSystemException(\"Change group of file not supported\");\n            }\n            view.setGroup(groupPrincipal);\n\n          }\n          if (userPrincipal != null) {\n            Files.setOwner(target, userPrincipal);\n          }\n        } catch (SecurityException e) {\n          throw new FileSystemException(\"Accessed denied for chown on \" + path);\n        } catch (IOException e) {\n          throw new FileSystemException(getFileAccessErrorMessage(\"crown\", path), e);\n        }\n        return null;\n      }\n    };\n  }\n\n  private BlockingAction<FileProps> propsInternal(String path) {","sourceCodeStart":550,"sourceCodeEnd":586,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/file/impl/FileSystemImpl.java#L550-L586","documentation":"Thrown when changing the group of a file is requested via FileSystem.chown but the filesystem does not provide a PosixFileAttributeView (Files.getFileAttributeView returned null). Vert.x detects this upfront and fails instead of letting the view be used. The operation is simply not supported on that filesystem.","triggerScenarios":"Calling vertx.fileSystem().chown(path, user, group) with a non-null group on a filesystem lacking PosixFileAttributeView — typically Windows (NTFS), FAT32, or network mounts without POSIX semantics.","commonSituations":"Deploying to Windows or to a Docker volume backed by a non-POSIX filesystem while reusing POSIX-oriented setup code; shared NAS mounts; CI runners on Windows.","solutions":["Guard the chown call behind an OS/filesystem check and omit the group parameter on non-POSIX systems.","Call chown with group=null so only the owner is changed (userPrincipal path does not need the POSIX view).","Use platform-appropriate tooling (icacls/PowerShell on Windows) outside the JVM for group changes.","Wrap the call and treat FileSystemException with this message as 'unsupported on this platform' rather than retrying."],"exampleFix":"// before\nvertx.fileSystem().chown(\"/app/data\", \"appuser\", \"appgroup\"); // fails on Windows\n// after\nif (\"owner\".equals(System.getProperty(\"os.name\")) == false && isPosixFs()) {\n  vertx.fileSystem().chown(\"/app/data\", \"appuser\", \"appgroup\");\n} else {\n  vertx.fileSystem().chown(\"/app/data\", \"appuser\", null);\n}","handlingStrategy":"validation","validationCode":"boolean posixSupported = FileSystems.getDefault().supportedFileAttributeViews().contains(\"posix\");\nif (!posixSupported) group = null; // avoid setGroup path","typeGuard":null,"tryCatchPattern":"try { vertx.fileSystem().chownBlocking(path, user, group); } catch (FileSystemException e) { if (e.getMessage().contains(\"not supported\")) { log.warn(\"group change unsupported here\"); } else throw e; }","preventionTips":["Check supportedFileAttributeViews().contains(\"posix\") before group changes","Pass null group on Windows/non-POSIX mounts","Keep platform-specific setup out of shared code paths"],"tags":["filesystem","chown","posix","windows","unsupported"],"backgroundTag":"operation-not-supported","analyzedSha":"fb308bd8c3f12c79f4ae89bef67fadf6c80d036e","analyzedAt":"2026-09-06T11:37:12.241Z","contentChangedAt":"2026-09-06T11:37:12.241Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}