25

Hey I am having an issue connecting with FTP in PHPstorm. I know I have the correct parameters because it works in other FTP clients.

The error I get is: Could not list contents of the folder "ftp://real-meal.com/"

The port is set to 21, as it should be. and I know I have the correct username / password. Any ideas what the issue could be?

Here is the Log File:

    2013-08-22 14:31:40,053 [8689769]   INFO - api.vfs.impl.local.FileWatcher - Change requests:38912, filtered:15503 
2013-08-22 14:35:55,090 [8944806]   INFO - api.vfs.impl.local.FileWatcher - Change requests:39936, filtered:15933 
2013-08-22 14:36:12,356 [8962072]   WARN - i.remotebrowser.ServerTreeNode - Could not list the contents of folder "ftp://real-meal.com/". 
org.apache.commons.vfs2.FileSystemException: Could not list the contents of folder "ftp://real-meal.com/".
    at org.apache.commons.vfs2.provider.AbstractFileObject.getChildren(AbstractFileObject.java:926)
    at org.apache.commons.vfs2.provider.ftp.FtpFileObject.getChildren(FtpFileObject.java:443)
    at org.apache.commons.vfs2.provider.AbstractFileObject.getChild(AbstractFileObject.java:1006)
    at com.jetbrains.plugins.webDeployment.connections.RemoteConnectionPool.createConnection(RemoteConnectionPool.java:124)
    at com.jetbrains.plugins.webDeployment.connections.RemoteConnectionManager.openConnection(RemoteConnectionManager.java:122)
    at com.jetbrains.plugins.webDeployment.ui.remotebrowser.ServerTreeContext.getConnection(ServerTreeContext.java:83)
    at com.jetbrains.plugins.webDeployment.ui.remotebrowser.ServerTreeNode.computeFile(ServerTreeNode.java:266)
    at com.jetbrains.plugins.webDeployment.ui.remotebrowser.ServerTreeNode.getChildren(ServerTreeNode.java:132)
    at com.intellij.ui.treeStructure.SimpleTreeStructure.getChildElements(SimpleTreeStructure.java:25)
    at com.intellij.ide.util.treeView.AbstractTreeUi$31.run(AbstractTreeUi.java:1618)
    at com.intellij.ide.util.treeView.AbstractTreeUi.execute(AbstractTreeUi.java:1824)
    at com.intellij.ide.util.treeView.AbstractTreeUi.getChildrenFor(AbstractTreeUi.java:1615)
    at com.intellij.ide.util.treeView.AbstractTreeUi.access$4600(AbstractTreeUi.java:60)
    at com.intellij.ide.util.treeView.AbstractTreeUi$46.run(AbstractTreeUi.java:2702)
    at com.intellij.ide.util.treeView.AbstractTreeUi.execute(AbstractTreeUi.java:1824)
    at com.intellij.ide.util.treeView.AbstractTreeUi.access$2400(AbstractTreeUi.java:60)
    at com.intellij.ide.util.treeView.AbstractTreeUi$57$1.run(AbstractTreeUi.java:3379)
    at com.jetbrains.plugins.webDeployment.ui.remotebrowser.WebServerTreeBuilder.runBackgroundLoading(WebServerTreeBuilder.java:90)
    at com.intellij.ide.util.treeView.AbstractTreeUi$57.run(AbstractTreeUi.java:3370)
    at com.intellij.ide.util.treeView.AbstractTreeUi.execute(AbstractTreeUi.java:1824)
    at com.intellij.ide.util.treeView.AbstractTreeUi.access$2400(AbstractTreeUi.java:60)
    at com.intellij.ide.util.treeView.AbstractTreeUi$58.run(AbstractTreeUi.java:3435)
    at com.intellij.util.concurrency.WorkerThread.run(WorkerThread.java:108)
    at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:434)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
        at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:151)
    Caused by: java.net.SocketTimeoutException: Read timed out
        at java.net.SocketInputStream.$$YJP$$socketRead0(Native Method)
        at java.net.SocketInputStream.socketRead0(SocketInputStream.java)
        at java.net.SocketInputStream.read(SocketInputStream.java:150)
        at java.net.Socke

tInputStream.read(SocketInputStream.java:121)
    at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)
    at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
    at java.io.InputStreamReader.read(InputStreamReader.java:184)
    at java.io.BufferedReader.fill(BufferedReader.java:154)
    at java.io.BufferedReader.read(BufferedReader.java:175)
    at org.apache.commons.net.io.CRLFLineReader.readLine(CRLFLineReader.java:58)
    at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:310)
    at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:290)
    at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:479)
    at org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:718)
    at org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:657)
    at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:3097)
    at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:3072)
    at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2731)
    at org.apache.commons.vfs2.provider.ftp.FTPClientWrapper.listFilesInDirectory(FTPClientWrapper.java:162)
    at org.apache.commons.vfs2.provider.ftp.FTPClientWrapper.listFiles(FTPClientWrapper.java:149)
    at org.apache.commons.vfs2.provider.ftp.FtpFileObject.doGetChildren(FtpFileObject.java:141)
    at org.apache.commons.vfs2.provider.ftp.FtpFileObject.doListChildren(FtpFileObject.java:459)
    at org.apache.commons.vfs2.provider.AbstractFileObject.getChildren(AbstractFileObject.java:917)
    ... 30 more
Charles
  • 50,943
  • 13
  • 104
  • 142
newms87
  • 834
  • 1
  • 10
  • 23
  • Please can you check the solutions listed [here](http://intellij-support.jetbrains.com/entries/23403071?challenge=3qe0p5zedki8ogd) - does any of them help? – lena Aug 23 '13 at 13:01
  • Check "Don't check http connection" solved problem for me – Daria Jan 19 '16 at 11:26

6 Answers6

140

I was just having this same issue in PHPstorm. To fix it I had to simply click Advanced and select Passive Mode. Once I did that it connected right up for me.

starball
  • 20,030
  • 7
  • 43
  • 238
Todd Welch
  • 1,776
  • 2
  • 17
  • 23
  • 2
    in my case I had to check the checkbox "always use list command" too, the last option on Passive Mode screen. – Vipin Kr. Singh Feb 15 '16 at 10:01
  • 1
    OMG Thanks!! WTF DOES PASSIVE MODE DO?? Lol Thanks I was about to kill somebody xD – Radmation Apr 14 '16 at 03:07
  • 1
    You're a bloody legend!! driving me nuts – doz87 Aug 01 '16 at 12:53
  • 2
    It still won't work for servers where TLS session resumption is required. I'm using PhpStorm 2016.2.1 on a Mac and even after enabling Passive Mode and 'Always use LIST command', I still wasn't able to connect. The FTP connection was successful, but then because this feature isn't supported, the file server quit before the connection was successful. Here is issue on JetBrains where you can vote - https://youtrack.jetbrains.com/issue/WI-29129 – Prathamesh Datar Aug 31 '16 at 12:06
  • @todd-welch I have this problem for a SFTP connection and I see "Passive mode" is available only for FTP connections. I'd really appreciate any help, I can't find a solution right now. – Madalina Taina Sep 10 '16 at 05:00
  • I went to a different version of phpstrom and before I didn't have to do this - but now i have to now make sure this box is checked. Also I think passive mode lets the server select the port if I am not mistaken. – Radmation May 10 '17 at 23:13
11

MauricioOtta: Go to File -> Settings... -> Deployment. Select the FTP connection and click the Advanced options... button. Tick Passive mode then apply and save your settings. Have suffered from this issue more times than I care to remember so I'm very happy with the solution from Todd. Still getting some failed downloads but not as many!

Community
  • 1
  • 1
annoyingmouse
  • 5,524
  • 1
  • 27
  • 45
4

I had the same problem. follow the path : enter image description here

abadooz
  • 203
  • 2
  • 6
0

For me, I also had to remove the "ftp." from the name of the ftp host - was otherwise getting a 'Host not found' message. Top tip, you probably need to put a "/" in for your Deployment path on the Mappings tab (or whatever is appropriate for your own setup) to really be hooked in and good to go.

Geoff Kendall
  • 1,307
  • 12
  • 13
0

All I did was to add "ftp." before the name of the host and it worked!

So instead of host being: domain.com I changed it to ftp.domain.com and made sure passive mode was also checked.

kelrob-dev
  • 91
  • 1
  • 9
0

My way of solving it was to make sure that the password I'm copy-pasting from an Excel file into PHPStorm settings does not contain a trailing space.

ilya.chepurnoy
  • 332
  • 4
  • 9