Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8259617

Could not read file attributes for files on WSL 2 FS mapped as network drive

XMLWordPrintable

    • x86_64
    • windows

      ADDITIONAL SYSTEM INFORMATION :
      Windows 10 2004/JDK 11

      A DESCRIPTION OF THE PROBLEM :
      Attempts to access the ownership attribute for files on Windows Subsystem for Linux 2 (WSL 2) file systems that is mounted as network drive fail with exception.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Create file on WSL 2 file system (file.txt)
      2. Map the WSL file system as network drive (Z:)
      3. From within Windows get the ownership for the file (z:\file.txt)

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The file owner information should be returned
      ACTUAL -
      Exception is thrown:

      Caused by: java.nio.file.FileSystemException: Z:\home\plamen\file.txt: Incorrect function
      at sun.nio.fs.WindowsException.translateToIOException (WindowsException.java:92)
      at sun.nio.fs.WindowsException.rethrowAsIOException (WindowsException.java:96)
      at sun.nio.fs.WindowsAclFileAttributeView.getFileSecurity (WindowsAclFileAttributeView.java:88)
      at sun.nio.fs.WindowsAclFileAttributeView.getOwner (WindowsAclFileAttributeView.java:121)
      at sun.nio.fs.FileOwnerAttributeViewImpl.getOwner (FileOwnerAttributeViewImpl.java:91)


      ---------- BEGIN SOURCE ----------
      // You can run this in JShell to reproduce the issue
      Exception java.nio.file.FileSystemException: z:\home\ptotev\file.txt: Incorrect function.
            at WindowsException.translateToIOException (WindowsException.java:92)
            at WindowsException.rethrowAsIOException (WindowsException.java:96)
            at WindowsAclFileAttributeView.getFileSecurity (WindowsAclFileAttributeView.java:88)
            at WindowsAclFileAttributeView.getOwner (WindowsAclFileAttributeView.java:121)
            at FileOwnerAttributeViewImpl.getOwner (FileOwnerAttributeViewImpl.java:91)
      ---------- END SOURCE ----------

      FREQUENCY : always


            bpb Brian Burkhalter
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: