UnlockComponent LastErrorText shows exact string passed to it.

If the string argument passed to UnlockComponent or UnlockBundle is NOT a purchased unlock code, then the LastErrorText will contain the exact string passed to it by your application.  In this case, the string “Hello World” was passed to UnlockBundle.

If UnlockComponent returns 0/false, check carefully the exact string being passed to it.  Make sure the exact purchased unlock code is passed to it.  (For example, double-check numeric zero’s vs. upper case letter O’s, or lowercase L’s vs. numeric 1’s.  It’s best to copy-and-paste the unlock code received from Chilkat rather than copying visually by typing.)

ChilkatLog:
  UnlockBundle:
    DllDate: Aug  8 2016
    ChilkatVersion: 9.5.0.59
    UnlockPrefix: NONE
    Architecture: Little Endian; 32-bit
    Language: Visual C++ 11.0 (32-bit)
    VerboseLogging: 0
    component: Global
    unlockCode: Hello World
    regKeyUnlock:
      product: ChilkatBundle
      hcCurDate: Mon, 08 Aug 2016 09:44:37 -0500
      hcExpire: 9/2015
      Trial has expired.
    --regKeyUnlock
    Failed.
  --UnlockBundle
--ChilkatLog

 

 

426 Connection closed; transfer aborted.

Problem:
An FTP transfer fails with the following message found in LastErrorText:

426 Connection closed; transfer aborted

Solution:
A local firewall may be blocking the connection. Try switching between Active and Passive mode and try again.

See these examples:

ASP: Active and Passive Modes in FTP
SQL Server: Active and Passive Modes in FTP
C#: Active and Passive Modes in FTP
C++: Active and Passive Modes in FTP
MFC: Active and Passive Modes in FTP
C: Active and Passive Modes in FTP
Delphi: Active and Passive Modes in FTP
Visual FoxPro: Active and Passive Modes in FTP
Java: Active and Passive Modes in FTP
Perl: Active and Passive Modes in FTP
PHP: Active and Passive Modes in FTP
Python: Active and Passive Modes in FTP
Ruby: Active and Passive Modes in FTP
VB.NET: Active and Passive Modes in FTP
Visual Basic: Active and Passive Modes in FTP
VBScript: Active and Passive Modes in FTP

Could not load file or assembly ‘ChilkatDotNet4.dll’ or one of its dependencies.

(Thank you Josh for your helpful information!)

“I see that occasionally information from clients (with the client’s permission) end up on the blog and thought that perhaps this one would qualify. If there is mention of the C++ Runtime, I didn’t find it.

At any rate, I was having trouble getting the ChilkatDotNet4.dll to load. After a conversation with Matt, I tried installing the Microsoft Visual C++ 2010 Redistributable Package – this resolved my issue:

x86 Microsoft Visual C++ 2010 Redistributable Package
x64 Microsoft Visual C++ 2010 Redistributable Package

I’ve included the error messages below to illustrate that the .dll appears to be being found when registered to the GAC (and certainly when placed directly in the web site’s bin), but cannot load its dependencies.

When loaded into GAC but not found (or when in bin):

Could not load file or assembly ‘ChilkatDotNet4.dll’ or one of its dependencies. The specified module could not be found.

When not loaded into GAC and not in bin:

Could not load file or assembly ‘ChilkatDotNet4, Version=9.0.8.0, Culture=neutral, PublicKeyToken=eb5fc1fc52ef09bd’ or one of its dependencies. The system cannot find the file specified.”

IMAP “Not in the authenticated state” Error

The blog post explains the “Not in the authenticated state” error.

ChilkatLog:
SelectMailbox:
DllDate: Feb 15 2010
UnlockPrefix: Anything for 30-day trial
Username: NETWORK SERVICE
Component: .NET 2.0
mailbox: Inbox
Not in the authenticated state

This error happens if the caller is either not connected to an IMAP server, or is connected but the Login method was never called or did not complete successfully. It can happen for one of the following reasons:

  1. A previous IMAP method call failed because of a lost connection; perhaps the application did not check the return status for success failure. (It is important to check the return status of all method calls involving Internet communications.)
  2. The Connect and/or Login methods were never called.
  3. The return values of the Connect and/or Login methods were not checked for success/failure and a failure was not noticed.

SSH / SFTP – Too much time between connect and authentication

The Solution:

Issue solved.   The problem was, that we stepped through the code and because of that too much time elapsed between connect and authentication.  As we ran the program without breakpoints it worked.

The Problem:

The AuthenticatePw method failed and the LastErrorText contained this information:

ChilkatLog:
   AuthenticatePw:
     DllDate: Jan 31 2010
     UnlockPrefix: ***
     Username: ***
     Component: .NET 2.0
     SshVersion: SSH-2.0-XFB.Gateway Windows
     SftpVersion: 0
     login: ***
     sendMessage:
       msgName: SERVICE_REQUEST
       unpaddedLength: 22
       remainder: 6
       paddingLen: 10
       totalSize: 32
     SentServiceReq: ssh-userauth
     numBytesRequested: 16
     Connection closed by server.
     Failed to read data on SSH connection.
     Failed to read packet from SSH server.
     Error reading service accept.
     Socket connection lost.
     Failed.

SFTP File not Found

Question:

I’m trying to open a file on the SFTP server, but I get a “File not Found” error?
Here is the LastErrorText:

ChilkatLog:
 OpenFile:
   DllDate: Dec  2 2009
   UnlockPrefix: Anything for 30-day trial
   Username: IUSR_ABC***
   Component: ActiveX
   SshVersion: SSH-2.0-1.36 sshlib: GlobalScape
   SftpVersion: 3
   hcCurDate: Tue, 08 Dec 2009 13:48:25 +0000
   hcExpire: 1/2010
   filename: test.txt
   access: writeOnly
   createDisposition: createTruncate
   v3Flags: 0x1a
   Sent FXP_OPEN
   StatusResponse:
     Request: FXP_OPEN
     StatusCode: 2
     StatusMessage: File not found
   SshLog: SFTP> Sending SSH_FXP_OPEN
TRAN> CHANNEL_DATA
TRAN* NumBytes: 45
TRAN< CHANNEL_DATA
SFTP< Received SSH_FXP_STATUS

   Failed.


Answer:

You passed “test.txt” to OpenFile, which means you’re trying to open that file in the HOME directory of the SSH/SFTP user account. To solve the problem, you should either pass the full absolute filepath of the file you wish to open, or a relative filepath from the HOME directory of the SSH user account.

SFTP Permission Denied trying to open existing file.


Question:

Why did I get a permission denied error from the server when trying to open an existing file on the SSH/SFTP server? Here’s the LastErrorText:

ChilkatLog:
   DownloadFileByName:
     DllDate: Dec  2 2009
     UnlockPrefix: ***
     Username: Administrator
     Component: ActiveX
     SshVersion: SSH-2.0-CoreFTP-0.1.2
     SftpVersion: 3
     PreserveDate: 0
     fromFilePath: /test.dat.gz
     toFilePath: c:\abc\test.dat.gz
     OpenRemoteFile:
       filename: /test.dat.gz
       access: readOnly
       createDisposition: openExisting
       v3Flags: 0x1
       Sent FXP_OPEN
       StatusResponse:
         Request: FXP_OPEN
         StatusCode: 3
         StatusMessage: Permission denied
       SshLog: 
 SFTP> Sending SSH_FXP_OPEN
 TRAN> CHANNEL_DATA
 TRAN* NumBytes: 59
 TRAN< CHANNEL_DATA
 SFTP< Received SSH_FXP_STATUS

       timeToOpenMs: Elapsed time: 31 millisec
     totalTimeMs: Elapsed time: 31 millisec
     Failed.

Answer:

You are trying to download “/test.dat.gz” from the SSH/SFTP server. Some servers interpret the leading “/” as the root directory of the SSH user account. However, some servers interpret it as the root directory of the default drive (i.e. default filesystem). Your SSH/SFTP server is doing the latter. Your SSH/SFTP user account apparently does not have permission to read the root directory of the default filesystem, and therefore you get a “permission denied”. The solution is to download “./test.dat.gz” to clearly indicate that test.dat.gz is located in the HOME directory of the SSH/SFTP user account.

VB6 – “TYPE MISMATCH (ERROR CODE 13)” or “Invalid Use of New Keyword”

This error occurs if you incorrectly add the ActiveX component to your VB6 project.  Follow these rules:

1) If the ActiveX objects are dynamically created (they are not dragged and dropped onto a form from the palette), then add a Reference to the ActiveX.  You should NOT see the icons for the ActiveX in the palette.  Instances of the ActiveX objects are created by New statements in your code.

2) If the Chilkat ActiveX objects are dragged and dropped onto your form, then add the component via the “Project–>Components” menu, NOT the “Project–>References” menu.  In my opinion, it is always better to create instances of the objects dynamically because the Chilkat objects are not visual controls and won’t be visible on your form anyway at runtime.

3) Never do both — you should either add a Reference (Project–>References) or add the component to the palette (Project–>Components) but NEVER BOTH.

InitializeSftp – Received FAILURE response to subsystem request.

If the SSH server is setup/configured to not allow SFTP, or your SSH user account is not allowed to use SFTP, the InitializeSftp method will return a failed status. Here is an example:

ChilkatLog:
   InitializeSftp:
     DllDate: Oct 30 2009
     UnlockPrefix: ABC123
     Username: chilkat
     Component: .NET 2.0
     SshVersion: SSH-2.0-OpenSSH_4.5
     SftpVersion: 0
     channelType: session
     clientChannel: 200
     initialWindowSize: 327680
     maxPacketSize: 32768
     Sent open channel request
     ClientChannelNum: 200
     ServerChannelNum: 0
     ServerInitialWindowSize: 0
     ServerMaxPacketSize: 32768
     Session channel successfully opened.
     ChannelNum: 200
     ServerChannelNum: 0
     Sent subsystem request
     Received FAILURE response to subsystem request.
     SSH read failed...
     Failed.