Android Socket Permission Denied Error

If the LastErrorText contains a line such as this:

socketError: Permission denied

It means you need to add permissions for Internet communications in your manifest. It should be placed outside of the application tag, such as:

<manifest>
    <application>
     .
     .
     .
    </application>
    <uses-permission android:name="android.permission.INTERNET" />
</manifest>

IOS Error: Broken pipe … Failed to send ClientHello

The following error can be caused by a firewall blocking the iPAD/iPhone wifi connection:

...
      connect successful (1)
      clientHelloMajorMinorVersion: 3.1
      buildClientHello:
        majorVersion: 3
        minorVersion: 1
        numRandomBytes: 32
        sessionIdSize: 0
        numCipherSuites: 10
        numCompressionMethods: 1
      socketErrno: 32
      socketError: Broken pipe
      Error sending on socket
      send_size: 58
      Failed to send TLS message.
      Failed to send ClientHello
      Client handshake failed.
    Failed to connect to POP3 server.
    Failed to ensure transaction state.
...

SSH/SFTP RemoveFile: “Permission Denied”

If the SFTP server responds to a request to delete a file with the error “Permission Denied”, it means the SSH/SFTP user account does not have permission to delete the file. Here is a sample LastErrorText that shows the path of the remote file to be deleted, and the “Permission Denied” response from the server.

ChilkatLog:
  RemoveFile:
    DllDate: Jan 19 2012
    UnlockPrefix: abcxyz
    Username: abcxyz
    Architecture: Little Endian; 64-bit
    Language: .NET 2.0 / x64
    SshVersion: SSH-2.0-CoreFTP-0.2.3
    SftpVersion: 3
    filename: /something1/something2/something.dat
    StatusResponse:
      Request: FXP_REMOVE
      StatusCode: 3
      StatusMessage: Permission denied
    Failed.

The LastErrorText shows the exact path of the file passed to the server.  In the case above, it is an absolute path.  If a relative path was passed, it would be relative to the HOME directory of the SSH/SFTP user account.  The “Permission denied” response from the server indicates that the FXP_REMOVE message was properly formatted and correctly sent to the server.  It was received correctly by the server, but the SSH/SFTP user account does not have permission to delete the requested file.  The fix to this problem is not on the client-side (unless a mistake in the file path was made).  The fix is on the server-side to give the SSH/SFTP user account permission to delete the requested file.

SFTP Open: The meaning of “No Such File”

When an SSH/SFTP server responds to a file open request with the error message “No Such File”, it means that it could not find the file (i.e. there was no such file).

This is a snippet from the LastErrorText property:

...
    OpenRemoteFile:
      filename: something.dat
      access: readOnly
      createDisposition: openExisting
      v3Flags: 0x1
      Sent FXP_OPEN
      StatusResponse:
        Request: FXP_OPEN
        StatusCode: 2
        StatusMessage: No such file
...

If a relative path is used, then the path is relative to the HOME directory of the SSH/SFTP user account.  In the case above, only a filename is provided, and therefore the SSH/SFTP server is expecting to find “something.dat” in the HOME directory of the SSH/SFTP user account.  If the file is not there, the response will be “No Such File”.

If an absolute path is used (i.e. a path starting with “/”), then it is a request to open that exact absolute path (relative to the filesystem’s root “/” directory).  It is likely that if the path is not under the SSH/SFTP user’s home directory, the server will not have permission to access the file and the error returned will be “No Permission” (or something pertaining to not having permission to access a file or directory..)

SOLVED: 425 Unable to build data connection: Operation not permitted

This error message is specific to the ProFTPd server.  A Chilkat customer found this error within the LastErrorText after trying to upload or download a file, or retrieve a directory listing:

425 Unable to build data connection: Operation not permitted

The latest ProFTPd server has a configuration setting that by default requires SSL/TLS sessions to be re-used, and this breaks *many* FTP clients, including Chilkat. The fix to be made on the server is to add the following line to the proftpd.conf and then restart it.

TLSOptions NoSessionReuseRequired

SFTP Permission Denied w/ OpenFile Method

Question:

We are trying to upload a file to SFTP using private key. We are able to connect and retrieve folder listing. But when we try to upload to one of the folder on the SFTP we get the “Permission denied” error message.

The message is as below.

ChilkatLog:
  OpenFile:
    DllDate: Feb 15 2010
    UnlockPrefix: ****
    Username: joe
    Component: .NET 2.0
    SshVersion: SSH-1.99-OpenSSH_3.8p1
    SftpVersion: 3
    filename: .\Upload\myFiles\test.xml
    access: writeOnly
    createDisposition: createNew
    v3Flags: 0x2a
    Sent FXP_OPEN
    StatusResponse:
      Request: FXP_OPEN
      StatusCode: 3
      StatusMessage: Permission denied
    SshLog:
SFTP> Sending SSH_FXP_OPEN
TRAN> CHANNEL_DATA
TRAN* NumBytes: 44
TRAN< CHANNEL_DATA
SFTP< Received SSH_FXP_STATUS

Answer:

The content of the LastErrorText property (as shown above) provides good information that allows me to suggest some things to try:

  1. I can see by the “DllDate” that the version being used is older.  I would highly recommend updating to the latest version to ensure you’re getting the best information in LastErrorText.  The information in LastErrorText is always being refined and improvedd as Chilkat does user-support day-to-day.
  2. The createDisposition passed to OpenFile in this case is “createNew”.  If the file already exists, then the OpenFile will fail.  It’s possible that the server will indicate the failure as a “Permission denied” error.  Instead, use “createTruncate” for the createDisposition argument.
  3. I see that backslashes are used in the remote file path.  Try using forward slashes instead.
  4. To fully understand the absolute file path of the destination file on the SSH/SFTP server, call RealPath to ask the server to convert a relative path to an absolute path.  Maybe the SSH/SFTP user account’s home directory is something different than expected.

VB6 Error — “TYPE MISMATCH (ERROR CODE 13)” w/ IMAP Search method

This happens if the Chilkat ActiveX objects are dragged and dropped onto your formvia the “Project–>Components” menu. Instead, add a reference to the objects via the “Project–>References” menu.

Instances of the object should be created dynamically. For example:

Dim imap as ChilkatImap
Set imap = New ChilkatImap

WSAECONNREFUSED No connection could be made because the target machine actively refused it.

One possible cause of this socket connect error is when an Anti-Virus program blocks the connection. This can happen if the AV program is blocking the outbound port. If some programs can connect to a given remote host:port, but your application cannot, then check your Anti-Virus program to see if exceptions were made for specific programs, but not for your application’s EXE.

VC++ Link problem: fatal error C1047, “Chilkat*.lib’ was created with an older compiler than other objects; rebuild old objects and libraries”

Regarding the following VC++ link problem:

“fatal error C1047: The object or library file 'c:\Chilkat\libs\x64\ChilkatRel_x64.lib' 
was created with an older compiler than other objects; rebuild old objects and libraries”

This can be resolved by building without the /LTCG flag turned on. Unfortunately, it is not possible to use the /LTCG flag if you are using the Chilkat libraries. Compiling and linking your C++ application without using the /LTCG flag should resolve the problem.

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