eclipse-vertx/vert.x · error · FileSystemException

Change group of file not supported

Error message

Change group of file not supported

What it means

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.

Source

Thrown at vertx-core/src/main/java/io/vertx/core/file/impl/FileSystemImpl.java:568

        }
        return null;
      }
    };
  }

  protected BlockingAction<Void> chownInternal(String path, String user, String group) {
    Objects.requireNonNull(path);
    return new BlockingAction<Void>() {
      public Void perform() {
        try {
          Path target = resolveFile(path).toPath();
          UserPrincipalLookupService service = target.getFileSystem().getUserPrincipalLookupService();
          UserPrincipal userPrincipal = user == null ? null : service.lookupPrincipalByName(user);
          GroupPrincipal groupPrincipal = group == null ? null : service.lookupPrincipalByGroupName(group);
          if (groupPrincipal != null) {
            PosixFileAttributeView view = Files.getFileAttributeView(target, PosixFileAttributeView.class, LinkOption.NOFOLLOW_LINKS);
            if (view == null) {
              throw new FileSystemException("Change group of file not supported");
            }
            view.setGroup(groupPrincipal);

          }
          if (userPrincipal != null) {
            Files.setOwner(target, userPrincipal);
          }
        } catch (SecurityException e) {
          throw new FileSystemException("Accessed denied for chown on " + path);
        } catch (IOException e) {
          throw new FileSystemException(getFileAccessErrorMessage("crown", path), e);
        }
        return null;
      }
    };
  }

  private BlockingAction<FileProps> propsInternal(String path) {

View on GitHub (pinned to fb308bd8c3)

Solutions

  1. Guard the chown call behind an OS/filesystem check and omit the group parameter on non-POSIX systems.
  2. Call chown with group=null so only the owner is changed (userPrincipal path does not need the POSIX view).
  3. Use platform-appropriate tooling (icacls/PowerShell on Windows) outside the JVM for group changes.
  4. Wrap the call and treat FileSystemException with this message as 'unsupported on this platform' rather than retrying.

Example fix

// before
vertx.fileSystem().chown("/app/data", "appuser", "appgroup"); // fails on Windows
// after
if ("owner".equals(System.getProperty("os.name")) == false && isPosixFs()) {
  vertx.fileSystem().chown("/app/data", "appuser", "appgroup");
} else {
  vertx.fileSystem().chown("/app/data", "appuser", null);
}
Defensive patterns

Strategy: validation

Validate before calling

boolean posixSupported = FileSystems.getDefault().supportedFileAttributeViews().contains("posix");
if (!posixSupported) group = null; // avoid setGroup path

Try / catch

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; }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of eclipse-vertx/vert.x@fb308bd8c3 (2026-09-06). Data as JSON: /api/errors/6a1214baa396a1ae. Report an issue: GitHub.