Archived Forum Post

Index of archived forum posts


SSH/SFTP Server Sends EOF during InitializeSftp Method Call

Aug 26 '12 at 11:40

Sometimes, the InitializeSftp() call returns false with a LastErrorText similar to the following:

    DllDate: Jan 19 2012
    UnlockPrefix: *
    Architecture: Little Endian; 32-bit
    Language: .NET 4.0
    SshVersion: ***
    SftpVersion: 0
    channelType: session
    clientChannel: 0
    initialWindowSize: 327680
    maxPacketSize: 32768
    Sent open channel request
    ClientChannelNum: 0
    ServerChannelNum: 0
    ServerInitialWindowSize: 0
    ServerMaxPacketSize: 32768
    Session channel successfully opened.
    ChannelNum: 0
    ServerChannelNum: 0
    Sent subsystem request
    Received SUCCESS response to subsystem request.
    Sent FXP_INIT
    Received EOF
    Failed to receive FXP_VERSION


It has been found that this problem can happen when too many SFTP connections/sessions are open to the SFTP server.

If using a programming language that involves garbage collection, make sure the SFTP connection is explicitly closed by calling the Disconnect method when the app is finished with the connection. If the connection is not explicitly closed, it will remain open until the garbage collector destructs the abandoned object instances.