title: Setup WSO2 Enterprise Integrator VFS connection towards Windows SFTP server
body: <p>Running WSO2 Enterprise Integrator 6.5.0. on RHEL 7. We are in the proces of building flows to read files from an sftp server. But setting up the sftp connection towards a Windows SFTP server fails. We can access this Windows SFTP server correctly with Windows clients like FileZilla/WinSCP.</p>
  
  <p>With netstat we see a connection is build towards the Windows SFTP server but the flow isn't moving - no files are being read. On the point of stopping the server the error as shown below is printed in the wso2carbon.log.</p>
  
  <p>When setting up the connection towards a Linux sftp server ( Plain RHEL 7 box with SSHD ) we don't face any issues. We have the matching private key place under .ssh/id_rsa in the home dir of the user running WSO2 EI.</p>
  
  <p>Searching for the error message ( see snippet below ) we should get it resolved by adding the transport.vfs.AvoidPermissionCheck=true parameter to the VFS URL but unfortunately this doesn't solve our issue.</p>
  
  <p>This is the VFS URL we are using.</p>
  
  <p>sftp://SFTPUSER@SERVER.ACMECORP.ORG/inputdir?transport.vfs.AvoidPermissionCheck=true;vfs.passive=true</p>
  
  <p>Is this a configuration that should work and are we missing a configuration option? Or is this a bug in the WSO2 software?</p>
  
  <p>These URL's mention the issue we are facing. </p>
  
  <p><a href="https://stackoverflow.com/questions/48638827/vfs2-error-cannot-delete-file-and-could-not-get-the-groups-id-of-the-current-use">VFS2 Error cannot delete file and could not get the groups id of the current user (error code: -1)</a></p>
  
  <p><a href="https://issues.apache.org/jira/browse/VFS-617" rel="nofollow noreferrer">https://issues.apache.org/jira/browse/VFS-617</a></p>
  
  <p><a href="https://github.com/wso2/product-ei/issues/3725" rel="nofollow noreferrer">https://github.com/wso2/product-ei/issues/3725</a></p>
  
  <pre><code>[2019-12-06 13:48:59,724] [-1] [] [vfs-Worker-2] ERROR {org.apache.synapse.transport.vfs.VFSTransportListener} -  Error checking for existence and readability : sftp://SFTPUSER@SERVER.ACMECORP.ORG/inputdir?transport.vfs.AvoidPermissionCheck=true;vfs.passive=true
  org.apache.commons.vfs2.FileSystemException: Could not determine if file "sftp://SFTPUSER@SERVER.ACMECORP.ORG/inputdir?transport.vfs.AvoidPermissionCheck=true;vfs.passive=true" is readable.
          at org.apache.commons.vfs2.provider.AbstractFileObject.isReadable(AbstractFileObject.java:1494)
          at org.apache.synapse.transport.vfs.VFSTransportListener.scanFileOrDirectory(VFSTransportListener.java:295)
          at org.apache.synapse.transport.vfs.VFSTransportListener.poll(VFSTransportListener.java:188)
          at org.apache.synapse.transport.vfs.VFSTransportListener.poll(VFSTransportListener.java:134)
          at org.apache.axis2.transport.base.AbstractPollingTransportListener$1$1.run(AbstractPollingTransportListener.java:67)
          at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at java.lang.Thread.run(Thread.java:748)
  Caused by: com.jcraft.jsch.JSchException: Could not get the groups id of the current user (error code: -1)
          at org.apache.commons.vfs2.provider.sftp.SftpFileSystem.getGroupsIds(SftpFileSystem.java:219)
          at org.apache.commons.vfs2.provider.sftp.SftpFileObject.getPermissions(SftpFileObject.java:250)
          at org.apache.commons.vfs2.provider.sftp.SftpFileObject.doIsReadable(SftpFileObject.java:264)
          at org.apache.commons.vfs2.provider.AbstractFileObject.isReadable(AbstractFileObject.java:1492)
          ... 8 more
  </code></pre>
  
  <p>UPDATE</p>
  
  <p>Using the same URL but then setting up the WSO2 flow to write a file towards the SFTP server works.</p>