java.nio.file.FileSystemException: /run/user/1000/gvfs/dav:host=localhost,port=42232,ssl=false,prefix=%2Fa/test: Operation not supported

JDK Bug System | Webbug Group | 6 months ago
  1. 0

    FULL PRODUCT VERSION : java version "1.8.0_65" Java(TM) SE Runtime Environment (build 1.8.0_65-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode) ADDITIONAL OS VERSION INFORMATION : Linux debian 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-2 (2016-04-08) x86_64 GNU/Linux A DESCRIPTION OF THE PROBLEM : An attempt to open a FileChannel or AsynchronousFileChannel e.g. using, StandardOpenOption.WRITE) fails if path points to a file on a gvfs mounted WebDav share. When using the terminal to inspect the share ls -l shows that the files are writable by the user running the java program. In addition using a FileOutputStream to write data to the file is possible. When mounting the same WebDav share using mount -t davfs [...] channels can be opened. When doing, StandardOpenOption.READ) this works so seem to be releated to the WRITE option. I am note sure if this applies to all gvfs mounts or only WebDav shares. I confirmed this for a WebDav share. STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : 1 Start a webdav server which may afterwards be reachable e.g. at http://localhost:42232/a 2 Use "gvfs-mount dav:localhost:42232/a" to mount the drive. 3 Create a file "test" in this share using e.g. a text editor. 4 Create a path to the file (gvfs mounted to /run/user/1000/gvfs/dav:host=localhost,port=42232,ssl=false,prefix=%2Fa in my example) 5 Use this path to create a file channel with the WRITE open option specified EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - Because writing is in general possible, e.g. using FileOutputStream, I would expect it to create a writable FileChannel as an alternativ an UnsupportedOperationException as specified in the javadoc of open could be thrown. ACTUAL - A FileSystemException (not UnsupportedOperationException) with message "Operation not supported" is thrown. ERROR MESSAGES/STACK TRACES THAT OCCUR : java.nio.file.FileSystemException: /run/user/1000/gvfs/dav:host=localhost,port=42232,ssl=false,prefix=%2Fa/test: Operation not supported at sun.nio.fs.UnixException.translateToIOException( at sun.nio.fs.UnixException.rethrowAsIOException( at sun.nio.fs.UnixException.rethrowAsIOException( at sun.nio.fs.UnixFileSystemProvider.newAsynchronousFileChannel( at at [...] REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- private final String root = "/run/user/1000/gvfs/dav:host=localhost,port=42232,ssl=false,prefix=%2Fa"; private final Path test = Paths.get(root + "/test"); @Test public void testCreateChannelForWriting() throws IOException { try (FileChannel channel =, StandardOpenOption.WRITE)) { } } ---------- END SOURCE ---------- CUSTOMER SUBMITTED WORKAROUND : Mount the filesystem using mount -t davfs [...] instead of gvfs. This is possible in some cases but not always an option because the mount process used by third party software can not always be influenced.

    JDK Bug System | 6 months ago | Webbug Group
    java.nio.file.FileSystemException: /run/user/1000/gvfs/dav:host=localhost,port=42232,ssl=false,prefix=%2Fa/test: Operation not supported
  2. 0

    why AsynchronousFileChannel for multi-thread I/Os throws java.nio.file.FileSystemException?

    Stack Overflow | 4 years ago | ChrisGr
    java.nio.file.FileSystemException: C:\Documents and Settings\Administrator\workspace\TileMap\FileMap.txt: The process cannot access the file because it is being used by another process.</p> <pre><code>at sun.nio.fs.WindowsException.translateToIOException(
  3. 0

    running " mvn package" failed

    GitHub | 3 years ago | luckypoem
    java.nio.file.FileSystemException: src/test/resources: Operation not supported
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Files.walkFileTree throws exception outside visitor methods when walking /proc

    Stack Overflow | 2 years ago | Thomas Larsson Kron
    java.nio.file.FileSystemException: /proc/2662/map_files: Operation not permitted
  6. 0

    GitHub comment 2722#262421023

    GitHub | 2 months ago | tingking23
    org.ow2.proactive.scheduler.task.exceptions.ForkedJvmProcessException: Failed to execute task in a forked JVM

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.nio.file.FileSystemException

      /run/user/1000/gvfs/dav:host=localhost,port=42232,ssl=false,prefix=%2Fa/test: Operation not supported

      at sun.nio.fs.UnixException.translateToIOException()
    2. Java RT
      1. sun.nio.fs.UnixException.translateToIOException(
      2. sun.nio.fs.UnixException.rethrowAsIOException(
      3. sun.nio.fs.UnixException.rethrowAsIOException(
      4. sun.nio.fs.UnixFileSystemProvider.newAsynchronousFileChannel(
      6 frames