Knowledgebase: Common issues with TWebUpdate and TWebCopy SFTP connection

If you are trying to connect to your SFTP server with TWebUpdate or TWebCopy then first read requirements. Further below you can also find some steps that can get you moving forward if you experience exceptions when you start your application or try to connect.

DLL requirements

This is always the first step, make sure you have all the necessary DLLs for your application to load. The following DLLs are required:

  • libssh2.dll
  • libeay32.dll
  • ssleay32.dll

For 64-bit applications use libssh2_x64.dll, libeay32_x64.dll and ssleay32_x64.dll but don't forget to remove the _x64 suffix. You can find all these DLLs in your installation folder.

I get the following message: "Update failed with external exception C06D007E"

If your application can load the required DLLs listed but you see the message above, it's possible you are missing one more DLL that should be available on your system by default: MSVCR110.dll.
You can obtain this by installing the 32-bit version of Visual C++ Redistributable for Visual Studio 2012 Update 4: https://www.microsoft.com/en-us/download/details.aspx?id=30679

I still get exceptions when I try to connect with SFTP

The exception will most likely be realted to DLLs. Try the following to understand why libssh2.dll cannot be loaded:

  • In the libssh2_sftp unit search for the line you see below and temporarily comment out the delayed keyword to disable the delayed loading of the libssh2.dll:
    function libssh2_sftp_init; external libssh2_name{$ifdef allow_delayed} delayed{$endif};
    
  • Start your application. Without the delayed keyword the application will try to load the DLL on startup. In most cases this will give you another exception that points in the right direction. Try to look up what the code you get means.

For example:
When trying to load a 32-bit libssh2.dll for a 64-bit application, you get the following exception on connection:


And after removing the delayed keyword:
image
Looking up the code 0xc000007b you'll find answers mentioning a mix between 32-bit and 64-bit applications which immediately hints to incorrect DLL version usage.