Uploaded image for project: 'Commons VFS'
  1. Commons VFS
  2. VFS-662

SftpFileSystem has Thread-safe issue about idleChannel

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • None
    • 2.4
    • None

    Description

      {code:java}
      Caused by: org.apache.commons.vfs2.FileSystemException: Could not connect to SFTP server at
      at org.apache.commons.vfs2.provider.sftp.SftpFileSystem.getChannel (SftpFileSystem.java:149)
      at org.apache.commons.vfs2.provider.sftp.SftpFileObject.statSelf (SftpFileObject.java:152)
      at org.apache.commons.vfs2.provider.sftp.SftpFileObject.doGetType (SftpFileObject.java:113)
      at org.apache.commons.vfs2.provider.AbstractFileObject.getType (AbstractFileObject.java:1517)
      at org.apache.commons.vfs2.provider.sftp.SftpFileObject.refresh (SftpFileObject.java:90)
      at org.apache.commons.vfs2.provider.AbstractFileSystem.resolveFile (AbstractFileSystem.java:364)
      at org.apache.commons.vfs2.provider.AbstractFileSystem.resolveFile (AbstractFileSystem.java:317)
      at org.apache.commons.vfs2.provider.AbstractFileObject.resolveFile (AbstractFileObject.java:2039)
      at org.apache.commons.vfs2.FileObject$resolveFile$23.call (Unknown Source)
      
      
      
      Caused by: com.jcraft.jsch.JSchException: java.io.IOException: channel is broken
      at com.jcraft.jsch.ChannelSftp.start (ChannelSftp.java:315)
      at com.jcraft.jsch.Channel.connect (Channel.java:152)
      at com.jcraft.jsch.Channel.connect (Channel.java:145)
      at org.apache.commons.vfs2.provider.sftp.SftpFileSystem.getChannel (SftpFileSystem.java:113)
      at org.apache.commons.vfs2.provider.sftp.SftpFileObject.doGetOutputStream (SftpFileObject.java:635)
      at org.apache.commons.vfs2.provider.AbstractFileObject.getOutputStream (AbstractFileObject.java:1399)
      at org.apache.commons.vfs2.provider.DefaultFileContent.getOutputStream (DefaultFileContent.java:479)
      at org.apache.commons.vfs2.provider.DefaultFileContent.getOutputStream (DefaultFileContent.java:457)
      
      
      
      Caused by: com.jcraft.jsch.JSchException: java.net.SocketException: Broken pipe (Write failed)
      at com.jcraft.jsch.Channel.connect (Channel.java:159)
      at com.jcraft.jsch.Channel.connect (Channel.java:145)
      at org.apache.commons.vfs2.provider.sftp.SftpFileSystem.getChannel (SftpFileSystem.java:113)
      at org.apache.commons.vfs2.provider.sftp.SftpFileObject.doGetOutputStream (SftpFileObject.java:635)
      at org.apache.commons.vfs2.provider.AbstractFileObject.getOutputStream (AbstractFileObject.java:1399)
      at org.apache.commons.vfs2.provider.DefaultFileContent.getOutputStream (DefaultFileContent.java:479)
      at org.apache.commons.vfs2.provider.DefaultFileContent.getOutputStream (DefaultFileContent.java:457)
      
      
      Caused by: java.io.IOException: inputstream is closed
      at com.jcraft.jsch.ChannelSftp.fill (ChannelSftp.java:2911)
      at com.jcraft.jsch.ChannelSftp.header (ChannelSftp.java:2935)
      at com.jcraft.jsch.ChannelSftp.checkStatus (ChannelSftp.java:2473)
      at com.jcraft.jsch.ChannelSftp.access$300 (ChannelSftp.java:36)
      at com.jcraft.jsch.ChannelSftp$1.flush (ChannelSftp.java:851)
      at java.io.BufferedOutputStream.flush (BufferedOutputStream.java:141)
      at org.apache.commons.vfs2.util.MonitorOutputStream.flush (MonitorOutputStream.java:134)
      at java.io.BufferedOutputStream.flush (BufferedOutputStream.java:141)
      at org.apache.commons.vfs2.util.MonitorOutputStream.flush (MonitorOutputStream.java:134)
      
      
      
      
      Caused by: com.jcraft.jsch.JSchException: session is down
      at com.jcraft.jsch.Channel.sendChannelOpen (Channel.java:762)
      at com.jcraft.jsch.Channel.connect (Channel.java:151)
      at com.jcraft.jsch.Channel.connect (Channel.java:145)
      at org.apache.commons.vfs2.provider.sftp.SftpFileSystem.getChannel (SftpFileSystem.java:113)
      at org.apache.commons.vfs2.provider.sftp.SftpFileObject.doGetOutputStream (SftpFileObject.java:635)
      at org.apache.commons.vfs2.provider.AbstractFileObject.getOutputStream (AbstractFileObject.java:1399)
      at org.apache.commons.vfs2.provider.DefaultFileContent.getOutputStream (DefaultFileContent.java:479)
      at org.apache.commons.vfs2.provider.DefaultFileContent.getOutputStream (DefaultFileContent.java:457)
      
      
      Caused by: java.net.SocketException: Broken pipe (Write failed)
      at java.net.SocketOutputStream.socketWrite0 (Native Method)
      at java.net.SocketOutputStream.socketWrite (SocketOutputStream.java:111)
      at java.net.SocketOutputStream.write (SocketOutputStream.java:155)
      at com.jcraft.jsch.IO.put (IO.java:60)
      at com.jcraft.jsch.Session._write (Session.java:1379)
      at com.jcraft.jsch.Session.write (Session.java:1343)
      at com.jcraft.jsch.ChannelSftp.sendOPEN (ChannelSftp.java:2583)
      at com.jcraft.jsch.ChannelSftp.sendOPENW (ChannelSftp.java:2571)
      at com.jcraft.jsch.ChannelSftp.put (ChannelSftp.java:753)
      at com.jcraft.jsch.ChannelSftp.put (ChannelSftp.java:709)
      at com.jcraft.jsch.ChannelSftp.put (ChannelSftp.java:703)
      at org.apache.commons.vfs2.provider.sftp.SftpFileObject.doGetOutputStream (SftpFileObject.java:636)
      at org.apache.commons.vfs2.provider.AbstractFileObject.getOutputStream (AbstractFileObject.java:1399)
      at org.apache.commons.vfs2.provider.DefaultFileContent.getOutputStream (DefaultFileContent.java:479)
      at org.apache.commons.vfs2.provider.DefaultFileContent.getOutputStream (DefaultFileContent.java:457)
      
      

      the patch code : https://github.com/apache/commons-vfs/pull/36

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              qxo qxo
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h