Personal FTP repository fails to access: Curl error: Couldn't connect to server

Created:

2016-11-16 13:07:28 UTC

Modified:

2017-07-02 22:54:24 UTC

1

Was this article helpful?


Have more questions?

Submit a request

Personal FTP repository fails to access: Curl error: Couldn't connect to server

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk Onyx for Linux
  • Plesk 12.0 for Windows
  • Plesk 12.5 for Windows

Symptoms

Upon attempt to open personal FTP repository the following error is thrown:

Error: FTP connection failed, please check your FTP settings.
Repository error: Transport error: unable to list directory: Curl error: Couldn't connect to server

OR

Curl error: Couldn't connect to server [..\\..\\..\\..\\..\\common\\plesk-utils\\PMM\\repository-transport\\ftp.cpp:559]
Transport error: unable to list directory: Curl error: Couldn't connect to server [..\\..\\..\\..\\..\\common\\plesk-utils\\PMM\\repository-transport\ ransport.cpp:880]

Cause

FTP server is not accessible due to its misconfiguration or firewall restrictions.

Resolution

  1. Ensure that correct FTP server hostname or IP address were specified

  2. Try to establish connection locally:

    C:\\> telnet ftp.example.com 21
    Connecting To 203.0.113.2...Could not open connection to the host, on port 21: Connect failed

    OR

    C:\\> ftp ftp.example.com
    ftp> dir
    Not connected.
  3. Check firewall settings on the FTP server and source server as well. The following default rules must be set to allow connection and be enabled:

    Inbound rules:- FTP Server (FTP Traffic-In)- FTP Server Passive (FTP Passive Traffic-In)- FTP Server Secure (FTP SSL Traffic-In)

    Outbound rules:- FTP Server (FTP Traffic-Out)- FTP Server Secure (FTP SSL Traffic-Out)

    For example:

    PS C:\\> netsh advfirewall firewall show rule name=all | Select-String 'FTP' -Context 1,12

    > Rule Name: FTP Server
    ---------------------------------------------------------------
    Enabled: Yes
    Direction: In
    Profiles: Domain,Private,Public
    Grouping: Plesk
    LocalIP: Any
    RemoteIP: Any
    Protocol: TCP
    LocalPort: 21
    RemotePort: Any
    Edge traversal: No
    Action: Allow

    > Rule Name: FTP Server Passive (FTP Passive Traffic-In)
    ---------------------------------------------------------------
    Enabled: Yes
    Direction: In
    Profiles: Domain,Private,Public
    > Grouping: FTP Server
    LocalIP: Any
    RemoteIP: Any
    Protocol: TCP
    LocalPort: 1024-65535
    RemotePort: Any
    Edge traversal: No
    Action: Allow

    > Rule Name: FTP Server Secure (FTP SSL Traffic-Out)
    ---------------------------------------------------------------
    Enabled: Yes
    Direction: Out
    Profiles: Domain,Private,Public
    > Grouping: FTP Server
    LocalIP: Any
    RemoteIP: Any
    Protocol: TCP
    LocalPort: 989
    RemotePort: Any
    Edge traversal: No
    Action: Allow

    > Rule Name: FTP Server Secure (FTP SSL Traffic-In)
    ---------------------------------------------------------------
    Enabled: Yes
    Direction: In
    Profiles: Domain,Private,Public
    > Grouping: FTP Server
    LocalIP: Any
    RemoteIP: Any
    Protocol: TCP
    LocalPort: 990
    RemotePort: Any
    Edge traversal: No
    Action: Allow

    > Rule Name: FTP Server (FTP Traffic-Out)
    ---------------------------------------------------------------
    Enabled: Yes
    Direction: Out
    Profiles: Domain,Private,Public
    > Grouping: FTP Server
    LocalIP: Any
    RemoteIP: Any
    Protocol: TCP
    LocalPort: 20
    RemotePort: Any
    Edge traversal: No
    Action: Allow

    > Rule Name: FTP Server (FTP Traffic-In)
    ---------------------------------------------------------------
    Enabled: Yes
    Direction: In
    Profiles: Domain,Private,Public
    > Grouping: FTP Server
    LocalIP: Any
    RemoteIP: Any
    Protocol: TCP
    LocalPort: 21
    RemotePort: Any
    Edge traversal: No
    Action: Allow

    Rule Name: World Wide Web Services (HTTPS Traffic-In)
    ---------------------------------------------------------------
    Enabled: Yes
    Direction: In
  4. On the FTP server check that port 21 is listened by FTP service, for example svchost.exe (ftpsvc)

    • by means of ' Server Manager > Tools > Resource Monitor > Network > Listening Ports '
    • by means of 'netstat' utility:
      PS C:\\> netstat -a -b -o | findstr ':21 Proto'
      Proto Local Address Foreign Address State PID
      TCP 0.0.0.0:21 :0 LISTENING 1252
      TCP [::]:21 WIN-KVET51JS51V:0 LISTENING 1252
Have more questions? Submit a request
Please sign in to leave a comment.