Deployment via sftp

Deployment via sftp ignores root path setting and tries to get list of directories from root of server and gets Permission denied

Version:

PhpStorm 2019.2.2
Build #PS-192.6603.42, built on September 12, 2019
Runtime version: 11.0.3+12-b304.56 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 1969M
Cores: 8
Registry: run.processes.with.pty=TRUE
Non-Bundled Plugins: com.alayouni.ansiHighlight, com.intellij.ideolog, net.seesharpsoft.intellij.plugins.csv

Logs:
2019-09-21 00:02:03,793 [ 689582] DEBUG - t.connections.RemoteConnection - Opening connection to sftp://******:22/ in @73f6c3a9
2019-09-21 00:02:03,802 [ 689591] INFO - .channel.direct.SessionChannel - Will request `sftp` subsystem
2019-09-21 00:02:03,858 [ 689647] INFO - .channel.direct.SessionChannel - Will request `sftp` subsystem
2019-09-21 00:02:03,888 [ 689677] WARN - t.connections.RemoteConnection - Retrying connecting to sftp://******:22/ in @73f6c3a9: 1 iterations
org.apache.commons.vfs2.FileSystemException: Could not list the contents of folder "sftp://******/".
at org.apache.commons.vfs2.provider.AbstractFileObject.getChildren(AbstractFileObject.java:1101)
at org.apache.commons.vfs2.provider.AbstractFileObject.getChild(AbstractFileObject.java:1044)
at com.jetbrains.plugins.webDeployment.connections.RemoteConnectionPool.lambda$createConnection$0(RemoteConnectionPool.java:260)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:294)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: com.intellij.ssh.SftpChannelPermissionDeniedException: Failed to list files in path /
at com.intellij.ssh.impl.SftpKt.throwRefinedSftpChannelException(sftp.kt:49)
at com.intellij.ssh.impl.sshj.SshjRemoteFileObject.list(SshjRemoteFileObject.kt:43)
at com.intellij.ssh.impl.channels.FailSafeRemoteFileObject.list(FailSafeRemoteFileObject.kt:74)
at com.jetbrains.plugins.webDeployment.connections.platform.PlatformSftpFileObject.doListChildrenResolved(PlatformSftpFileObject.java:179)
at org.apache.commons.vfs2.provider.AbstractFileObject.getChildren(AbstractFileObject.java:1091)
... 8 more
Caused by: net.schmizz.sshj.sftp.SFTPException: Permission denied
at net.schmizz.sshj.sftp.Response.error(Response.java:140)
at net.schmizz.sshj.sftp.Response.ensurePacketTypeIs(Response.java:117)
at net.schmizz.sshj.sftp.SFTPEngine.openDir(SFTPEngine.java:161)
at net.schmizz.sshj.sftp.SFTPClient.ls(SFTPClient.java:57)
at net.schmizz.sshj.sftp.SFTPClient.ls(SFTPClient.java:52)
at com.intellij.ssh.impl.sshj.SshjRemoteFileObject.list(SshjRemoteFileObject.kt:44)
... 11 more
2019-09-21 00:02:03,889 [ 689678] WARN - loyment.ui.WebServerConfigForm - Could not list the contents of folder "sftp://******/".
org.apache.commons.vfs2.FileSystemException: Could not list the contents of folder "sftp://******/".
at org.apache.commons.vfs2.provider.AbstractFileObject.getChildren(AbstractFileObject.java:1101)
at org.apache.commons.vfs2.provider.AbstractFileObject.getChild(AbstractFileObject.java:1044)
at com.jetbrains.plugins.webDeployment.connections.RemoteConnectionPool.lambda$createConnection$0(RemoteConnectionPool.java:260)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:294)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: com.intellij.ssh.SftpChannelPermissionDeniedException: Failed to list files in path /
at com.intellij.ssh.impl.SftpKt.throwRefinedSftpChannelException(sftp.kt:49)
at com.intellij.ssh.impl.sshj.SshjRemoteFileObject.list(SshjRemoteFileObject.kt:43)
at com.intellij.ssh.impl.channels.FailSafeRemoteFileObject.list(FailSafeRemoteFileObject.kt:74)
at com.jetbrains.plugins.webDeployment.connections.platform.PlatformSftpFileObject.doListChildrenResolved(PlatformSftpFileObject.java:179)
at org.apache.commons.vfs2.provider.AbstractFileObject.getChildren(AbstractFileObject.java:1091)
... 8 more
Caused by: net.schmizz.sshj.sftp.SFTPException: Permission denied
at net.schmizz.sshj.sftp.Response.error(Response.java:140)
at net.schmizz.sshj.sftp.Response.ensurePacketTypeIs(Response.java:117)
at net.schmizz.sshj.sftp.SFTPEngine.openDir(SFTPEngine.java:161)
at net.schmizz.sshj.sftp.SFTPClient.ls(SFTPClient.java:57)
at net.schmizz.sshj.sftp.SFTPClient.ls(SFTPClient.java:52)
at com.intellij.ssh.impl.sshj.SshjRemoteFileObject.list(SshjRemoteFileObject.kt:44)
... 11 more

Settings:

2 comments
Comment actions Permalink

In fact, it looks pretty similar to this ticket:

https://youtrack.jetbrains.com/issue/WI-47754

However, it should be fixed already in PhpStorm 2019.2.2

Could you please the workaround from this ticket summary?

Please take note that this is _not_ the solution and the idea is to try it just for a test. 

0
Comment actions Permalink

I can confirm - after disabling:

ide.ssh.library.backend.use.sshj=false
ide.ssh.library.backend.webDeployment.use.sshj=false

everything works fine

0

Please sign in to leave a comment.