Archived Forum Post

Index of archived forum posts

Question:

SyncRemoteTree2 not completing successfully, but returning success

Jan 27 '16 at 16:13

we are running into an issue where SyncRemoteTree2 is returning success even when not all the files have been uploaded. Bigger issue is that sometimes it returns failure and sometimes it returns success.

The code is:

dim intSyncMethod
intSyncMethod = 2
success = objFTP.SyncRemoteTree2(strLocalFolder, intSyncMethod, 1, 0)

Last error:

              hostname: *
              port: 13528
              socket2Connect:
                connect2:
                  ConnectFailReason: Connection rejected
                --connect2
              --socket2Connect
            --dataConnectRetry
            setupPassiveDataSocket dataConnect failed.
            Failed to setup passive data socket for upload
            Failed to setup data connection for upload.
            readRepliesAfterFailedDataConn:
              readCommandResponse:
                recvUntilMatch: Socket operation timeout.
                Failed to read FTP control channel reply.
                readFtpReply: Socket operation timeout.
              --readCommandResponse
            --readRepliesAfterFailedDataConn
          --uploadFromDataSource
          Failed.
        --uploadFromLocalFile
      --putFile
      originalDir: /sei/Reports
      changeRemoteDir:
        simplePathCommand:
          simpleCommand:
            Not connected.
          --simpleCommand
          Simple path command failed.
        --simplePathCommand
      --changeRemoteDir
    --putTree2
    Failed.
  --SyncRemoteTree2

When this happens, I try again, but sometimes this happens.

     fetchDirListing:
        fetchDirListing2:
          dataConnectRetry:
            hostname: *
            port: 14244
            socket2Connect:
              connect2:
                ConnectFailReason: Connection rejected
              --connect2
            --socket2Connect
          --dataConnectRetry
          setupPassiveDataSocket dataConnect failed.
          Failed to setup passive data socket for upload
          Failed to setup data connection for dir listing.
          readRepliesAfterFailedDataConn:
            readCommandResponse:
              recvUntilMatch: Socket operation timeout.
              Failed to read FTP control channel reply.
              readFtpReply: Socket operation timeout.
            --readCommandResponse
          --readRepliesAfterFailedDataConn
        --fetchDirListing2
      --fetchDirListing
      originalDir: /sei/Reports
      changeRemoteDir:
        simplePathCommand:
          simpleCommand:
            Not connected.
          --simpleCommand
          Simple path command failed.
        --simplePathCommand
      --changeRemoteDir
    --putTree2
    Success.
  --SyncRemoteTree2
--ChilkatLog

Both appear to be similar error, but one returned success and the other returned failure. IF the DLL returns failure consistently, then we can deal with it and re-try, but it is the random success message (the return code from the function indeed is 1) that throws us off and our script successfully ends, but not all the files were uploaded.


Accepted Answer

I think this new build should solve the problem:

32-bit Download: http://www.chilkatsoft.com/download/preRelease/ChilkatAx-9.5.0-win32.zip

64-bit Download: http://www.chilkatsoft.com/download/preRelease/ChilkatAx-9.5.0-x64.zip

Please let me know if not. It was a one-line fix, I haven't tested it but I'm pretty confident about it..


Answer

Thanks. I would need to see the entire LastErrorText -- especially the very beginning of it to know if you're using an older version of Chilkat. If using an older version, you'd first want to test with the very latest version..


Answer

Latest version is being used. Actually, we started with .49, in that version, not whole folder was synced yet success was returned. Then, we upgraded to .55, then we started to see the error/success mixed.

  SyncRemoteTree2:
    DllDate: Dec 29 2015
    ChilkatVersion: 9.5.0.55
    UnlockPrefix: *
    Username: *
    Architecture: Little Endian; 64-bit
    Language: ActiveX / x64
    VerboseLogging: 0
    putTree2:
      localRootDir: *
      ProgressMonitoring:
        enabled: yes
        heartbeatMs: 0
        sendBufferSize: 65536
      --ProgressMonitoring
      mode 2: Upload missing and newer files.
      PlanOnly: 0
      Mode: 2
      PreviewOnly: 0
      RecursiveDescend: 1
      FileCount: 256
      DirCount: 139


Answer

Thanks -- I'll have a look. In the one case, the data connection failed for a file, whereas in the problematic case (where "success" was returned), the data connection failed for the directory listing.


Answer

Our preliminary testing shows that the new version reliably returns failure.

Thanks.